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