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,36 @@
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 LifecycleIterationStateEnum
12
+ REVIEWED = "REVIEWED".freeze
13
+ PENDING = "PENDING".freeze
14
+ OVERDUE = "OVERDUE".freeze
15
+ CANCELED = "CANCELED".freeze
16
+
17
+ def self.all_vars
18
+ @all_vars ||= [REVIEWED, PENDING, OVERDUE, CANCELED].freeze
19
+ end
20
+
21
+ # Builds the enum from string
22
+ # @param [String] The enum value in the form of the string
23
+ # @return [String] The enum value
24
+ def self.build_from_hash(value)
25
+ new.build_from_hash(value)
26
+ end
27
+
28
+ # Builds the enum from string
29
+ # @param [String] The enum value in the form of the string
30
+ # @return [String] The enum value
31
+ def build_from_hash(value)
32
+ return value if LifecycleIterationStateEnum.all_vars.include?(value)
33
+ raise "Invalid ENUM value #{value} for class #LifecycleIterationStateEnum"
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,440 @@
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 LifecycleRule < ApiModelBase
13
+ attr_accessor :id
14
+
15
+ attr_accessor :name
16
+
17
+ attr_accessor :content_type
18
+
19
+ attr_accessor :obj_id
20
+
21
+ attr_accessor :interval
22
+
23
+ attr_accessor :grace_period
24
+
25
+ attr_accessor :reviewer_groups
26
+
27
+ attr_accessor :reviewer_groups_obj
28
+
29
+ attr_accessor :min_reviewers
30
+
31
+ attr_accessor :min_reviewers_is_per_group
32
+
33
+ attr_accessor :reviewers
34
+
35
+ attr_accessor :reviewers_obj
36
+
37
+ # Select which transports should be used to notify the reviewers. If none are selected, the notification will only be shown in the authentik UI.
38
+ attr_accessor :notification_transports
39
+
40
+ attr_accessor :target_verbose
41
+
42
+ class EnumAttributeValidator
43
+ attr_reader :datatype
44
+ attr_reader :allowable_values
45
+
46
+ def initialize(datatype, allowable_values)
47
+ @allowable_values = allowable_values.map do |value|
48
+ case datatype.to_s
49
+ when /Integer/i
50
+ value.to_i
51
+ when /Float/i
52
+ value.to_f
53
+ else
54
+ value
55
+ end
56
+ end
57
+ end
58
+
59
+ def valid?(value)
60
+ !value || allowable_values.include?(value)
61
+ end
62
+ end
63
+
64
+ # Attribute mapping from ruby-style variable name to JSON key.
65
+ def self.attribute_map
66
+ {
67
+ :'id' => :'id',
68
+ :'name' => :'name',
69
+ :'content_type' => :'content_type',
70
+ :'obj_id' => :'object_id',
71
+ :'interval' => :'interval',
72
+ :'grace_period' => :'grace_period',
73
+ :'reviewer_groups' => :'reviewer_groups',
74
+ :'reviewer_groups_obj' => :'reviewer_groups_obj',
75
+ :'min_reviewers' => :'min_reviewers',
76
+ :'min_reviewers_is_per_group' => :'min_reviewers_is_per_group',
77
+ :'reviewers' => :'reviewers',
78
+ :'reviewers_obj' => :'reviewers_obj',
79
+ :'notification_transports' => :'notification_transports',
80
+ :'target_verbose' => :'target_verbose'
81
+ }
82
+ end
83
+
84
+ # Returns attribute mapping this model knows about
85
+ def self.acceptable_attribute_map
86
+ attribute_map
87
+ end
88
+
89
+ # Returns all the JSON keys this model knows about
90
+ def self.acceptable_attributes
91
+ acceptable_attribute_map.values
92
+ end
93
+
94
+ # Attribute type mapping.
95
+ def self.openapi_types
96
+ {
97
+ :'id' => :'String',
98
+ :'name' => :'String',
99
+ :'content_type' => :'ContentTypeEnum',
100
+ :'obj_id' => :'String',
101
+ :'interval' => :'String',
102
+ :'grace_period' => :'String',
103
+ :'reviewer_groups' => :'Array<String>',
104
+ :'reviewer_groups_obj' => :'Array<ReviewerGroup>',
105
+ :'min_reviewers' => :'Integer',
106
+ :'min_reviewers_is_per_group' => :'Boolean',
107
+ :'reviewers' => :'Array<String>',
108
+ :'reviewers_obj' => :'Array<ReviewerUser>',
109
+ :'notification_transports' => :'Array<String>',
110
+ :'target_verbose' => :'String'
111
+ }
112
+ end
113
+
114
+ # List of attributes with nullable: true
115
+ def self.openapi_nullable
116
+ Set.new([
117
+ :'obj_id',
118
+ ])
119
+ end
120
+
121
+ # Initializes the object
122
+ # @param [Hash] attributes Model attributes in the form of hash
123
+ def initialize(attributes = {})
124
+ if (!attributes.is_a?(Hash))
125
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Authentik::Api::LifecycleRule` initialize method"
126
+ end
127
+
128
+ # check to see if the attribute exists and convert string to symbol for hash key
129
+ acceptable_attribute_map = self.class.acceptable_attribute_map
130
+ attributes = attributes.each_with_object({}) { |(k, v), h|
131
+ if (!acceptable_attribute_map.key?(k.to_sym))
132
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Authentik::Api::LifecycleRule`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
133
+ end
134
+ h[k.to_sym] = v
135
+ }
136
+
137
+ if attributes.key?(:'id')
138
+ self.id = attributes[:'id']
139
+ else
140
+ self.id = nil
141
+ end
142
+
143
+ if attributes.key?(:'name')
144
+ self.name = attributes[:'name']
145
+ else
146
+ self.name = nil
147
+ end
148
+
149
+ if attributes.key?(:'content_type')
150
+ self.content_type = attributes[:'content_type']
151
+ else
152
+ self.content_type = nil
153
+ end
154
+
155
+ if attributes.key?(:'obj_id')
156
+ self.obj_id = attributes[:'obj_id']
157
+ end
158
+
159
+ if attributes.key?(:'interval')
160
+ self.interval = attributes[:'interval']
161
+ end
162
+
163
+ if attributes.key?(:'grace_period')
164
+ self.grace_period = attributes[:'grace_period']
165
+ end
166
+
167
+ if attributes.key?(:'reviewer_groups')
168
+ if (value = attributes[:'reviewer_groups']).is_a?(Array)
169
+ self.reviewer_groups = value
170
+ end
171
+ end
172
+
173
+ if attributes.key?(:'reviewer_groups_obj')
174
+ if (value = attributes[:'reviewer_groups_obj']).is_a?(Array)
175
+ self.reviewer_groups_obj = value
176
+ end
177
+ else
178
+ self.reviewer_groups_obj = nil
179
+ end
180
+
181
+ if attributes.key?(:'min_reviewers')
182
+ self.min_reviewers = attributes[:'min_reviewers']
183
+ end
184
+
185
+ if attributes.key?(:'min_reviewers_is_per_group')
186
+ self.min_reviewers_is_per_group = attributes[:'min_reviewers_is_per_group']
187
+ end
188
+
189
+ if attributes.key?(:'reviewers')
190
+ if (value = attributes[:'reviewers']).is_a?(Array)
191
+ self.reviewers = value
192
+ end
193
+ else
194
+ self.reviewers = nil
195
+ end
196
+
197
+ if attributes.key?(:'reviewers_obj')
198
+ if (value = attributes[:'reviewers_obj']).is_a?(Array)
199
+ self.reviewers_obj = value
200
+ end
201
+ else
202
+ self.reviewers_obj = nil
203
+ end
204
+
205
+ if attributes.key?(:'notification_transports')
206
+ if (value = attributes[:'notification_transports']).is_a?(Array)
207
+ self.notification_transports = value
208
+ end
209
+ end
210
+
211
+ if attributes.key?(:'target_verbose')
212
+ self.target_verbose = attributes[:'target_verbose']
213
+ else
214
+ self.target_verbose = nil
215
+ end
216
+ end
217
+
218
+ # Show invalid properties with the reasons. Usually used together with valid?
219
+ # @return Array for valid properties with the reasons
220
+ def list_invalid_properties
221
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
222
+ invalid_properties = Array.new
223
+ if @id.nil?
224
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
225
+ end
226
+
227
+ if @name.nil?
228
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
229
+ end
230
+
231
+ if @content_type.nil?
232
+ invalid_properties.push('invalid value for "content_type", content_type cannot be nil.')
233
+ end
234
+
235
+ if @reviewer_groups_obj.nil?
236
+ invalid_properties.push('invalid value for "reviewer_groups_obj", reviewer_groups_obj cannot be nil.')
237
+ end
238
+
239
+ if !@min_reviewers.nil? && @min_reviewers > 32767
240
+ invalid_properties.push('invalid value for "min_reviewers", must be smaller than or equal to 32767.')
241
+ end
242
+
243
+ if !@min_reviewers.nil? && @min_reviewers < 0
244
+ invalid_properties.push('invalid value for "min_reviewers", must be greater than or equal to 0.')
245
+ end
246
+
247
+ if @reviewers.nil?
248
+ invalid_properties.push('invalid value for "reviewers", reviewers cannot be nil.')
249
+ end
250
+
251
+ if @reviewers_obj.nil?
252
+ invalid_properties.push('invalid value for "reviewers_obj", reviewers_obj cannot be nil.')
253
+ end
254
+
255
+ if @target_verbose.nil?
256
+ invalid_properties.push('invalid value for "target_verbose", target_verbose cannot be nil.')
257
+ end
258
+
259
+ invalid_properties
260
+ end
261
+
262
+ # Check to see if the all the properties in the model are valid
263
+ # @return true if the model is valid
264
+ def valid?
265
+ warn '[DEPRECATED] the `valid?` method is obsolete'
266
+ return false if @id.nil?
267
+ return false if @name.nil?
268
+ return false if @content_type.nil?
269
+ return false if @reviewer_groups_obj.nil?
270
+ return false if !@min_reviewers.nil? && @min_reviewers > 32767
271
+ return false if !@min_reviewers.nil? && @min_reviewers < 0
272
+ return false if @reviewers.nil?
273
+ return false if @reviewers_obj.nil?
274
+ return false if @target_verbose.nil?
275
+ true
276
+ end
277
+
278
+ # Custom attribute writer method with validation
279
+ # @param [Object] id Value to be assigned
280
+ def id=(id)
281
+ if id.nil?
282
+ fail ArgumentError, 'id cannot be nil'
283
+ end
284
+
285
+ @id = id
286
+ end
287
+
288
+ # Custom attribute writer method with validation
289
+ # @param [Object] name Value to be assigned
290
+ def name=(name)
291
+ if name.nil?
292
+ fail ArgumentError, 'name cannot be nil'
293
+ end
294
+
295
+ @name = name
296
+ end
297
+
298
+ # Custom attribute writer method with validation
299
+ # @param [Object] content_type Value to be assigned
300
+ def content_type=(content_type)
301
+ if content_type.nil?
302
+ fail ArgumentError, 'content_type cannot be nil'
303
+ end
304
+
305
+ @content_type = content_type
306
+ end
307
+
308
+ # Custom attribute writer method with validation
309
+ # @param [Object] reviewer_groups_obj Value to be assigned
310
+ def reviewer_groups_obj=(reviewer_groups_obj)
311
+ if reviewer_groups_obj.nil?
312
+ fail ArgumentError, 'reviewer_groups_obj cannot be nil'
313
+ end
314
+
315
+ @reviewer_groups_obj = reviewer_groups_obj
316
+ end
317
+
318
+ # Custom attribute writer method with validation
319
+ # @param [Object] min_reviewers Value to be assigned
320
+ def min_reviewers=(min_reviewers)
321
+ if min_reviewers.nil?
322
+ fail ArgumentError, 'min_reviewers cannot be nil'
323
+ end
324
+
325
+ if min_reviewers > 32767
326
+ fail ArgumentError, 'invalid value for "min_reviewers", must be smaller than or equal to 32767.'
327
+ end
328
+
329
+ if min_reviewers < 0
330
+ fail ArgumentError, 'invalid value for "min_reviewers", must be greater than or equal to 0.'
331
+ end
332
+
333
+ @min_reviewers = min_reviewers
334
+ end
335
+
336
+ # Custom attribute writer method with validation
337
+ # @param [Object] reviewers Value to be assigned
338
+ def reviewers=(reviewers)
339
+ if reviewers.nil?
340
+ fail ArgumentError, 'reviewers cannot be nil'
341
+ end
342
+
343
+ @reviewers = reviewers
344
+ end
345
+
346
+ # Custom attribute writer method with validation
347
+ # @param [Object] reviewers_obj Value to be assigned
348
+ def reviewers_obj=(reviewers_obj)
349
+ if reviewers_obj.nil?
350
+ fail ArgumentError, 'reviewers_obj cannot be nil'
351
+ end
352
+
353
+ @reviewers_obj = reviewers_obj
354
+ end
355
+
356
+ # Custom attribute writer method with validation
357
+ # @param [Object] target_verbose Value to be assigned
358
+ def target_verbose=(target_verbose)
359
+ if target_verbose.nil?
360
+ fail ArgumentError, 'target_verbose cannot be nil'
361
+ end
362
+
363
+ @target_verbose = target_verbose
364
+ end
365
+
366
+ # Checks equality by comparing each attribute.
367
+ # @param [Object] Object to be compared
368
+ def ==(o)
369
+ return true if self.equal?(o)
370
+ self.class == o.class &&
371
+ id == o.id &&
372
+ name == o.name &&
373
+ content_type == o.content_type &&
374
+ obj_id == o.obj_id &&
375
+ interval == o.interval &&
376
+ grace_period == o.grace_period &&
377
+ reviewer_groups == o.reviewer_groups &&
378
+ reviewer_groups_obj == o.reviewer_groups_obj &&
379
+ min_reviewers == o.min_reviewers &&
380
+ min_reviewers_is_per_group == o.min_reviewers_is_per_group &&
381
+ reviewers == o.reviewers &&
382
+ reviewers_obj == o.reviewers_obj &&
383
+ notification_transports == o.notification_transports &&
384
+ target_verbose == o.target_verbose
385
+ end
386
+
387
+ # @see the `==` method
388
+ # @param [Object] Object to be compared
389
+ def eql?(o)
390
+ self == o
391
+ end
392
+
393
+ # Calculates hash code according to all attributes.
394
+ # @return [Integer] Hash code
395
+ def hash
396
+ [id, name, content_type, obj_id, interval, grace_period, reviewer_groups, reviewer_groups_obj, min_reviewers, min_reviewers_is_per_group, reviewers, reviewers_obj, notification_transports, target_verbose].hash
397
+ end
398
+
399
+ # Builds the object from hash
400
+ # @param [Hash] attributes Model attributes in the form of hash
401
+ # @return [Object] Returns the model itself
402
+ def self.build_from_hash(attributes)
403
+ return nil unless attributes.is_a?(Hash)
404
+ attributes = attributes.transform_keys(&:to_sym)
405
+ transformed_hash = {}
406
+ openapi_types.each_pair do |key, type|
407
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
408
+ transformed_hash["#{key}"] = nil
409
+ elsif type =~ /\AArray<(.*)>/i
410
+ # check to ensure the input is an array given that the attribute
411
+ # is documented as an array but the input is not
412
+ if attributes[attribute_map[key]].is_a?(Array)
413
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
414
+ end
415
+ elsif !attributes[attribute_map[key]].nil?
416
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
417
+ end
418
+ end
419
+ new(transformed_hash)
420
+ end
421
+
422
+ # Returns the object in the form of hash
423
+ # @return [Hash] Returns the object in the form of hash
424
+ def to_hash
425
+ hash = {}
426
+ self.class.attribute_map.each_pair do |attr, param|
427
+ value = self.send(attr)
428
+ if value.nil?
429
+ is_nullable = self.class.openapi_nullable.include?(attr)
430
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
431
+ end
432
+
433
+ hash[param] = _to_hash(value)
434
+ end
435
+ hash
436
+ end
437
+
438
+ end
439
+
440
+ end