authentik-api 2026.5.6 → 2026.8.0.rc2

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 (184) 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 +31 -1
  18. data/lib/authentik/api/models/brand_request.rb +31 -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 +45 -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_auth2_provider_setup_urls.rb +16 -4
  42. data/lib/authentik/api/models/o_auth_source.rb +0 -60
  43. data/lib/authentik/api/models/o_auth_source_request.rb +0 -60
  44. data/lib/authentik/api/models/object_attribute.rb +420 -0
  45. data/lib/authentik/api/models/object_attribute_request.rb +358 -0
  46. data/lib/authentik/api/models/object_attribute_type_enum.rb +35 -0
  47. data/lib/authentik/api/models/offboarding_action_enum.rb +34 -0
  48. data/lib/authentik/api/models/offboarding_status_enum.rb +36 -0
  49. data/lib/authentik/api/models/paginated_grant_request_list.rb +214 -0
  50. data/lib/authentik/api/models/paginated_o_auth2_dynamic_client_registration_list.rb +214 -0
  51. data/lib/authentik/api/models/paginated_object_attribute_list.rb +214 -0
  52. data/lib/authentik/api/models/paginated_request_rule_binding_list.rb +214 -0
  53. data/lib/authentik/api/models/paginated_request_rule_child_binding_list.rb +214 -0
  54. data/lib/authentik/api/models/paginated_request_rule_list.rb +214 -0
  55. data/lib/authentik/api/models/paginated_requestable_target_list.rb +214 -0
  56. data/lib/authentik/api/models/paginated_user_offboarding_list.rb +214 -0
  57. data/lib/authentik/api/models/patched_authenticator_web_authn_stage_request.rb +1 -11
  58. data/lib/authentik/api/models/patched_brand_request.rb +31 -1
  59. data/lib/authentik/api/models/patched_captcha_stage_request.rb +32 -1
  60. data/lib/authentik/api/models/patched_grant_request_fulfill_request.rb +175 -0
  61. data/lib/authentik/api/models/patched_ldap_source_request.rb +14 -4
  62. data/lib/authentik/api/models/patched_o_auth2_dynamic_client_registration_request.rb +286 -0
  63. data/lib/authentik/api/models/patched_o_auth2_provider_request.rb +1 -1
  64. data/lib/authentik/api/models/patched_o_auth_source_request.rb +0 -60
  65. data/lib/authentik/api/models/patched_object_attribute_request.rb +320 -0
  66. data/lib/authentik/api/models/patched_request_rule_binding_request.rb +249 -0
  67. data/lib/authentik/api/models/patched_request_rule_child_binding_request.rb +159 -0
  68. data/lib/authentik/api/models/patched_request_rule_request.rb +277 -0
  69. data/lib/authentik/api/models/patched_saml_source_request.rb +8 -8
  70. data/lib/authentik/api/models/patched_settings_request.rb +30 -1
  71. data/lib/authentik/api/models/patched_settings_request_flags.rb +1 -1
  72. data/lib/authentik/api/models/patched_ws_federation_provider_request.rb +11 -1
  73. data/lib/authentik/api/models/policy_binding.rb +42 -4
  74. data/lib/authentik/api/models/provider_type_enum.rb +2 -3
  75. data/lib/authentik/api/models/related_rule.rb +2 -2
  76. data/lib/authentik/api/models/related_target.rb +266 -0
  77. data/lib/authentik/api/models/request_content_type_enum.rb +34 -0
  78. data/lib/authentik/api/models/request_rule.rb +329 -0
  79. data/lib/authentik/api/models/request_rule_binding.rb +353 -0
  80. data/lib/authentik/api/models/request_rule_binding_request.rb +283 -0
  81. data/lib/authentik/api/models/{reviewer_user.rb → request_rule_child_binding.rb} +34 -99
  82. data/lib/authentik/api/models/request_rule_child_binding_request.rb +193 -0
  83. data/lib/authentik/api/models/request_rule_request.rb +284 -0
  84. data/lib/authentik/api/models/request_status.rb +36 -0
  85. data/lib/authentik/api/models/requestable_target.rb +278 -0
  86. data/lib/authentik/api/models/review.rb +1 -1
  87. data/lib/authentik/api/models/saml_source.rb +35 -8
  88. data/lib/authentik/api/models/saml_source_request.rb +8 -8
  89. data/lib/authentik/api/models/saml_version_enum.rb +34 -0
  90. data/lib/authentik/api/models/session_user.rb +32 -4
  91. data/lib/authentik/api/models/settings.rb +30 -1
  92. data/lib/authentik/api/models/settings_request.rb +30 -1
  93. data/lib/authentik/api/models/system_info.rb +31 -4
  94. data/lib/authentik/api/models/task_aggregated_status_enum.rb +2 -1
  95. data/lib/authentik/api/models/task_status_enum.rb +2 -1
  96. data/lib/authentik/api/models/user_offboarding.rb +379 -0
  97. data/lib/authentik/api/models/user_offboarding_request.rb +237 -0
  98. data/lib/authentik/api/models/user_self.rb +28 -1
  99. data/lib/authentik/api/models/user_switch_action_enum.rb +34 -0
  100. data/lib/authentik/api/models/user_switch_request.rb +173 -0
  101. data/lib/authentik/api/models/user_switch_response.rb +159 -0
  102. data/lib/authentik/api/models/ws_federation_provider.rb +41 -4
  103. data/lib/authentik/api/models/ws_federation_provider_request.rb +11 -1
  104. data/lib/authentik/api/version.rb +1 -1
  105. data/spec/api/admin_api_spec.rb +1 -0
  106. data/spec/api/core_api_spec.rb +119 -0
  107. data/spec/api/events_api_spec.rb +11 -0
  108. data/spec/api/lifecycle_api_spec.rb +47 -0
  109. data/spec/api/providers_api_spec.rb +73 -0
  110. data/spec/api/requests_api_spec.rb +365 -0
  111. data/spec/api/sources_api_spec.rb +2 -1
  112. data/spec/models/application_spec.rb +6 -0
  113. data/spec/models/authenticator_web_authn_stage_request_spec.rb +0 -6
  114. data/spec/models/authenticator_web_authn_stage_spec.rb +0 -6
  115. data/spec/models/brand_request_spec.rb +18 -0
  116. data/spec/models/brand_spec.rb +18 -0
  117. data/spec/models/captcha_stage_request_spec.rb +6 -0
  118. data/spec/models/captcha_stage_spec.rb +6 -0
  119. data/spec/models/content_type_spec.rb +6 -0
  120. data/spec/models/current_brand_flags_spec.rb +0 -12
  121. data/spec/models/current_brand_spec.rb +18 -0
  122. data/spec/models/device_user_binding_spec.rb +12 -0
  123. data/spec/models/grant_request_create_request_spec.rb +36 -0
  124. data/spec/models/grant_request_spec.rb +90 -0
  125. data/spec/models/{grant_types_enum_spec.rb → grant_type_enum_spec.rb} +6 -6
  126. data/spec/models/ldap_source_request_spec.rb +6 -0
  127. data/spec/models/ldap_source_spec.rb +6 -0
  128. data/spec/models/notification_mode_enum_spec.rb +24 -0
  129. data/spec/models/o_auth2_dynamic_client_registration_request_spec.rb +78 -0
  130. data/spec/models/o_auth2_dynamic_client_registration_spec.rb +84 -0
  131. data/spec/models/o_auth2_provider_setup_urls_spec.rb +6 -0
  132. data/spec/models/object_attribute_request_spec.rb +84 -0
  133. data/spec/models/object_attribute_spec.rb +108 -0
  134. data/spec/models/object_attribute_type_enum_spec.rb +24 -0
  135. data/spec/models/offboarding_action_enum_spec.rb +24 -0
  136. data/spec/models/offboarding_status_enum_spec.rb +24 -0
  137. data/spec/models/paginated_grant_request_list_spec.rb +42 -0
  138. data/spec/models/paginated_o_auth2_dynamic_client_registration_list_spec.rb +42 -0
  139. data/spec/models/paginated_object_attribute_list_spec.rb +42 -0
  140. data/spec/models/paginated_request_rule_binding_list_spec.rb +42 -0
  141. data/spec/models/paginated_request_rule_child_binding_list_spec.rb +42 -0
  142. data/spec/models/paginated_request_rule_list_spec.rb +42 -0
  143. data/spec/models/paginated_requestable_target_list_spec.rb +42 -0
  144. data/spec/models/paginated_user_offboarding_list_spec.rb +42 -0
  145. data/spec/models/patched_authenticator_web_authn_stage_request_spec.rb +0 -6
  146. data/spec/models/patched_brand_request_spec.rb +18 -0
  147. data/spec/models/patched_captcha_stage_request_spec.rb +6 -0
  148. data/spec/models/patched_grant_request_fulfill_request_spec.rb +36 -0
  149. data/spec/models/patched_ldap_source_request_spec.rb +6 -0
  150. data/spec/models/patched_o_auth2_dynamic_client_registration_request_spec.rb +78 -0
  151. data/spec/models/patched_object_attribute_request_spec.rb +84 -0
  152. data/spec/models/patched_request_rule_binding_request_spec.rb +60 -0
  153. data/spec/models/patched_request_rule_child_binding_request_spec.rb +42 -0
  154. data/spec/models/patched_request_rule_request_spec.rb +72 -0
  155. data/spec/models/patched_saml_source_request_spec.rb +1 -1
  156. data/spec/models/patched_settings_request_spec.rb +6 -0
  157. data/spec/models/patched_ws_federation_provider_request_spec.rb +6 -0
  158. data/spec/models/policy_binding_spec.rb +12 -0
  159. data/spec/models/related_target_spec.rb +54 -0
  160. data/spec/models/request_content_type_enum_spec.rb +24 -0
  161. data/spec/models/request_rule_binding_request_spec.rb +60 -0
  162. data/spec/models/request_rule_binding_spec.rb +84 -0
  163. data/spec/models/request_rule_child_binding_request_spec.rb +42 -0
  164. data/spec/models/{reviewer_user_spec.rb → request_rule_child_binding_spec.rb} +8 -14
  165. data/spec/models/request_rule_request_spec.rb +72 -0
  166. data/spec/models/request_rule_spec.rb +84 -0
  167. data/spec/models/request_status_spec.rb +24 -0
  168. data/spec/models/requestable_target_spec.rb +60 -0
  169. data/spec/models/saml_source_request_spec.rb +1 -1
  170. data/spec/models/saml_source_spec.rb +7 -1
  171. data/spec/models/saml_version_enum_spec.rb +24 -0
  172. data/spec/models/session_user_spec.rb +6 -0
  173. data/spec/models/settings_request_spec.rb +6 -0
  174. data/spec/models/settings_spec.rb +6 -0
  175. data/spec/models/system_info_spec.rb +6 -0
  176. data/spec/models/user_offboarding_request_spec.rb +54 -0
  177. data/spec/models/user_offboarding_spec.rb +90 -0
  178. data/spec/models/user_self_spec.rb +6 -0
  179. data/spec/models/user_switch_action_enum_spec.rb +24 -0
  180. data/spec/models/{reviewer_group_spec.rb → user_switch_request_spec.rb} +8 -8
  181. data/spec/models/user_switch_response_spec.rb +30 -0
  182. data/spec/models/ws_federation_provider_request_spec.rb +6 -0
  183. data/spec/models/ws_federation_provider_spec.rb +12 -0
  184. metadata +127 -10
