authentik-api 2025.12.4 → 2026.2.1.1

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 (112) hide show
  1. checksums.yaml +4 -4
  2. data/README_API.md +59 -7
  3. data/lib/authentik/api/api/core_api.rb +109 -12
  4. data/lib/authentik/api/api/crypto_api.rb +0 -3
  5. data/lib/authentik/api/api/endpoints_api.rb +459 -0
  6. data/lib/authentik/api/api/events_api.rb +3 -3
  7. data/lib/authentik/api/api/lifecycle_api.rb +681 -0
  8. data/lib/authentik/api/api/policies_api.rb +1 -1
  9. data/lib/authentik/api/api/providers_api.rb +705 -3
  10. data/lib/authentik/api/api/rbac_api.rb +6 -9
  11. data/lib/authentik/api/api/stages_api.rb +1 -1
  12. data/lib/authentik/api/models/alg_enum.rb +3 -1
  13. data/lib/authentik/api/models/app_enum.rb +4 -1
  14. data/lib/authentik/api/models/bulk_delete_session_response.rb +158 -0
  15. data/lib/authentik/api/models/certificate_key_pair.rb +5 -4
  16. data/lib/authentik/api/models/content_type_enum.rb +35 -0
  17. data/lib/authentik/api/models/contextual_flow_info_layout_enum.rb +3 -1
  18. data/lib/authentik/api/models/current_brand_flags.rb +27 -1
  19. data/lib/authentik/api/models/device_access_group.rb +15 -4
  20. data/lib/authentik/api/models/device_access_group_request.rb +15 -4
  21. data/lib/authentik/api/models/device_fact_snapshot.rb +53 -5
  22. data/lib/authentik/api/models/event_actions.rb +6 -1
  23. data/lib/authentik/api/models/fleet_connector.rb +349 -0
  24. data/lib/authentik/api/models/fleet_connector_request.rb +294 -0
  25. data/lib/authentik/api/models/flow_layout_enum.rb +3 -1
  26. data/lib/authentik/api/models/identification_challenge.rb +11 -1
  27. data/lib/authentik/api/models/lifecycle_iteration.rb +525 -0
  28. data/lib/authentik/api/models/lifecycle_iteration_request.rb +181 -0
  29. data/lib/authentik/api/models/lifecycle_iteration_state_enum.rb +36 -0
  30. data/lib/authentik/api/models/lifecycle_rule.rb +440 -0
  31. data/lib/authentik/api/models/lifecycle_rule_request.rb +394 -0
  32. data/lib/authentik/api/models/model_enum.rb +6 -1
  33. data/lib/authentik/api/models/model_request.rb +4 -2
  34. data/lib/authentik/api/models/operating_system.rb +3 -0
  35. data/lib/authentik/api/models/operating_system_request.rb +3 -0
  36. data/lib/authentik/api/models/paginated_fleet_connector_list.rb +214 -0
  37. data/lib/authentik/api/models/paginated_lifecycle_iteration_list.rb +214 -0
  38. data/lib/authentik/api/models/paginated_lifecycle_rule_list.rb +214 -0
  39. data/lib/authentik/api/models/paginated_ws_federation_provider_list.rb +214 -0
  40. data/lib/authentik/api/models/patched_device_access_group_request.rb +15 -4
  41. data/lib/authentik/api/models/patched_fleet_connector_request.rb +273 -0
  42. data/lib/authentik/api/models/patched_lifecycle_rule_request.rb +353 -0
  43. data/lib/authentik/api/models/patched_role_request.rb +0 -9
  44. data/lib/authentik/api/models/patched_saml_provider_request.rb +1 -1
  45. data/lib/authentik/api/models/patched_scim_provider_request.rb +13 -11
  46. data/lib/authentik/api/models/patched_settings_request_flags.rb +27 -1
  47. data/lib/authentik/api/models/patched_ws_federation_provider_request.rb +457 -0
  48. data/lib/authentik/api/models/provider_model_enum.rb +2 -1
  49. data/lib/authentik/api/models/review.rb +247 -0
  50. data/lib/authentik/api/models/review_request.rb +184 -0
  51. data/lib/authentik/api/models/reviewer_group.rb +184 -0
  52. data/lib/authentik/api/models/reviewer_user.rb +258 -0
  53. data/lib/authentik/api/models/role.rb +0 -9
  54. data/lib/authentik/api/models/role_request.rb +0 -9
  55. data/lib/authentik/api/models/{saml_provider_logout_method_enum.rb → saml_logout_methods.rb} +3 -3
  56. data/lib/authentik/api/models/saml_provider.rb +1 -1
  57. data/lib/authentik/api/models/saml_provider_request.rb +1 -1
  58. data/lib/authentik/api/models/scim_provider.rb +13 -11
  59. data/lib/authentik/api/models/scim_provider_request.rb +13 -11
  60. data/lib/authentik/api/models/task.rb +1 -1
  61. data/lib/authentik/api/models/{state_enum.rb → task_state_enum.rb} +3 -3
  62. data/lib/authentik/api/models/user_recovery_email_request.rb +187 -0
  63. data/lib/authentik/api/models/user_recovery_link_request.rb +161 -0
  64. data/lib/authentik/api/models/vendor_enum.rb +35 -0
  65. data/lib/authentik/api/models/ws_federation_provider.rb +668 -0
  66. data/lib/authentik/api/models/ws_federation_provider_request.rb +512 -0
  67. data/lib/authentik/api/version.rb +1 -1
  68. data/spec/api/core_api_spec.rb +21 -1
  69. data/spec/api/crypto_api_spec.rb +0 -1
  70. data/spec/api/endpoints_api_spec.rb +83 -0
  71. data/spec/api/lifecycle_api_spec.rb +144 -0
  72. data/spec/api/providers_api_spec.rb +137 -1
  73. data/spec/api/rbac_api_spec.rb +2 -3
  74. data/spec/models/bulk_delete_session_response_spec.rb +30 -0
  75. data/spec/models/content_type_enum_spec.rb +24 -0
  76. data/spec/models/current_brand_flags_spec.rb +6 -0
  77. data/spec/models/device_access_group_request_spec.rb +6 -0
  78. data/spec/models/device_access_group_spec.rb +6 -0
  79. data/spec/models/device_fact_snapshot_spec.rb +6 -0
  80. data/spec/models/fleet_connector_request_spec.rb +72 -0
  81. data/spec/models/fleet_connector_spec.rb +90 -0
  82. data/spec/models/identification_challenge_spec.rb +6 -0
  83. data/spec/models/lifecycle_iteration_request_spec.rb +30 -0
  84. data/spec/models/lifecycle_iteration_spec.rb +108 -0
  85. data/spec/models/lifecycle_iteration_state_enum_spec.rb +24 -0
  86. data/spec/models/lifecycle_rule_request_spec.rb +84 -0
  87. data/spec/models/lifecycle_rule_spec.rb +108 -0
  88. data/spec/models/paginated_fleet_connector_list_spec.rb +42 -0
  89. data/spec/models/paginated_lifecycle_iteration_list_spec.rb +42 -0
  90. data/spec/models/paginated_lifecycle_rule_list_spec.rb +42 -0
  91. data/spec/models/paginated_ws_federation_provider_list_spec.rb +42 -0
  92. data/spec/models/patched_device_access_group_request_spec.rb +6 -0
  93. data/spec/models/patched_fleet_connector_request_spec.rb +72 -0
  94. data/spec/models/patched_lifecycle_rule_request_spec.rb +84 -0
  95. data/spec/models/patched_scim_provider_request_spec.rb +3 -3
  96. data/spec/models/patched_settings_request_flags_spec.rb +6 -0
  97. data/spec/models/patched_ws_federation_provider_request_spec.rb +138 -0
  98. data/spec/models/review_request_spec.rb +36 -0
  99. data/spec/models/review_spec.rb +54 -0
  100. data/spec/models/reviewer_group_spec.rb +36 -0
  101. data/spec/models/reviewer_user_spec.rb +48 -0
  102. data/spec/models/saml_logout_methods_spec.rb +24 -0
  103. data/spec/models/scim_provider_request_spec.rb +3 -3
  104. data/spec/models/scim_provider_spec.rb +3 -3
  105. data/spec/models/task_state_enum_spec.rb +24 -0
  106. data/spec/models/user_recovery_email_request_spec.rb +36 -0
  107. data/spec/models/user_recovery_link_request_spec.rb +30 -0
  108. data/spec/models/{state_enum_spec.rb → vendor_enum_spec.rb} +6 -6
  109. data/spec/models/ws_federation_provider_request_spec.rb +138 -0
  110. data/spec/models/ws_federation_provider_spec.rb +204 -0
  111. metadata +85 -7
  112. data/spec/models/saml_provider_logout_method_enum_spec.rb +0 -24
