authentik-api 2026.8.0.rc6 → 2026.8.0

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 (43) hide show
  1. checksums.yaml +4 -4
  2. data/README_API.md +22 -5
  3. data/lib/authentik/api/api/agents_api.rb +410 -0
  4. data/lib/authentik/api/api/endpoints_api.rb +3 -0
  5. data/lib/authentik/api/api/requests_api.rb +72 -0
  6. data/lib/authentik/api/models/agent.rb +450 -0
  7. data/lib/authentik/api/models/agent_create_request.rb +203 -0
  8. data/lib/authentik/api/models/agent_created.rb +185 -0
  9. data/lib/authentik/api/models/agent_grant_request_create_request.rb +161 -0
  10. data/lib/authentik/api/models/agent_grant_request_created.rb +185 -0
  11. data/lib/authentik/api/models/agent_request.rb +303 -0
  12. data/lib/authentik/api/models/app_enum.rb +2 -2
  13. data/lib/authentik/api/models/capabilities_enum.rb +3 -1
  14. data/lib/authentik/api/models/endpoint_device.rb +1 -15
  15. data/lib/authentik/api/models/endpoint_device_details.rb +1 -15
  16. data/lib/authentik/api/models/grant_request.rb +14 -16
  17. data/lib/authentik/api/models/model_enum.rb +3 -1
  18. data/lib/authentik/api/models/paginated_agent_list.rb +214 -0
  19. data/lib/authentik/api/models/patched_agent_request.rb +289 -0
  20. data/lib/authentik/api/models/patched_source_stage_request.rb +16 -4
  21. data/lib/authentik/api/models/policy_behavior_enum.rb +35 -0
  22. data/lib/authentik/api/models/resume_on_match_failures_enum.rb +33 -0
  23. data/lib/authentik/api/models/source_stage.rb +16 -4
  24. data/lib/authentik/api/models/source_stage_request.rb +16 -4
  25. data/lib/authentik/api/version.rb +1 -1
  26. data/spec/api/agents_api_spec.rb +101 -0
  27. data/spec/api/endpoints_api_spec.rb +1 -0
  28. data/spec/api/requests_api_spec.rb +13 -0
  29. data/spec/models/agent_create_request_spec.rb +54 -0
  30. data/spec/models/agent_created_spec.rb +36 -0
  31. data/spec/models/agent_grant_request_create_request_spec.rb +30 -0
  32. data/spec/models/agent_grant_request_created_spec.rb +36 -0
  33. data/spec/models/agent_request_spec.rb +72 -0
  34. data/spec/models/agent_spec.rb +108 -0
  35. data/spec/models/grant_request_spec.rb +6 -0
  36. data/spec/models/paginated_agent_list_spec.rb +42 -0
  37. data/spec/models/patched_agent_request_spec.rb +72 -0
  38. data/spec/models/patched_source_stage_request_spec.rb +6 -0
  39. data/spec/models/policy_behavior_enum_spec.rb +24 -0
  40. data/spec/models/resume_on_match_failures_enum_spec.rb +24 -0
  41. data/spec/models/source_stage_request_spec.rb +6 -0
  42. data/spec/models/source_stage_spec.rb +6 -0
  43. metadata +34 -1
