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,286 @@
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
+ # Serializer for OAuth2DynamicClientRegistration
12
+ class PatchedOAuth2DynamicClientRegistrationRequest < ApiModelBase
13
+ attr_accessor :provider
14
+
15
+ # Group to assign to automatically created applications.
16
+ attr_accessor :default_application_group
17
+
18
+ # Authorization flow applied to dynamically registered clients.
19
+ attr_accessor :override_authorization_flow
20
+
21
+ attr_accessor :override_invalidation_flow
22
+
23
+ # Scope mappings applied to dynamically registered clients.
24
+ attr_accessor :override_property_mappings
25
+
26
+ # Maximum access token validity for registered clients (Format: hours=1;minutes=2;seconds=3).
27
+ attr_accessor :access_token_validity
28
+
29
+ # Maximum refresh token validity for registered clients (Format: hours=1;minutes=2;seconds=3).
30
+ attr_accessor :refresh_token_validity
31
+
32
+ # If empty, all grant types are allowed.
33
+ attr_accessor :allowed_grant_types
34
+
35
+ attr_accessor :policy_engine_mode
36
+
37
+ class EnumAttributeValidator
38
+ attr_reader :datatype
39
+ attr_reader :allowable_values
40
+
41
+ def initialize(datatype, allowable_values)
42
+ @allowable_values = allowable_values.map do |value|
43
+ case datatype.to_s
44
+ when /Integer/i
45
+ value.to_i
46
+ when /Float/i
47
+ value.to_f
48
+ else
49
+ value
50
+ end
51
+ end
52
+ end
53
+
54
+ def valid?(value)
55
+ !value || allowable_values.include?(value)
56
+ end
57
+ end
58
+
59
+ # Attribute mapping from ruby-style variable name to JSON key.
60
+ def self.attribute_map
61
+ {
62
+ :'provider' => :'provider',
63
+ :'default_application_group' => :'default_application_group',
64
+ :'override_authorization_flow' => :'override_authorization_flow',
65
+ :'override_invalidation_flow' => :'override_invalidation_flow',
66
+ :'override_property_mappings' => :'override_property_mappings',
67
+ :'access_token_validity' => :'access_token_validity',
68
+ :'refresh_token_validity' => :'refresh_token_validity',
69
+ :'allowed_grant_types' => :'allowed_grant_types',
70
+ :'policy_engine_mode' => :'policy_engine_mode'
71
+ }
72
+ end
73
+
74
+ # Returns attribute mapping this model knows about
75
+ def self.acceptable_attribute_map
76
+ attribute_map
77
+ end
78
+
79
+ # Returns all the JSON keys this model knows about
80
+ def self.acceptable_attributes
81
+ acceptable_attribute_map.values
82
+ end
83
+
84
+ # Attribute type mapping.
85
+ def self.openapi_types
86
+ {
87
+ :'provider' => :'Integer',
88
+ :'default_application_group' => :'String',
89
+ :'override_authorization_flow' => :'String',
90
+ :'override_invalidation_flow' => :'String',
91
+ :'override_property_mappings' => :'Array<String>',
92
+ :'access_token_validity' => :'String',
93
+ :'refresh_token_validity' => :'String',
94
+ :'allowed_grant_types' => :'Array<GrantTypeEnum>',
95
+ :'policy_engine_mode' => :'PolicyEngineMode'
96
+ }
97
+ end
98
+
99
+ # List of attributes with nullable: true
100
+ def self.openapi_nullable
101
+ Set.new([
102
+ :'override_authorization_flow',
103
+ :'override_invalidation_flow',
104
+ ])
105
+ end
106
+
107
+ # Initializes the object
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ def initialize(attributes = {})
110
+ if (!attributes.is_a?(Hash))
111
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Authentik::Api::PatchedOAuth2DynamicClientRegistrationRequest` initialize method"
112
+ end
113
+
114
+ # check to see if the attribute exists and convert string to symbol for hash key
115
+ acceptable_attribute_map = self.class.acceptable_attribute_map
116
+ attributes = attributes.each_with_object({}) { |(k, v), h|
117
+ if (!acceptable_attribute_map.key?(k.to_sym))
118
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Authentik::Api::PatchedOAuth2DynamicClientRegistrationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
119
+ end
120
+ h[k.to_sym] = v
121
+ }
122
+
123
+ if attributes.key?(:'provider')
124
+ self.provider = attributes[:'provider']
125
+ end
126
+
127
+ if attributes.key?(:'default_application_group')
128
+ self.default_application_group = attributes[:'default_application_group']
129
+ end
130
+
131
+ if attributes.key?(:'override_authorization_flow')
132
+ self.override_authorization_flow = attributes[:'override_authorization_flow']
133
+ end
134
+
135
+ if attributes.key?(:'override_invalidation_flow')
136
+ self.override_invalidation_flow = attributes[:'override_invalidation_flow']
137
+ end
138
+
139
+ if attributes.key?(:'override_property_mappings')
140
+ if (value = attributes[:'override_property_mappings']).is_a?(Array)
141
+ self.override_property_mappings = value
142
+ end
143
+ end
144
+
145
+ if attributes.key?(:'access_token_validity')
146
+ self.access_token_validity = attributes[:'access_token_validity']
147
+ end
148
+
149
+ if attributes.key?(:'refresh_token_validity')
150
+ self.refresh_token_validity = attributes[:'refresh_token_validity']
151
+ end
152
+
153
+ if attributes.key?(:'allowed_grant_types')
154
+ if (value = attributes[:'allowed_grant_types']).is_a?(Array)
155
+ self.allowed_grant_types = value
156
+ end
157
+ end
158
+
159
+ if attributes.key?(:'policy_engine_mode')
160
+ self.policy_engine_mode = attributes[:'policy_engine_mode']
161
+ end
162
+ end
163
+
164
+ # Show invalid properties with the reasons. Usually used together with valid?
165
+ # @return Array for valid properties with the reasons
166
+ def list_invalid_properties
167
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
168
+ invalid_properties = Array.new
169
+ if !@access_token_validity.nil? && @access_token_validity.to_s.length < 1
170
+ invalid_properties.push('invalid value for "access_token_validity", the character length must be greater than or equal to 1.')
171
+ end
172
+
173
+ if !@refresh_token_validity.nil? && @refresh_token_validity.to_s.length < 1
174
+ invalid_properties.push('invalid value for "refresh_token_validity", the character length must be greater than or equal to 1.')
175
+ end
176
+
177
+ invalid_properties
178
+ end
179
+
180
+ # Check to see if the all the properties in the model are valid
181
+ # @return true if the model is valid
182
+ def valid?
183
+ warn '[DEPRECATED] the `valid?` method is obsolete'
184
+ return false if !@access_token_validity.nil? && @access_token_validity.to_s.length < 1
185
+ return false if !@refresh_token_validity.nil? && @refresh_token_validity.to_s.length < 1
186
+ true
187
+ end
188
+
189
+ # Custom attribute writer method with validation
190
+ # @param [Object] access_token_validity Value to be assigned
191
+ def access_token_validity=(access_token_validity)
192
+ if access_token_validity.nil?
193
+ fail ArgumentError, 'access_token_validity cannot be nil'
194
+ end
195
+
196
+ if access_token_validity.to_s.length < 1
197
+ fail ArgumentError, 'invalid value for "access_token_validity", the character length must be greater than or equal to 1.'
198
+ end
199
+
200
+ @access_token_validity = access_token_validity
201
+ end
202
+
203
+ # Custom attribute writer method with validation
204
+ # @param [Object] refresh_token_validity Value to be assigned
205
+ def refresh_token_validity=(refresh_token_validity)
206
+ if refresh_token_validity.nil?
207
+ fail ArgumentError, 'refresh_token_validity cannot be nil'
208
+ end
209
+
210
+ if refresh_token_validity.to_s.length < 1
211
+ fail ArgumentError, 'invalid value for "refresh_token_validity", the character length must be greater than or equal to 1.'
212
+ end
213
+
214
+ @refresh_token_validity = refresh_token_validity
215
+ end
216
+
217
+ # Checks equality by comparing each attribute.
218
+ # @param [Object] Object to be compared
219
+ def ==(o)
220
+ return true if self.equal?(o)
221
+ self.class == o.class &&
222
+ provider == o.provider &&
223
+ default_application_group == o.default_application_group &&
224
+ override_authorization_flow == o.override_authorization_flow &&
225
+ override_invalidation_flow == o.override_invalidation_flow &&
226
+ override_property_mappings == o.override_property_mappings &&
227
+ access_token_validity == o.access_token_validity &&
228
+ refresh_token_validity == o.refresh_token_validity &&
229
+ allowed_grant_types == o.allowed_grant_types &&
230
+ policy_engine_mode == o.policy_engine_mode
231
+ end
232
+
233
+ # @see the `==` method
234
+ # @param [Object] Object to be compared
235
+ def eql?(o)
236
+ self == o
237
+ end
238
+
239
+ # Calculates hash code according to all attributes.
240
+ # @return [Integer] Hash code
241
+ def hash
242
+ [provider, default_application_group, override_authorization_flow, override_invalidation_flow, override_property_mappings, access_token_validity, refresh_token_validity, allowed_grant_types, policy_engine_mode].hash
243
+ end
244
+
245
+ # Builds the object from hash
246
+ # @param [Hash] attributes Model attributes in the form of hash
247
+ # @return [Object] Returns the model itself
248
+ def self.build_from_hash(attributes)
249
+ return nil unless attributes.is_a?(Hash)
250
+ attributes = attributes.transform_keys(&:to_sym)
251
+ transformed_hash = {}
252
+ openapi_types.each_pair do |key, type|
253
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
254
+ transformed_hash["#{key}"] = nil
255
+ elsif type =~ /\AArray<(.*)>/i
256
+ # check to ensure the input is an array given that the attribute
257
+ # is documented as an array but the input is not
258
+ if attributes[attribute_map[key]].is_a?(Array)
259
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
260
+ end
261
+ elsif !attributes[attribute_map[key]].nil?
262
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
263
+ end
264
+ end
265
+ new(transformed_hash)
266
+ end
267
+
268
+ # Returns the object in the form of hash
269
+ # @return [Hash] Returns the object in the form of hash
270
+ def to_hash
271
+ hash = {}
272
+ self.class.attribute_map.each_pair do |attr, param|
273
+ value = self.send(attr)
274
+ if value.nil?
275
+ is_nullable = self.class.openapi_nullable.include?(attr)
276
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
277
+ end
278
+
279
+ hash[param] = _to_hash(value)
280
+ end
281
+ hash
282
+ end
283
+
284
+ end
285
+
286
+ end
@@ -140,7 +140,7 @@ module Authentik::Api
140
140
  :'invalidation_flow' => :'String',
141
141
  :'property_mappings' => :'Array<String>',
142
142
  :'client_type' => :'ClientTypeEnum',
143
- :'grant_types' => :'Array<GrantTypesEnum>',
143
+ :'grant_types' => :'Array<GrantTypeEnum>',
144
144
  :'client_id' => :'String',
145
145
  :'client_secret' => :'String',
146
146
  :'access_code_validity' => :'String',
@@ -331,22 +331,6 @@ module Authentik::Api
331
331
  invalid_properties.push('invalid value for "user_path_template", the character length must be greater than or equal to 1.')
332
332
  end
333
333
 
334
- if !@request_token_url.nil? && @request_token_url.to_s.length > 255
335
- invalid_properties.push('invalid value for "request_token_url", the character length must be smaller than or equal to 255.')
336
- end
337
-
338
- if !@authorization_url.nil? && @authorization_url.to_s.length > 255
339
- invalid_properties.push('invalid value for "authorization_url", the character length must be smaller than or equal to 255.')
340
- end
341
-
342
- if !@access_token_url.nil? && @access_token_url.to_s.length > 255
343
- invalid_properties.push('invalid value for "access_token_url", the character length must be smaller than or equal to 255.')
344
- end
345
-
346
- if !@profile_url.nil? && @profile_url.to_s.length > 255
347
- invalid_properties.push('invalid value for "profile_url", the character length must be smaller than or equal to 255.')
348
- end
349
-
350
334
  if !@consumer_key.nil? && @consumer_key.to_s.length < 1
351
335
  invalid_properties.push('invalid value for "consumer_key", the character length must be greater than or equal to 1.')
352
336
  end
@@ -366,10 +350,6 @@ module Authentik::Api
366
350
  return false if !@slug.nil? && @slug.to_s.length < 1
367
351
  return false if !@slug.nil? && @slug !~ Regexp.new(/^[-a-zA-Z0-9_]+$/)
368
352
  return false if !@user_path_template.nil? && @user_path_template.to_s.length < 1
369
- return false if !@request_token_url.nil? && @request_token_url.to_s.length > 255
370
- return false if !@authorization_url.nil? && @authorization_url.to_s.length > 255
371
- return false if !@access_token_url.nil? && @access_token_url.to_s.length > 255
372
- return false if !@profile_url.nil? && @profile_url.to_s.length > 255
373
353
  return false if !@consumer_key.nil? && @consumer_key.to_s.length < 1
374
354
  return false if !@consumer_secret.nil? && @consumer_secret.to_s.length < 1
375
355
  true
@@ -422,46 +402,6 @@ module Authentik::Api
422
402
  @user_path_template = user_path_template
423
403
  end
424
404
 
425
- # Custom attribute writer method with validation
426
- # @param [Object] request_token_url Value to be assigned
427
- def request_token_url=(request_token_url)
428
- if !request_token_url.nil? && request_token_url.to_s.length > 255
429
- fail ArgumentError, 'invalid value for "request_token_url", the character length must be smaller than or equal to 255.'
430
- end
431
-
432
- @request_token_url = request_token_url
433
- end
434
-
435
- # Custom attribute writer method with validation
436
- # @param [Object] authorization_url Value to be assigned
437
- def authorization_url=(authorization_url)
438
- if !authorization_url.nil? && authorization_url.to_s.length > 255
439
- fail ArgumentError, 'invalid value for "authorization_url", the character length must be smaller than or equal to 255.'
440
- end
441
-
442
- @authorization_url = authorization_url
443
- end
444
-
445
- # Custom attribute writer method with validation
446
- # @param [Object] access_token_url Value to be assigned
447
- def access_token_url=(access_token_url)
448
- if !access_token_url.nil? && access_token_url.to_s.length > 255
449
- fail ArgumentError, 'invalid value for "access_token_url", the character length must be smaller than or equal to 255.'
450
- end
451
-
452
- @access_token_url = access_token_url
453
- end
454
-
455
- # Custom attribute writer method with validation
456
- # @param [Object] profile_url Value to be assigned
457
- def profile_url=(profile_url)
458
- if !profile_url.nil? && profile_url.to_s.length > 255
459
- fail ArgumentError, 'invalid value for "profile_url", the character length must be smaller than or equal to 255.'
460
- end
461
-
462
- @profile_url = profile_url
463
- end
464
-
465
405
  # Custom attribute writer method with validation
466
406
  # @param [Object] consumer_key Value to be assigned
467
407
  def consumer_key=(consumer_key)
@@ -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