@@ -0,0 +1,320 @@
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 PatchedObjectAttributeRequest < ApiModelBase
12
+ attr_accessor :object_type
13
+
14
+ attr_accessor :enabled
15
+
16
+ attr_accessor :key
17
+
18
+ attr_accessor :label
19
+
20
+ attr_accessor :regex
21
+
22
+ attr_accessor :type
23
+
24
+ attr_accessor :group
25
+
26
+ # 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.
27
+ attr_accessor :managed
28
+
29
+ attr_accessor :is_unique
30
+
31
+ attr_accessor :is_required
32
+
33
+ class EnumAttributeValidator
34
+ attr_reader :datatype
35
+ attr_reader :allowable_values
36
+
37
+ def initialize(datatype, allowable_values)
38
+ @allowable_values = allowable_values.map do |value|
39
+ case datatype.to_s
40
+ when /Integer/i
41
+ value.to_i
42
+ when /Float/i
43
+ value.to_f
44
+ else
45
+ value
46
+ end
47
+ end
48
+ end
49
+
50
+ def valid?(value)
51
+ !value || allowable_values.include?(value)
52
+ end
53
+ end
54
+
55
+ # Attribute mapping from ruby-style variable name to JSON key.
56
+ def self.attribute_map
57
+ {
58
+ :'object_type' => :'object_type',
59
+ :'enabled' => :'enabled',
60
+ :'key' => :'key',
61
+ :'label' => :'label',
62
+ :'regex' => :'regex',
63
+ :'type' => :'type',
64
+ :'group' => :'group',
65
+ :'managed' => :'managed',
66
+ :'is_unique' => :'is_unique',
67
+ :'is_required' => :'is_required'
68
+ }
69
+ end
70
+
71
+ # Returns attribute mapping this model knows about
72
+ def self.acceptable_attribute_map
73
+ attribute_map
74
+ end
75
+
76
+ # Returns all the JSON keys this model knows about
77
+ def self.acceptable_attributes
78
+ acceptable_attribute_map.values
79
+ end
80
+
81
+ # Attribute type mapping.
82
+ def self.openapi_types
83
+ {
84
+ :'object_type' => :'String',
85
+ :'enabled' => :'Boolean',
86
+ :'key' => :'String',
87
+ :'label' => :'String',
88
+ :'regex' => :'String',
89
+ :'type' => :'ObjectAttributeTypeEnum',
90
+ :'group' => :'String',
91
+ :'managed' => :'String',
92
+ :'is_unique' => :'Boolean',
93
+ :'is_required' => :'Boolean'
94
+ }
95
+ end
96
+
97
+ # List of attributes with nullable: true
98
+ def self.openapi_nullable
99
+ Set.new([
100
+ :'managed',
101
+ ])
102
+ end
103
+
104
+ # Initializes the object
105
+ # @param [Hash] attributes Model attributes in the form of hash
106
+ def initialize(attributes = {})
107
+ if (!attributes.is_a?(Hash))
108
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Authentik::Api::PatchedObjectAttributeRequest` initialize method"
109
+ end
110
+
111
+ # check to see if the attribute exists and convert string to symbol for hash key
112
+ acceptable_attribute_map = self.class.acceptable_attribute_map
113
+ attributes = attributes.each_with_object({}) { |(k, v), h|
114
+ if (!acceptable_attribute_map.key?(k.to_sym))
115
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Authentik::Api::PatchedObjectAttributeRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
116
+ end
117
+ h[k.to_sym] = v
118
+ }
119
+
120
+ if attributes.key?(:'object_type')
121
+ self.object_type = attributes[:'object_type']
122
+ end
123
+
124
+ if attributes.key?(:'enabled')
125
+ self.enabled = attributes[:'enabled']
126
+ else
127
+ self.enabled = true
128
+ end
129
+
130
+ if attributes.key?(:'key')
131
+ self.key = attributes[:'key']
132
+ end
133
+
134
+ if attributes.key?(:'label')
135
+ self.label = attributes[:'label']
136
+ end
137
+
138
+ if attributes.key?(:'regex')
139
+ self.regex = attributes[:'regex']
140
+ end
141
+
142
+ if attributes.key?(:'type')
143
+ self.type = attributes[:'type']
144
+ end
145
+
146
+ if attributes.key?(:'group')
147
+ self.group = attributes[:'group']
148
+ end
149
+
150
+ if attributes.key?(:'managed')
151
+ self.managed = attributes[:'managed']
152
+ end
153
+
154
+ if attributes.key?(:'is_unique')
155
+ self.is_unique = attributes[:'is_unique']
156
+ end
157
+
158
+ if attributes.key?(:'is_required')
159
+ self.is_required = attributes[:'is_required']
160
+ end
161
+ end
162
+
163
+ # Show invalid properties with the reasons. Usually used together with valid?
164
+ # @return Array for valid properties with the reasons
165
+ def list_invalid_properties
166
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
167
+ invalid_properties = Array.new
168
+ if !@object_type.nil? && @object_type.to_s.length < 1
169
+ invalid_properties.push('invalid value for "object_type", the character length must be greater than or equal to 1.')
170
+ end
171
+
172
+ if !@key.nil? && @key.to_s.length < 1
173
+ invalid_properties.push('invalid value for "key", the character length must be greater than or equal to 1.')
174
+ end
175
+
176
+ if !@label.nil? && @label.to_s.length < 1
177
+ invalid_properties.push('invalid value for "label", the character length must be greater than or equal to 1.')
178
+ end
179
+
180
+ if !@managed.nil? && @managed.to_s.length < 1
181
+ invalid_properties.push('invalid value for "managed", the character length must be greater than or equal to 1.')
182
+ end
183
+
184
+ invalid_properties
185
+ end
186
+
187
+ # Check to see if the all the properties in the model are valid
188
+ # @return true if the model is valid
189
+ def valid?
190
+ warn '[DEPRECATED] the `valid?` method is obsolete'
191
+ return false if !@object_type.nil? && @object_type.to_s.length < 1
192
+ return false if !@key.nil? && @key.to_s.length < 1
193
+ return false if !@label.nil? && @label.to_s.length < 1
194
+ return false if !@managed.nil? && @managed.to_s.length < 1
195
+ true
196
+ end
197
+
198
+ # Custom attribute writer method with validation
199
+ # @param [Object] object_type Value to be assigned
200
+ def object_type=(object_type)
201
+ if object_type.nil?
202
+ fail ArgumentError, 'object_type cannot be nil'
203
+ end
204
+
205
+ if object_type.to_s.length < 1
206
+ fail ArgumentError, 'invalid value for "object_type", the character length must be greater than or equal to 1.'
207
+ end
208
+
209
+ @object_type = object_type
210
+ end
211
+
212
+ # Custom attribute writer method with validation
213
+ # @param [Object] key Value to be assigned
214
+ def key=(key)
215
+ if key.nil?
216
+ fail ArgumentError, 'key cannot be nil'
217
+ end
218
+
219
+ if key.to_s.length < 1
220
+ fail ArgumentError, 'invalid value for "key", the character length must be greater than or equal to 1.'
221
+ end
222
+
223
+ @key = key
224
+ end
225
+
226
+ # Custom attribute writer method with validation
227
+ # @param [Object] label Value to be assigned
228
+ def label=(label)
229
+ if label.nil?
230
+ fail ArgumentError, 'label cannot be nil'
231
+ end
232
+
233
+ if label.to_s.length < 1
234
+ fail ArgumentError, 'invalid value for "label", the character length must be greater than or equal to 1.'
235
+ end
236
+
237
+ @label = label
238
+ end
239
+
240
+ # Custom attribute writer method with validation
241
+ # @param [Object] managed Value to be assigned
242
+ def managed=(managed)
243
+ if !managed.nil? && managed.to_s.length < 1
244
+ fail ArgumentError, 'invalid value for "managed", the character length must be greater than or equal to 1.'
245
+ end
246
+
247
+ @managed = managed
248
+ end
249
+
250
+ # Checks equality by comparing each attribute.
251
+ # @param [Object] Object to be compared
252
+ def ==(o)
253
+ return true if self.equal?(o)
254
+ self.class == o.class &&
255
+ object_type == o.object_type &&
256
+ enabled == o.enabled &&
257
+ key == o.key &&
258
+ label == o.label &&
259
+ regex == o.regex &&
260
+ type == o.type &&
261
+ group == o.group &&
262
+ managed == o.managed &&
263
+ is_unique == o.is_unique &&
264
+ is_required == o.is_required
265
+ end
266
+
267
+ # @see the `==` method
268
+ # @param [Object] Object to be compared
269
+ def eql?(o)
270
+ self == o
271
+ end
272
+
273
+ # Calculates hash code according to all attributes.
274
+ # @return [Integer] Hash code
275
+ def hash
276
+ [object_type, enabled, key, label, regex, type, group, managed, is_unique, is_required].hash
277
+ end
278
+
279
+ # Builds the object from hash
280
+ # @param [Hash] attributes Model attributes in the form of hash
281
+ # @return [Object] Returns the model itself
282
+ def self.build_from_hash(attributes)
283
+ return nil unless attributes.is_a?(Hash)
284
+ attributes = attributes.transform_keys(&:to_sym)
285
+ transformed_hash = {}
286
+ openapi_types.each_pair do |key, type|
287
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
288
+ transformed_hash["#{key}"] = nil
289
+ elsif type =~ /\AArray<(.*)>/i
290
+ # check to ensure the input is an array given that the attribute
291
+ # is documented as an array but the input is not
292
+ if attributes[attribute_map[key]].is_a?(Array)
293
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
294
+ end
295
+ elsif !attributes[attribute_map[key]].nil?
296
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
297
+ end
298
+ end
299
+ new(transformed_hash)
300
+ end
301
+
302
+ # Returns the object in the form of hash
303
+ # @return [Hash] Returns the object in the form of hash
304
+ def to_hash
305
+ hash = {}
306
+ self.class.attribute_map.each_pair do |attr, param|
307
+ value = self.send(attr)
308
+ if value.nil?
309
+ is_nullable = self.class.openapi_nullable.include?(attr)
310
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
311
+ end
312
+
313
+ hash[param] = _to_hash(value)
314
+ end
315
+ hash
316
+ end
317
+
318
+ end
319
+
320
+ end
@@ -0,0 +1,249 @@
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 PatchedRequestRuleBindingRequest < ApiModelBase
13
+ attr_accessor :uuid
14
+
15
+ attr_accessor :policy_engine_mode
16
+
17
+ attr_accessor :rule
18
+
19
+ attr_accessor :target
20
+
21
+ # How long a request against this binding stays pending before it automatically lapses if not approved or denied.
22
+ attr_accessor :expiry_pending
23
+
24
+ # The maximum duration a grant approved against this binding can last.
25
+ attr_accessor :expiry_granted_max
26
+
27
+ class EnumAttributeValidator
28
+ attr_reader :datatype
29
+ attr_reader :allowable_values
30
+
31
+ def initialize(datatype, allowable_values)
32
+ @allowable_values = allowable_values.map do |value|
33
+ case datatype.to_s
34
+ when /Integer/i
35
+ value.to_i
36
+ when /Float/i
37
+ value.to_f
38
+ else
39
+ value
40
+ end
41
+ end
42
+ end
43
+
44
+ def valid?(value)
45
+ !value || allowable_values.include?(value)
46
+ end
47
+ end
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ :'uuid' => :'uuid',
53
+ :'policy_engine_mode' => :'policy_engine_mode',
54
+ :'rule' => :'rule',
55
+ :'target' => :'target',
56
+ :'expiry_pending' => :'expiry_pending',
57
+ :'expiry_granted_max' => :'expiry_granted_max'
58
+ }
59
+ end
60
+
61
+ # Returns attribute mapping this model knows about
62
+ def self.acceptable_attribute_map
63
+ attribute_map
64
+ end
65
+
66
+ # Returns all the JSON keys this model knows about
67
+ def self.acceptable_attributes
68
+ acceptable_attribute_map.values
69
+ end
70
+
71
+ # Attribute type mapping.
72
+ def self.openapi_types
73
+ {
74
+ :'uuid' => :'String',
75
+ :'policy_engine_mode' => :'PolicyEngineMode',
76
+ :'rule' => :'String',
77
+ :'target' => :'String',
78
+ :'expiry_pending' => :'String',
79
+ :'expiry_granted_max' => :'String'
80
+ }
81
+ end
82
+
83
+ # List of attributes with nullable: true
84
+ def self.openapi_nullable
85
+ Set.new([
86
+ ])
87
+ end
88
+
89
+ # Initializes the object
90
+ # @param [Hash] attributes Model attributes in the form of hash
91
+ def initialize(attributes = {})
92
+ if (!attributes.is_a?(Hash))
93
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Authentik::Api::PatchedRequestRuleBindingRequest` initialize method"
94
+ end
95
+
96
+ # check to see if the attribute exists and convert string to symbol for hash key
97
+ acceptable_attribute_map = self.class.acceptable_attribute_map
98
+ attributes = attributes.each_with_object({}) { |(k, v), h|
99
+ if (!acceptable_attribute_map.key?(k.to_sym))
100
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Authentik::Api::PatchedRequestRuleBindingRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
101
+ end
102
+ h[k.to_sym] = v
103
+ }
104
+
105
+ if attributes.key?(:'uuid')
106
+ self.uuid = attributes[:'uuid']
107
+ end
108
+
109
+ if attributes.key?(:'policy_engine_mode')
110
+ self.policy_engine_mode = attributes[:'policy_engine_mode']
111
+ end
112
+
113
+ if attributes.key?(:'rule')
114
+ self.rule = attributes[:'rule']
115
+ end
116
+
117
+ if attributes.key?(:'target')
118
+ self.target = attributes[:'target']
119
+ end
120
+
121
+ if attributes.key?(:'expiry_pending')
122
+ self.expiry_pending = attributes[:'expiry_pending']
123
+ end
124
+
125
+ if attributes.key?(:'expiry_granted_max')
126
+ self.expiry_granted_max = attributes[:'expiry_granted_max']
127
+ end
128
+ end
129
+
130
+ # Show invalid properties with the reasons. Usually used together with valid?
131
+ # @return Array for valid properties with the reasons
132
+ def list_invalid_properties
133
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
134
+ invalid_properties = Array.new
135
+ if !@expiry_pending.nil? && @expiry_pending.to_s.length < 1
136
+ invalid_properties.push('invalid value for "expiry_pending", the character length must be greater than or equal to 1.')
137
+ end
138
+
139
+ if !@expiry_granted_max.nil? && @expiry_granted_max.to_s.length < 1
140
+ invalid_properties.push('invalid value for "expiry_granted_max", the character length must be greater than or equal to 1.')
141
+ end
142
+
143
+ invalid_properties
144
+ end
145
+
146
+ # Check to see if the all the properties in the model are valid
147
+ # @return true if the model is valid
148
+ def valid?
149
+ warn '[DEPRECATED] the `valid?` method is obsolete'
150
+ return false if !@expiry_pending.nil? && @expiry_pending.to_s.length < 1
151
+ return false if !@expiry_granted_max.nil? && @expiry_granted_max.to_s.length < 1
152
+ true
153
+ end
154
+
155
+ # Custom attribute writer method with validation
156
+ # @param [Object] expiry_pending Value to be assigned
157
+ def expiry_pending=(expiry_pending)
158
+ if expiry_pending.nil?
159
+ fail ArgumentError, 'expiry_pending cannot be nil'
160
+ end
161
+
162
+ if expiry_pending.to_s.length < 1
163
+ fail ArgumentError, 'invalid value for "expiry_pending", the character length must be greater than or equal to 1.'
164
+ end
165
+
166
+ @expiry_pending = expiry_pending
167
+ end
168
+
169
+ # Custom attribute writer method with validation
170
+ # @param [Object] expiry_granted_max Value to be assigned
171
+ def expiry_granted_max=(expiry_granted_max)
172
+ if expiry_granted_max.nil?
173
+ fail ArgumentError, 'expiry_granted_max cannot be nil'
174
+ end
175
+
176
+ if expiry_granted_max.to_s.length < 1
177
+ fail ArgumentError, 'invalid value for "expiry_granted_max", the character length must be greater than or equal to 1.'
178
+ end
179
+
180
+ @expiry_granted_max = expiry_granted_max
181
+ end
182
+
183
+ # Checks equality by comparing each attribute.
184
+ # @param [Object] Object to be compared
185
+ def ==(o)
186
+ return true if self.equal?(o)
187
+ self.class == o.class &&
188
+ uuid == o.uuid &&
189
+ policy_engine_mode == o.policy_engine_mode &&
190
+ rule == o.rule &&
191
+ target == o.target &&
192
+ expiry_pending == o.expiry_pending &&
193
+ expiry_granted_max == o.expiry_granted_max
194
+ end
195
+
196
+ # @see the `==` method
197
+ # @param [Object] Object to be compared
198
+ def eql?(o)
199
+ self == o
200
+ end
201
+
202
+ # Calculates hash code according to all attributes.
203
+ # @return [Integer] Hash code
204
+ def hash
205
+ [uuid, policy_engine_mode, rule, target, expiry_pending, expiry_granted_max].hash
206
+ end
207
+
208
+ # Builds the object from hash
209
+ # @param [Hash] attributes Model attributes in the form of hash
210
+ # @return [Object] Returns the model itself
211
+ def self.build_from_hash(attributes)
212
+ return nil unless attributes.is_a?(Hash)
213
+ attributes = attributes.transform_keys(&:to_sym)
214
+ transformed_hash = {}
215
+ openapi_types.each_pair do |key, type|
216
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
217
+ transformed_hash["#{key}"] = nil
218
+ elsif type =~ /\AArray<(.*)>/i
219
+ # check to ensure the input is an array given that the attribute
220
+ # is documented as an array but the input is not
221
+ if attributes[attribute_map[key]].is_a?(Array)
222
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
223
+ end
224
+ elsif !attributes[attribute_map[key]].nil?
225
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
226
+ end
227
+ end
228
+ new(transformed_hash)
229
+ end
230
+
231
+ # Returns the object in the form of hash
232
+ # @return [Hash] Returns the object in the form of hash
233
+ def to_hash
234
+ hash = {}
235
+ self.class.attribute_map.each_pair do |attr, param|
236
+ value = self.send(attr)
237
+ if value.nil?
238
+ is_nullable = self.class.openapi_nullable.include?(attr)
239
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
240
+ end
241
+
242
+ hash[param] = _to_hash(value)
243
+ end
244
+ hash
245
+ end
246
+
247
+ end
248
+
249
+ end