@@ -0,0 +1,450 @@
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 Agent < ApiModelBase
13
+ attr_accessor :pk
14
+
15
+ # Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.
16
+ attr_accessor :username
17
+
18
+ # User's display name.
19
+ attr_accessor :name
20
+
21
+ # Designates whether this user should be treated as active. Unselect this instead of deleting accounts.
22
+ attr_accessor :is_active
23
+
24
+ attr_accessor :last_login
25
+
26
+ attr_accessor :email
27
+
28
+ attr_accessor :attributes
29
+
30
+ attr_accessor :uid
31
+
32
+ attr_accessor :uuid
33
+
34
+ attr_accessor :expiring
35
+
36
+ attr_accessor :expires
37
+
38
+ attr_accessor :parent
39
+
40
+ attr_accessor :policy_behavior
41
+
42
+ # Identifier of the agent's API token, so its key can be retrieved/copied later.
43
+ attr_accessor :token_identifier
44
+
45
+ class EnumAttributeValidator
46
+ attr_reader :datatype
47
+ attr_reader :allowable_values
48
+
49
+ def initialize(datatype, allowable_values)
50
+ @allowable_values = allowable_values.map do |value|
51
+ case datatype.to_s
52
+ when /Integer/i
53
+ value.to_i
54
+ when /Float/i
55
+ value.to_f
56
+ else
57
+ value
58
+ end
59
+ end
60
+ end
61
+
62
+ def valid?(value)
63
+ !value || allowable_values.include?(value)
64
+ end
65
+ end
66
+
67
+ # Attribute mapping from ruby-style variable name to JSON key.
68
+ def self.attribute_map
69
+ {
70
+ :'pk' => :'pk',
71
+ :'username' => :'username',
72
+ :'name' => :'name',
73
+ :'is_active' => :'is_active',
74
+ :'last_login' => :'last_login',
75
+ :'email' => :'email',
76
+ :'attributes' => :'attributes',
77
+ :'uid' => :'uid',
78
+ :'uuid' => :'uuid',
79
+ :'expiring' => :'expiring',
80
+ :'expires' => :'expires',
81
+ :'parent' => :'parent',
82
+ :'policy_behavior' => :'policy_behavior',
83
+ :'token_identifier' => :'token_identifier'
84
+ }
85
+ end
86
+
87
+ # Returns attribute mapping this model knows about
88
+ def self.acceptable_attribute_map
89
+ attribute_map
90
+ end
91
+
92
+ # Returns all the JSON keys this model knows about
93
+ def self.acceptable_attributes
94
+ acceptable_attribute_map.values
95
+ end
96
+
97
+ # Attribute type mapping.
98
+ def self.openapi_types
99
+ {
100
+ :'pk' => :'Integer',
101
+ :'username' => :'String',
102
+ :'name' => :'String',
103
+ :'is_active' => :'Boolean',
104
+ :'last_login' => :'Time',
105
+ :'email' => :'String',
106
+ :'attributes' => :'Hash<String, Object>',
107
+ :'uid' => :'String',
108
+ :'uuid' => :'String',
109
+ :'expiring' => :'Boolean',
110
+ :'expires' => :'Time',
111
+ :'parent' => :'PartialUser',
112
+ :'policy_behavior' => :'PolicyBehaviorEnum',
113
+ :'token_identifier' => :'String'
114
+ }
115
+ end
116
+
117
+ # List of attributes with nullable: true
118
+ def self.openapi_nullable
119
+ Set.new([
120
+ :'last_login',
121
+ :'expires',
122
+ :'token_identifier'
123
+ ])
124
+ end
125
+
126
+ # Initializes the object
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ def initialize(attributes = {})
129
+ if (!attributes.is_a?(Hash))
130
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Authentik::Api::Agent` initialize method"
131
+ end
132
+
133
+ # check to see if the attribute exists and convert string to symbol for hash key
134
+ acceptable_attribute_map = self.class.acceptable_attribute_map
135
+ attributes = attributes.each_with_object({}) { |(k, v), h|
136
+ if (!acceptable_attribute_map.key?(k.to_sym))
137
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Authentik::Api::Agent`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
138
+ end
139
+ h[k.to_sym] = v
140
+ }
141
+
142
+ if attributes.key?(:'pk')
143
+ self.pk = attributes[:'pk']
144
+ else
145
+ self.pk = nil
146
+ end
147
+
148
+ if attributes.key?(:'username')
149
+ self.username = attributes[:'username']
150
+ else
151
+ self.username = nil
152
+ end
153
+
154
+ if attributes.key?(:'name')
155
+ self.name = attributes[:'name']
156
+ else
157
+ self.name = nil
158
+ end
159
+
160
+ if attributes.key?(:'is_active')
161
+ self.is_active = attributes[:'is_active']
162
+ end
163
+
164
+ if attributes.key?(:'last_login')
165
+ self.last_login = attributes[:'last_login']
166
+ end
167
+
168
+ if attributes.key?(:'email')
169
+ self.email = attributes[:'email']
170
+ end
171
+
172
+ if attributes.key?(:'attributes')
173
+ if (value = attributes[:'attributes']).is_a?(Hash)
174
+ self.attributes = value
175
+ end
176
+ end
177
+
178
+ if attributes.key?(:'uid')
179
+ self.uid = attributes[:'uid']
180
+ else
181
+ self.uid = nil
182
+ end
183
+
184
+ if attributes.key?(:'uuid')
185
+ self.uuid = attributes[:'uuid']
186
+ else
187
+ self.uuid = nil
188
+ end
189
+
190
+ if attributes.key?(:'expiring')
191
+ self.expiring = attributes[:'expiring']
192
+ end
193
+
194
+ if attributes.key?(:'expires')
195
+ self.expires = attributes[:'expires']
196
+ end
197
+
198
+ if attributes.key?(:'parent')
199
+ self.parent = attributes[:'parent']
200
+ else
201
+ self.parent = nil
202
+ end
203
+
204
+ if attributes.key?(:'policy_behavior')
205
+ self.policy_behavior = attributes[:'policy_behavior']
206
+ else
207
+ self.policy_behavior = nil
208
+ end
209
+
210
+ if attributes.key?(:'token_identifier')
211
+ self.token_identifier = attributes[:'token_identifier']
212
+ else
213
+ self.token_identifier = nil
214
+ end
215
+ end
216
+
217
+ # Show invalid properties with the reasons. Usually used together with valid?
218
+ # @return Array for valid properties with the reasons
219
+ def list_invalid_properties
220
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
221
+ invalid_properties = Array.new
222
+ if @pk.nil?
223
+ invalid_properties.push('invalid value for "pk", pk cannot be nil.')
224
+ end
225
+
226
+ if @username.nil?
227
+ invalid_properties.push('invalid value for "username", username cannot be nil.')
228
+ end
229
+
230
+ if @username.to_s.length > 150
231
+ invalid_properties.push('invalid value for "username", the character length must be smaller than or equal to 150.')
232
+ end
233
+
234
+ pattern = Regexp.new(/^[\w.@+-]+$/)
235
+ if @username !~ pattern
236
+ invalid_properties.push("invalid value for \"username\", must conform to the pattern #{pattern}.")
237
+ end
238
+
239
+ if @name.nil?
240
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
241
+ end
242
+
243
+ if !@email.nil? && @email.to_s.length > 254
244
+ invalid_properties.push('invalid value for "email", the character length must be smaller than or equal to 254.')
245
+ end
246
+
247
+ if @uid.nil?
248
+ invalid_properties.push('invalid value for "uid", uid cannot be nil.')
249
+ end
250
+
251
+ if @uuid.nil?
252
+ invalid_properties.push('invalid value for "uuid", uuid cannot be nil.')
253
+ end
254
+
255
+ if @parent.nil?
256
+ invalid_properties.push('invalid value for "parent", parent cannot be nil.')
257
+ end
258
+
259
+ if @policy_behavior.nil?
260
+ invalid_properties.push('invalid value for "policy_behavior", policy_behavior cannot be nil.')
261
+ end
262
+
263
+ invalid_properties
264
+ end
265
+
266
+ # Check to see if the all the properties in the model are valid
267
+ # @return true if the model is valid
268
+ def valid?
269
+ warn '[DEPRECATED] the `valid?` method is obsolete'
270
+ return false if @pk.nil?
271
+ return false if @username.nil?
272
+ return false if @username.to_s.length > 150
273
+ return false if @username !~ Regexp.new(/^[\w.@+-]+$/)
274
+ return false if @name.nil?
275
+ return false if !@email.nil? && @email.to_s.length > 254
276
+ return false if @uid.nil?
277
+ return false if @uuid.nil?
278
+ return false if @parent.nil?
279
+ return false if @policy_behavior.nil?
280
+ true
281
+ end
282
+
283
+ # Custom attribute writer method with validation
284
+ # @param [Object] pk Value to be assigned
285
+ def pk=(pk)
286
+ if pk.nil?
287
+ fail ArgumentError, 'pk cannot be nil'
288
+ end
289
+
290
+ @pk = pk
291
+ end
292
+
293
+ # Custom attribute writer method with validation
294
+ # @param [Object] username Value to be assigned
295
+ def username=(username)
296
+ if username.nil?
297
+ fail ArgumentError, 'username cannot be nil'
298
+ end
299
+
300
+ if username.to_s.length > 150
301
+ fail ArgumentError, 'invalid value for "username", the character length must be smaller than or equal to 150.'
302
+ end
303
+
304
+ pattern = Regexp.new(/^[\w.@+-]+$/)
305
+ if username !~ pattern
306
+ fail ArgumentError, "invalid value for \"username\", must conform to the pattern #{pattern}."
307
+ end
308
+
309
+ @username = username
310
+ end
311
+
312
+ # Custom attribute writer method with validation
313
+ # @param [Object] name Value to be assigned
314
+ def name=(name)
315
+ if name.nil?
316
+ fail ArgumentError, 'name cannot be nil'
317
+ end
318
+
319
+ @name = name
320
+ end
321
+
322
+ # Custom attribute writer method with validation
323
+ # @param [Object] email Value to be assigned
324
+ def email=(email)
325
+ if email.nil?
326
+ fail ArgumentError, 'email cannot be nil'
327
+ end
328
+
329
+ if email.to_s.length > 254
330
+ fail ArgumentError, 'invalid value for "email", the character length must be smaller than or equal to 254.'
331
+ end
332
+
333
+ @email = email
334
+ end
335
+
336
+ # Custom attribute writer method with validation
337
+ # @param [Object] uid Value to be assigned
338
+ def uid=(uid)
339
+ if uid.nil?
340
+ fail ArgumentError, 'uid cannot be nil'
341
+ end
342
+
343
+ @uid = uid
344
+ end
345
+
346
+ # Custom attribute writer method with validation
347
+ # @param [Object] uuid Value to be assigned
348
+ def uuid=(uuid)
349
+ if uuid.nil?
350
+ fail ArgumentError, 'uuid cannot be nil'
351
+ end
352
+
353
+ @uuid = uuid
354
+ end
355
+
356
+ # Custom attribute writer method with validation
357
+ # @param [Object] parent Value to be assigned
358
+ def parent=(parent)
359
+ if parent.nil?
360
+ fail ArgumentError, 'parent cannot be nil'
361
+ end
362
+
363
+ @parent = parent
364
+ end
365
+
366
+ # Custom attribute writer method with validation
367
+ # @param [Object] policy_behavior Value to be assigned
368
+ def policy_behavior=(policy_behavior)
369
+ if policy_behavior.nil?
370
+ fail ArgumentError, 'policy_behavior cannot be nil'
371
+ end
372
+
373
+ @policy_behavior = policy_behavior
374
+ end
375
+
376
+ # Checks equality by comparing each attribute.
377
+ # @param [Object] Object to be compared
378
+ def ==(o)
379
+ return true if self.equal?(o)
380
+ self.class == o.class &&
381
+ pk == o.pk &&
382
+ username == o.username &&
383
+ name == o.name &&
384
+ is_active == o.is_active &&
385
+ last_login == o.last_login &&
386
+ email == o.email &&
387
+ attributes == o.attributes &&
388
+ uid == o.uid &&
389
+ uuid == o.uuid &&
390
+ expiring == o.expiring &&
391
+ expires == o.expires &&
392
+ parent == o.parent &&
393
+ policy_behavior == o.policy_behavior &&
394
+ token_identifier == o.token_identifier
395
+ end
396
+
397
+ # @see the `==` method
398
+ # @param [Object] Object to be compared
399
+ def eql?(o)
400
+ self == o
401
+ end
402
+
403
+ # Calculates hash code according to all attributes.
404
+ # @return [Integer] Hash code
405
+ def hash
406
+ [pk, username, name, is_active, last_login, email, attributes, uid, uuid, expiring, expires, parent, policy_behavior, token_identifier].hash
407
+ end
408
+
409
+ # Builds the object from hash
410
+ # @param [Hash] attributes Model attributes in the form of hash
411
+ # @return [Object] Returns the model itself
412
+ def self.build_from_hash(attributes)
413
+ return nil unless attributes.is_a?(Hash)
414
+ attributes = attributes.transform_keys(&:to_sym)
415
+ transformed_hash = {}
416
+ openapi_types.each_pair do |key, type|
417
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
418
+ transformed_hash["#{key}"] = nil
419
+ elsif type =~ /\AArray<(.*)>/i
420
+ # check to ensure the input is an array given that the attribute
421
+ # is documented as an array but the input is not
422
+ if attributes[attribute_map[key]].is_a?(Array)
423
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
424
+ end
425
+ elsif !attributes[attribute_map[key]].nil?
426
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
427
+ end
428
+ end
429
+ new(transformed_hash)
430
+ end
431
+
432
+ # Returns the object in the form of hash
433
+ # @return [Hash] Returns the object in the form of hash
434
+ def to_hash
435
+ hash = {}
436
+ self.class.attribute_map.each_pair do |attr, param|
437
+ value = self.send(attr)
438
+ if value.nil?
439
+ is_nullable = self.class.openapi_nullable.include?(attr)
440
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
441
+ end
442
+
443
+ hash[param] = _to_hash(value)
444
+ end
445
+ hash
446
+ end
447
+
448
+ end
449
+
450
+ end
@@ -0,0 +1,203 @@
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
+ # Base serializer class which doesn't implement create/update methods
12
+ class AgentCreateRequest < ApiModelBase
13
+ attr_accessor :parent
14
+
15
+ attr_accessor :label
16
+
17
+ attr_accessor :expiring
18
+
19
+ attr_accessor :expires
20
+
21
+ attr_accessor :policy_behavior
22
+
23
+ class EnumAttributeValidator
24
+ attr_reader :datatype
25
+ attr_reader :allowable_values
26
+
27
+ def initialize(datatype, allowable_values)
28
+ @allowable_values = allowable_values.map do |value|
29
+ case datatype.to_s
30
+ when /Integer/i
31
+ value.to_i
32
+ when /Float/i
33
+ value.to_f
34
+ else
35
+ value
36
+ end
37
+ end
38
+ end
39
+
40
+ def valid?(value)
41
+ !value || allowable_values.include?(value)
42
+ end
43
+ end
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ :'parent' => :'parent',
49
+ :'label' => :'label',
50
+ :'expiring' => :'expiring',
51
+ :'expires' => :'expires',
52
+ :'policy_behavior' => :'policy_behavior'
53
+ }
54
+ end
55
+
56
+ # Returns attribute mapping this model knows about
57
+ def self.acceptable_attribute_map
58
+ attribute_map
59
+ end
60
+
61
+ # Returns all the JSON keys this model knows about
62
+ def self.acceptable_attributes
63
+ acceptable_attribute_map.values
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.openapi_types
68
+ {
69
+ :'parent' => :'Integer',
70
+ :'label' => :'String',
71
+ :'expiring' => :'Boolean',
72
+ :'expires' => :'Time',
73
+ :'policy_behavior' => :'PolicyBehaviorEnum'
74
+ }
75
+ end
76
+
77
+ # List of attributes with nullable: true
78
+ def self.openapi_nullable
79
+ Set.new([
80
+ :'expires',
81
+ ])
82
+ end
83
+
84
+ # Initializes the object
85
+ # @param [Hash] attributes Model attributes in the form of hash
86
+ def initialize(attributes = {})
87
+ if (!attributes.is_a?(Hash))
88
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Authentik::Api::AgentCreateRequest` initialize method"
89
+ end
90
+
91
+ # check to see if the attribute exists and convert string to symbol for hash key
92
+ acceptable_attribute_map = self.class.acceptable_attribute_map
93
+ attributes = attributes.each_with_object({}) { |(k, v), h|
94
+ if (!acceptable_attribute_map.key?(k.to_sym))
95
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Authentik::Api::AgentCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
96
+ end
97
+ h[k.to_sym] = v
98
+ }
99
+
100
+ if attributes.key?(:'parent')
101
+ self.parent = attributes[:'parent']
102
+ end
103
+
104
+ if attributes.key?(:'label')
105
+ self.label = attributes[:'label']
106
+ end
107
+
108
+ if attributes.key?(:'expiring')
109
+ self.expiring = attributes[:'expiring']
110
+ else
111
+ self.expiring = false
112
+ end
113
+
114
+ if attributes.key?(:'expires')
115
+ self.expires = attributes[:'expires']
116
+ end
117
+
118
+ if attributes.key?(:'policy_behavior')
119
+ self.policy_behavior = attributes[:'policy_behavior']
120
+ end
121
+ end
122
+
123
+ # Show invalid properties with the reasons. Usually used together with valid?
124
+ # @return Array for valid properties with the reasons
125
+ def list_invalid_properties
126
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
127
+ invalid_properties = Array.new
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
+ true
136
+ end
137
+
138
+ # Checks equality by comparing each attribute.
139
+ # @param [Object] Object to be compared
140
+ def ==(o)
141
+ return true if self.equal?(o)
142
+ self.class == o.class &&
143
+ parent == o.parent &&
144
+ label == o.label &&
145
+ expiring == o.expiring &&
146
+ expires == o.expires &&
147
+ policy_behavior == o.policy_behavior
148
+ end
149
+
150
+ # @see the `==` method
151
+ # @param [Object] Object to be compared
152
+ def eql?(o)
153
+ self == o
154
+ end
155
+
156
+ # Calculates hash code according to all attributes.
157
+ # @return [Integer] Hash code
158
+ def hash
159
+ [parent, label, expiring, expires, policy_behavior].hash
160
+ end
161
+
162
+ # Builds the object from hash
163
+ # @param [Hash] attributes Model attributes in the form of hash
164
+ # @return [Object] Returns the model itself
165
+ def self.build_from_hash(attributes)
166
+ return nil unless attributes.is_a?(Hash)
167
+ attributes = attributes.transform_keys(&:to_sym)
168
+ transformed_hash = {}
169
+ openapi_types.each_pair do |key, type|
170
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
171
+ transformed_hash["#{key}"] = nil
172
+ elsif type =~ /\AArray<(.*)>/i
173
+ # check to ensure the input is an array given that the attribute
174
+ # is documented as an array but the input is not
175
+ if attributes[attribute_map[key]].is_a?(Array)
176
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
177
+ end
178
+ elsif !attributes[attribute_map[key]].nil?
179
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
180
+ end
181
+ end
182
+ new(transformed_hash)
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = self.send(attr)
191
+ if value.nil?
192
+ is_nullable = self.class.openapi_nullable.include?(attr)
193
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
194
+ end
195
+
196
+ hash[param] = _to_hash(value)
197
+ end
198
+ hash
199
+ end
200
+
201
+ end
202
+
203
+ end