@@ -0,0 +1,247 @@
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 Review < ApiModelBase
13
+ attr_accessor :id
14
+
15
+ attr_accessor :iteration
16
+
17
+ attr_accessor :reviewer
18
+
19
+ attr_accessor :timestamp
20
+
21
+ attr_accessor :note
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'id' => :'id',
27
+ :'iteration' => :'iteration',
28
+ :'reviewer' => :'reviewer',
29
+ :'timestamp' => :'timestamp',
30
+ :'note' => :'note'
31
+ }
32
+ end
33
+
34
+ # Returns attribute mapping this model knows about
35
+ def self.acceptable_attribute_map
36
+ attribute_map
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ acceptable_attribute_map.values
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'id' => :'String',
48
+ :'iteration' => :'String',
49
+ :'reviewer' => :'ReviewerUser',
50
+ :'timestamp' => :'Time',
51
+ :'note' => :'String'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ :'note'
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Authentik::Api::Review` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Authentik::Api::Review`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'id')
79
+ self.id = attributes[:'id']
80
+ else
81
+ self.id = nil
82
+ end
83
+
84
+ if attributes.key?(:'iteration')
85
+ self.iteration = attributes[:'iteration']
86
+ else
87
+ self.iteration = nil
88
+ end
89
+
90
+ if attributes.key?(:'reviewer')
91
+ self.reviewer = attributes[:'reviewer']
92
+ else
93
+ self.reviewer = nil
94
+ end
95
+
96
+ if attributes.key?(:'timestamp')
97
+ self.timestamp = attributes[:'timestamp']
98
+ else
99
+ self.timestamp = nil
100
+ end
101
+
102
+ if attributes.key?(:'note')
103
+ self.note = attributes[:'note']
104
+ end
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
111
+ invalid_properties = Array.new
112
+ if @id.nil?
113
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
114
+ end
115
+
116
+ if @iteration.nil?
117
+ invalid_properties.push('invalid value for "iteration", iteration cannot be nil.')
118
+ end
119
+
120
+ if @reviewer.nil?
121
+ invalid_properties.push('invalid value for "reviewer", reviewer cannot be nil.')
122
+ end
123
+
124
+ if @timestamp.nil?
125
+ invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.')
126
+ end
127
+
128
+ invalid_properties
129
+ end
130
+
131
+ # Check to see if the all the properties in the model are valid
132
+ # @return true if the model is valid
133
+ def valid?
134
+ warn '[DEPRECATED] the `valid?` method is obsolete'
135
+ return false if @id.nil?
136
+ return false if @iteration.nil?
137
+ return false if @reviewer.nil?
138
+ return false if @timestamp.nil?
139
+ true
140
+ end
141
+
142
+ # Custom attribute writer method with validation
143
+ # @param [Object] id Value to be assigned
144
+ def id=(id)
145
+ if id.nil?
146
+ fail ArgumentError, 'id cannot be nil'
147
+ end
148
+
149
+ @id = id
150
+ end
151
+
152
+ # Custom attribute writer method with validation
153
+ # @param [Object] iteration Value to be assigned
154
+ def iteration=(iteration)
155
+ if iteration.nil?
156
+ fail ArgumentError, 'iteration cannot be nil'
157
+ end
158
+
159
+ @iteration = iteration
160
+ end
161
+
162
+ # Custom attribute writer method with validation
163
+ # @param [Object] reviewer Value to be assigned
164
+ def reviewer=(reviewer)
165
+ if reviewer.nil?
166
+ fail ArgumentError, 'reviewer cannot be nil'
167
+ end
168
+
169
+ @reviewer = reviewer
170
+ end
171
+
172
+ # Custom attribute writer method with validation
173
+ # @param [Object] timestamp Value to be assigned
174
+ def timestamp=(timestamp)
175
+ if timestamp.nil?
176
+ fail ArgumentError, 'timestamp cannot be nil'
177
+ end
178
+
179
+ @timestamp = timestamp
180
+ end
181
+
182
+ # Checks equality by comparing each attribute.
183
+ # @param [Object] Object to be compared
184
+ def ==(o)
185
+ return true if self.equal?(o)
186
+ self.class == o.class &&
187
+ id == o.id &&
188
+ iteration == o.iteration &&
189
+ reviewer == o.reviewer &&
190
+ timestamp == o.timestamp &&
191
+ note == o.note
192
+ end
193
+
194
+ # @see the `==` method
195
+ # @param [Object] Object to be compared
196
+ def eql?(o)
197
+ self == o
198
+ end
199
+
200
+ # Calculates hash code according to all attributes.
201
+ # @return [Integer] Hash code
202
+ def hash
203
+ [id, iteration, reviewer, timestamp, note].hash
204
+ end
205
+
206
+ # Builds the object from hash
207
+ # @param [Hash] attributes Model attributes in the form of hash
208
+ # @return [Object] Returns the model itself
209
+ def self.build_from_hash(attributes)
210
+ return nil unless attributes.is_a?(Hash)
211
+ attributes = attributes.transform_keys(&:to_sym)
212
+ transformed_hash = {}
213
+ openapi_types.each_pair do |key, type|
214
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
215
+ transformed_hash["#{key}"] = nil
216
+ elsif type =~ /\AArray<(.*)>/i
217
+ # check to ensure the input is an array given that the attribute
218
+ # is documented as an array but the input is not
219
+ if attributes[attribute_map[key]].is_a?(Array)
220
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
221
+ end
222
+ elsif !attributes[attribute_map[key]].nil?
223
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
224
+ end
225
+ end
226
+ new(transformed_hash)
227
+ end
228
+
229
+ # Returns the object in the form of hash
230
+ # @return [Hash] Returns the object in the form of hash
231
+ def to_hash
232
+ hash = {}
233
+ self.class.attribute_map.each_pair do |attr, param|
234
+ value = self.send(attr)
235
+ if value.nil?
236
+ is_nullable = self.class.openapi_nullable.include?(attr)
237
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
238
+ end
239
+
240
+ hash[param] = _to_hash(value)
241
+ end
242
+ hash
243
+ end
244
+
245
+ end
246
+
247
+ end
@@ -0,0 +1,184 @@
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 ReviewRequest < ApiModelBase
13
+ attr_accessor :iteration
14
+
15
+ attr_accessor :note
16
+
17
+ # Attribute mapping from ruby-style variable name to JSON key.
18
+ def self.attribute_map
19
+ {
20
+ :'iteration' => :'iteration',
21
+ :'note' => :'note'
22
+ }
23
+ end
24
+
25
+ # Returns attribute mapping this model knows about
26
+ def self.acceptable_attribute_map
27
+ attribute_map
28
+ end
29
+
30
+ # Returns all the JSON keys this model knows about
31
+ def self.acceptable_attributes
32
+ acceptable_attribute_map.values
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'iteration' => :'String',
39
+ :'note' => :'String'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ :'note'
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Authentik::Api::ReviewRequest` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ acceptable_attribute_map = self.class.acceptable_attribute_map
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!acceptable_attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Authentik::Api::ReviewRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'iteration')
67
+ self.iteration = attributes[:'iteration']
68
+ else
69
+ self.iteration = nil
70
+ end
71
+
72
+ if attributes.key?(:'note')
73
+ self.note = attributes[:'note']
74
+ end
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
81
+ invalid_properties = Array.new
82
+ if @iteration.nil?
83
+ invalid_properties.push('invalid value for "iteration", iteration cannot be nil.')
84
+ end
85
+
86
+ if !@note.nil? && @note.to_s.length < 1
87
+ invalid_properties.push('invalid value for "note", the character length must be greater than or equal to 1.')
88
+ end
89
+
90
+ invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+ warn '[DEPRECATED] the `valid?` method is obsolete'
97
+ return false if @iteration.nil?
98
+ return false if !@note.nil? && @note.to_s.length < 1
99
+ true
100
+ end
101
+
102
+ # Custom attribute writer method with validation
103
+ # @param [Object] iteration Value to be assigned
104
+ def iteration=(iteration)
105
+ if iteration.nil?
106
+ fail ArgumentError, 'iteration cannot be nil'
107
+ end
108
+
109
+ @iteration = iteration
110
+ end
111
+
112
+ # Custom attribute writer method with validation
113
+ # @param [Object] note Value to be assigned
114
+ def note=(note)
115
+ if !note.nil? && note.to_s.length < 1
116
+ fail ArgumentError, 'invalid value for "note", the character length must be greater than or equal to 1.'
117
+ end
118
+
119
+ @note = note
120
+ end
121
+
122
+ # Checks equality by comparing each attribute.
123
+ # @param [Object] Object to be compared
124
+ def ==(o)
125
+ return true if self.equal?(o)
126
+ self.class == o.class &&
127
+ iteration == o.iteration &&
128
+ note == o.note
129
+ end
130
+
131
+ # @see the `==` method
132
+ # @param [Object] Object to be compared
133
+ def eql?(o)
134
+ self == o
135
+ end
136
+
137
+ # Calculates hash code according to all attributes.
138
+ # @return [Integer] Hash code
139
+ def hash
140
+ [iteration, note].hash
141
+ end
142
+
143
+ # Builds the object from hash
144
+ # @param [Hash] attributes Model attributes in the form of hash
145
+ # @return [Object] Returns the model itself
146
+ def self.build_from_hash(attributes)
147
+ return nil unless attributes.is_a?(Hash)
148
+ attributes = attributes.transform_keys(&:to_sym)
149
+ transformed_hash = {}
150
+ openapi_types.each_pair do |key, type|
151
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
152
+ transformed_hash["#{key}"] = nil
153
+ elsif type =~ /\AArray<(.*)>/i
154
+ # check to ensure the input is an array given that the attribute
155
+ # is documented as an array but the input is not
156
+ if attributes[attribute_map[key]].is_a?(Array)
157
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
158
+ end
159
+ elsif !attributes[attribute_map[key]].nil?
160
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
161
+ end
162
+ end
163
+ new(transformed_hash)
164
+ end
165
+
166
+ # Returns the object in the form of hash
167
+ # @return [Hash] Returns the object in the form of hash
168
+ def to_hash
169
+ hash = {}
170
+ self.class.attribute_map.each_pair do |attr, param|
171
+ value = self.send(attr)
172
+ if value.nil?
173
+ is_nullable = self.class.openapi_nullable.include?(attr)
174
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
175
+ end
176
+
177
+ hash[param] = _to_hash(value)
178
+ end
179
+ hash
180
+ end
181
+
182
+ end
183
+
184
+ end
@@ -0,0 +1,184 @@
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 ReviewerGroup < ApiModelBase
12
+ attr_accessor :pk
13
+
14
+ attr_accessor :name
15
+
16
+ # Attribute mapping from ruby-style variable name to JSON key.
17
+ def self.attribute_map
18
+ {
19
+ :'pk' => :'pk',
20
+ :'name' => :'name'
21
+ }
22
+ end
23
+
24
+ # Returns attribute mapping this model knows about
25
+ def self.acceptable_attribute_map
26
+ attribute_map
27
+ end
28
+
29
+ # Returns all the JSON keys this model knows about
30
+ def self.acceptable_attributes
31
+ acceptable_attribute_map.values
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.openapi_types
36
+ {
37
+ :'pk' => :'String',
38
+ :'name' => :'String'
39
+ }
40
+ end
41
+
42
+ # List of attributes with nullable: true
43
+ def self.openapi_nullable
44
+ Set.new([
45
+ ])
46
+ end
47
+
48
+ # Initializes the object
49
+ # @param [Hash] attributes Model attributes in the form of hash
50
+ def initialize(attributes = {})
51
+ if (!attributes.is_a?(Hash))
52
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Authentik::Api::ReviewerGroup` initialize method"
53
+ end
54
+
55
+ # check to see if the attribute exists and convert string to symbol for hash key
56
+ acceptable_attribute_map = self.class.acceptable_attribute_map
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!acceptable_attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Authentik::Api::ReviewerGroup`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'pk')
65
+ self.pk = attributes[:'pk']
66
+ else
67
+ self.pk = nil
68
+ end
69
+
70
+ if attributes.key?(:'name')
71
+ self.name = attributes[:'name']
72
+ else
73
+ self.name = nil
74
+ end
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
81
+ invalid_properties = Array.new
82
+ if @pk.nil?
83
+ invalid_properties.push('invalid value for "pk", pk cannot be nil.')
84
+ end
85
+
86
+ if @name.nil?
87
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
88
+ end
89
+
90
+ invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+ warn '[DEPRECATED] the `valid?` method is obsolete'
97
+ return false if @pk.nil?
98
+ return false if @name.nil?
99
+ true
100
+ end
101
+
102
+ # Custom attribute writer method with validation
103
+ # @param [Object] pk Value to be assigned
104
+ def pk=(pk)
105
+ if pk.nil?
106
+ fail ArgumentError, 'pk cannot be nil'
107
+ end
108
+
109
+ @pk = pk
110
+ end
111
+
112
+ # Custom attribute writer method with validation
113
+ # @param [Object] name Value to be assigned
114
+ def name=(name)
115
+ if name.nil?
116
+ fail ArgumentError, 'name cannot be nil'
117
+ end
118
+
119
+ @name = name
120
+ end
121
+
122
+ # Checks equality by comparing each attribute.
123
+ # @param [Object] Object to be compared
124
+ def ==(o)
125
+ return true if self.equal?(o)
126
+ self.class == o.class &&
127
+ pk == o.pk &&
128
+ name == o.name
129
+ end
130
+
131
+ # @see the `==` method
132
+ # @param [Object] Object to be compared
133
+ def eql?(o)
134
+ self == o
135
+ end
136
+
137
+ # Calculates hash code according to all attributes.
138
+ # @return [Integer] Hash code
139
+ def hash
140
+ [pk, name].hash
141
+ end
142
+
143
+ # Builds the object from hash
144
+ # @param [Hash] attributes Model attributes in the form of hash
145
+ # @return [Object] Returns the model itself
146
+ def self.build_from_hash(attributes)
147
+ return nil unless attributes.is_a?(Hash)
148
+ attributes = attributes.transform_keys(&:to_sym)
149
+ transformed_hash = {}
150
+ openapi_types.each_pair do |key, type|
151
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
152
+ transformed_hash["#{key}"] = nil
153
+ elsif type =~ /\AArray<(.*)>/i
154
+ # check to ensure the input is an array given that the attribute
155
+ # is documented as an array but the input is not
156
+ if attributes[attribute_map[key]].is_a?(Array)
157
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
158
+ end
159
+ elsif !attributes[attribute_map[key]].nil?
160
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
161
+ end
162
+ end
163
+ new(transformed_hash)
164
+ end
165
+
166
+ # Returns the object in the form of hash
167
+ # @return [Hash] Returns the object in the form of hash
168
+ def to_hash
169
+ hash = {}
170
+ self.class.attribute_map.each_pair do |attr, param|
171
+ value = self.send(attr)
172
+ if value.nil?
173
+ is_nullable = self.class.openapi_nullable.include?(attr)
174
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
175
+ end
176
+
177
+ hash[param] = _to_hash(value)
178
+ end
179
+ hash
180
+ end
181
+
182
+ end
183
+
184
+ end