pulp_certguard_client 3.69.1 → 3.70.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 (42) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -5
  3. data/docs/CertguardRHSMCertGuard.md +12 -11
  4. data/docs/CertguardRHSMCertGuardResponse.md +20 -19
  5. data/docs/CertguardX509CertGuard.md +12 -11
  6. data/docs/CertguardX509CertGuardResponse.md +20 -19
  7. data/docs/ContentguardsRhsmApi.md +195 -94
  8. data/docs/ContentguardsX509Api.md +195 -94
  9. data/docs/PaginatedcertguardRHSMCertGuardResponseList.md +14 -13
  10. data/docs/PaginatedcertguardX509CertGuardResponseList.md +14 -13
  11. data/docs/PatchedcertguardRHSMCertGuard.md +12 -11
  12. data/docs/PatchedcertguardX509CertGuard.md +12 -11
  13. data/lib/pulp_certguard_client/api/contentguards_rhsm_api.rb +42 -27
  14. data/lib/pulp_certguard_client/api/contentguards_x509_api.rb +42 -27
  15. data/lib/pulp_certguard_client/api_client.rb +137 -102
  16. data/lib/pulp_certguard_client/api_error.rb +2 -1
  17. data/lib/pulp_certguard_client/configuration.rb +162 -21
  18. data/lib/pulp_certguard_client/models/certguard_rhsm_cert_guard.rb +34 -22
  19. data/lib/pulp_certguard_client/models/certguard_rhsm_cert_guard_response.rb +36 -24
  20. data/lib/pulp_certguard_client/models/certguard_x509_cert_guard.rb +34 -22
  21. data/lib/pulp_certguard_client/models/certguard_x509_cert_guard_response.rb +36 -24
  22. data/lib/pulp_certguard_client/models/paginatedcertguard_rhsm_cert_guard_response_list.rb +34 -22
  23. data/lib/pulp_certguard_client/models/paginatedcertguard_x509_cert_guard_response_list.rb +34 -22
  24. data/lib/pulp_certguard_client/models/patchedcertguard_rhsm_cert_guard.rb +40 -24
  25. data/lib/pulp_certguard_client/models/patchedcertguard_x509_cert_guard.rb +40 -24
  26. data/lib/pulp_certguard_client/version.rb +2 -2
  27. data/lib/pulp_certguard_client.rb +1 -1
  28. data/pulp_certguard_client.gemspec +9 -6
  29. data/spec/api/contentguards_rhsm_api_spec.rb +7 -7
  30. data/spec/api/contentguards_x509_api_spec.rb +7 -7
  31. data/spec/models/certguard_rhsm_cert_guard_response_spec.rb +13 -18
  32. data/spec/models/certguard_rhsm_cert_guard_spec.rb +9 -14
  33. data/spec/models/certguard_x509_cert_guard_response_spec.rb +13 -18
  34. data/spec/models/certguard_x509_cert_guard_spec.rb +9 -14
  35. data/spec/models/paginatedcertguard_rhsm_cert_guard_response_list_spec.rb +10 -15
  36. data/spec/models/paginatedcertguard_x509_cert_guard_response_list_spec.rb +10 -15
  37. data/spec/models/patchedcertguard_rhsm_cert_guard_spec.rb +9 -14
  38. data/spec/models/patchedcertguard_x509_cert_guard_spec.rb +9 -14
  39. data/spec/spec_helper.rb +1 -1
  40. metadata +41 -17
  41. data/spec/api_client_spec.rb +0 -188
  42. data/spec/configuration_spec.rb +0 -42
@@ -6,11 +6,12 @@
6
6
  The version of the OpenAPI document: v3
7
7
  Contact: pulp-list@redhat.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ Generator version: 7.10.0
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module PulpCertguardClient
16
17
  # RHSM Content Guard Serializer.
@@ -33,6 +34,11 @@ module PulpCertguardClient
33
34
  }
34
35
  end
35
36
 
37
+ # Returns all the JSON keys this model knows about
38
+ def self.acceptable_attributes
39
+ attribute_map.values
40
+ end
41
+
36
42
  # Attribute type mapping.
37
43
  def self.openapi_types
38
44
  {
@@ -66,6 +72,8 @@ module PulpCertguardClient
66
72
 
67
73
  if attributes.key?(:'name')
68
74
  self.name = attributes[:'name']
75
+ else
76
+ self.name = nil
69
77
  end
70
78
 
71
79
  if attributes.key?(:'description')
@@ -74,12 +82,15 @@ module PulpCertguardClient
74
82
 
75
83
  if attributes.key?(:'ca_certificate')
76
84
  self.ca_certificate = attributes[:'ca_certificate']
85
+ else
86
+ self.ca_certificate = nil
77
87
  end
78
88
  end
79
89
 
80
90
  # Show invalid properties with the reasons. Usually used together with valid?
81
91
  # @return Array for valid properties with the reasons
82
92
  def list_invalid_properties
93
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
83
94
  invalid_properties = Array.new
84
95
  if @name.nil?
85
96
  invalid_properties.push('invalid value for "name", name cannot be nil.')
@@ -107,6 +118,7 @@ module PulpCertguardClient
107
118
  # Check to see if the all the properties in the model are valid
108
119
  # @return true if the model is valid
109
120
  def valid?
121
+ warn '[DEPRECATED] the `valid?` method is obsolete'
110
122
  return false if @name.nil?
111
123
  return false if @name.to_s.length < 1
112
124
  return false if !@description.nil? && @description.to_s.length < 1
@@ -179,37 +191,33 @@ module PulpCertguardClient
179
191
  # @param [Hash] attributes Model attributes in the form of hash
180
192
  # @return [Object] Returns the model itself
181
193
  def self.build_from_hash(attributes)
182
- new.build_from_hash(attributes)
183
- end
184
-
185
- # Builds the object from hash
186
- # @param [Hash] attributes Model attributes in the form of hash
187
- # @return [Object] Returns the model itself
188
- def build_from_hash(attributes)
189
194
  return nil unless attributes.is_a?(Hash)
190
- self.class.openapi_types.each_pair do |key, type|
191
- if type =~ /\AArray<(.*)>/i
195
+ attributes = attributes.transform_keys(&:to_sym)
196
+ transformed_hash = {}
197
+ openapi_types.each_pair do |key, type|
198
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
199
+ transformed_hash["#{key}"] = nil
200
+ elsif type =~ /\AArray<(.*)>/i
192
201
  # check to ensure the input is an array given that the attribute
193
202
  # is documented as an array but the input is not
194
- if attributes[self.class.attribute_map[key]].is_a?(Array)
195
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
203
+ if attributes[attribute_map[key]].is_a?(Array)
204
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
196
205
  end
197
- elsif !attributes[self.class.attribute_map[key]].nil?
198
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
199
- end # or else data not found in attributes(hash), not an issue as the data can be optional
206
+ elsif !attributes[attribute_map[key]].nil?
207
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
208
+ end
200
209
  end
201
-
202
- self
210
+ new(transformed_hash)
203
211
  end
204
212
 
205
213
  # Deserializes the data based on type
206
214
  # @param string type Data type
207
215
  # @param string value Value to be deserialized
208
216
  # @return [Object] Deserialized data
209
- def _deserialize(type, value)
217
+ def self._deserialize(type, value)
210
218
  case type.to_sym
211
- when :DateTime
212
- DateTime.parse(value)
219
+ when :Time
220
+ Time.parse(value)
213
221
  when :Date
214
222
  Date.parse(value)
215
223
  when :String
@@ -239,7 +247,9 @@ module PulpCertguardClient
239
247
  end
240
248
  end
241
249
  else # model
242
- PulpCertguardClient.const_get(type).build_from_hash(value)
250
+ # models (e.g. Pet) or oneOf
251
+ klass = PulpCertguardClient.const_get(type)
252
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
243
253
  end
244
254
  end
245
255
 
@@ -265,7 +275,7 @@ module PulpCertguardClient
265
275
  is_nullable = self.class.openapi_nullable.include?(attr)
266
276
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
267
277
  end
268
-
278
+
269
279
  hash[param] = _to_hash(value)
270
280
  end
271
281
  hash
@@ -288,5 +298,7 @@ module PulpCertguardClient
288
298
  value
289
299
  end
290
300
  end
301
+
291
302
  end
303
+
292
304
  end
@@ -6,11 +6,12 @@
6
6
  The version of the OpenAPI document: v3
7
7
  Contact: pulp-list@redhat.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ Generator version: 7.10.0
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module PulpCertguardClient
16
17
  # RHSM Content Guard Serializer.
@@ -48,13 +49,18 @@ module PulpCertguardClient
48
49
  }
49
50
  end
50
51
 
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ attribute_map.values
55
+ end
56
+
51
57
  # Attribute type mapping.
52
58
  def self.openapi_types
53
59
  {
54
60
  :'pulp_href' => :'String',
55
61
  :'prn' => :'String',
56
- :'pulp_created' => :'DateTime',
57
- :'pulp_last_updated' => :'DateTime',
62
+ :'pulp_created' => :'Time',
63
+ :'pulp_last_updated' => :'Time',
58
64
  :'name' => :'String',
59
65
  :'description' => :'String',
60
66
  :'ca_certificate' => :'String'
@@ -101,6 +107,8 @@ module PulpCertguardClient
101
107
 
102
108
  if attributes.key?(:'name')
103
109
  self.name = attributes[:'name']
110
+ else
111
+ self.name = nil
104
112
  end
105
113
 
106
114
  if attributes.key?(:'description')
@@ -109,12 +117,15 @@ module PulpCertguardClient
109
117
 
110
118
  if attributes.key?(:'ca_certificate')
111
119
  self.ca_certificate = attributes[:'ca_certificate']
120
+ else
121
+ self.ca_certificate = nil
112
122
  end
113
123
  end
114
124
 
115
125
  # Show invalid properties with the reasons. Usually used together with valid?
116
126
  # @return Array for valid properties with the reasons
117
127
  def list_invalid_properties
128
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
118
129
  invalid_properties = Array.new
119
130
  if @name.nil?
120
131
  invalid_properties.push('invalid value for "name", name cannot be nil.')
@@ -130,6 +141,7 @@ module PulpCertguardClient
130
141
  # Check to see if the all the properties in the model are valid
131
142
  # @return true if the model is valid
132
143
  def valid?
144
+ warn '[DEPRECATED] the `valid?` method is obsolete'
133
145
  return false if @name.nil?
134
146
  return false if @ca_certificate.nil?
135
147
  true
@@ -165,37 +177,33 @@ module PulpCertguardClient
165
177
  # @param [Hash] attributes Model attributes in the form of hash
166
178
  # @return [Object] Returns the model itself
167
179
  def self.build_from_hash(attributes)
168
- new.build_from_hash(attributes)
169
- end
170
-
171
- # Builds the object from hash
172
- # @param [Hash] attributes Model attributes in the form of hash
173
- # @return [Object] Returns the model itself
174
- def build_from_hash(attributes)
175
180
  return nil unless attributes.is_a?(Hash)
176
- self.class.openapi_types.each_pair do |key, type|
177
- if type =~ /\AArray<(.*)>/i
181
+ attributes = attributes.transform_keys(&:to_sym)
182
+ transformed_hash = {}
183
+ openapi_types.each_pair do |key, type|
184
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
185
+ transformed_hash["#{key}"] = nil
186
+ elsif type =~ /\AArray<(.*)>/i
178
187
  # check to ensure the input is an array given that the attribute
179
188
  # is documented as an array but the input is not
180
- if attributes[self.class.attribute_map[key]].is_a?(Array)
181
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
189
+ if attributes[attribute_map[key]].is_a?(Array)
190
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
182
191
  end
183
- elsif !attributes[self.class.attribute_map[key]].nil?
184
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
185
- end # or else data not found in attributes(hash), not an issue as the data can be optional
192
+ elsif !attributes[attribute_map[key]].nil?
193
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
194
+ end
186
195
  end
187
-
188
- self
196
+ new(transformed_hash)
189
197
  end
190
198
 
191
199
  # Deserializes the data based on type
192
200
  # @param string type Data type
193
201
  # @param string value Value to be deserialized
194
202
  # @return [Object] Deserialized data
195
- def _deserialize(type, value)
203
+ def self._deserialize(type, value)
196
204
  case type.to_sym
197
- when :DateTime
198
- DateTime.parse(value)
205
+ when :Time
206
+ Time.parse(value)
199
207
  when :Date
200
208
  Date.parse(value)
201
209
  when :String
@@ -225,7 +233,9 @@ module PulpCertguardClient
225
233
  end
226
234
  end
227
235
  else # model
228
- PulpCertguardClient.const_get(type).build_from_hash(value)
236
+ # models (e.g. Pet) or oneOf
237
+ klass = PulpCertguardClient.const_get(type)
238
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
229
239
  end
230
240
  end
231
241
 
@@ -251,7 +261,7 @@ module PulpCertguardClient
251
261
  is_nullable = self.class.openapi_nullable.include?(attr)
252
262
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
253
263
  end
254
-
264
+
255
265
  hash[param] = _to_hash(value)
256
266
  end
257
267
  hash
@@ -274,5 +284,7 @@ module PulpCertguardClient
274
284
  value
275
285
  end
276
286
  end
287
+
277
288
  end
289
+
278
290
  end
@@ -6,11 +6,12 @@
6
6
  The version of the OpenAPI document: v3
7
7
  Contact: pulp-list@redhat.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ Generator version: 7.10.0
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module PulpCertguardClient
16
17
  # X.509 Content Guard Serializer.
@@ -33,6 +34,11 @@ module PulpCertguardClient
33
34
  }
34
35
  end
35
36
 
37
+ # Returns all the JSON keys this model knows about
38
+ def self.acceptable_attributes
39
+ attribute_map.values
40
+ end
41
+
36
42
  # Attribute type mapping.
37
43
  def self.openapi_types
38
44
  {
@@ -66,6 +72,8 @@ module PulpCertguardClient
66
72
 
67
73
  if attributes.key?(:'name')
68
74
  self.name = attributes[:'name']
75
+ else
76
+ self.name = nil
69
77
  end
70
78
 
71
79
  if attributes.key?(:'description')
@@ -74,12 +82,15 @@ module PulpCertguardClient
74
82
 
75
83
  if attributes.key?(:'ca_certificate')
76
84
  self.ca_certificate = attributes[:'ca_certificate']
85
+ else
86
+ self.ca_certificate = nil
77
87
  end
78
88
  end
79
89
 
80
90
  # Show invalid properties with the reasons. Usually used together with valid?
81
91
  # @return Array for valid properties with the reasons
82
92
  def list_invalid_properties
93
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
83
94
  invalid_properties = Array.new
84
95
  if @name.nil?
85
96
  invalid_properties.push('invalid value for "name", name cannot be nil.')
@@ -107,6 +118,7 @@ module PulpCertguardClient
107
118
  # Check to see if the all the properties in the model are valid
108
119
  # @return true if the model is valid
109
120
  def valid?
121
+ warn '[DEPRECATED] the `valid?` method is obsolete'
110
122
  return false if @name.nil?
111
123
  return false if @name.to_s.length < 1
112
124
  return false if !@description.nil? && @description.to_s.length < 1
@@ -179,37 +191,33 @@ module PulpCertguardClient
179
191
  # @param [Hash] attributes Model attributes in the form of hash
180
192
  # @return [Object] Returns the model itself
181
193
  def self.build_from_hash(attributes)
182
- new.build_from_hash(attributes)
183
- end
184
-
185
- # Builds the object from hash
186
- # @param [Hash] attributes Model attributes in the form of hash
187
- # @return [Object] Returns the model itself
188
- def build_from_hash(attributes)
189
194
  return nil unless attributes.is_a?(Hash)
190
- self.class.openapi_types.each_pair do |key, type|
191
- if type =~ /\AArray<(.*)>/i
195
+ attributes = attributes.transform_keys(&:to_sym)
196
+ transformed_hash = {}
197
+ openapi_types.each_pair do |key, type|
198
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
199
+ transformed_hash["#{key}"] = nil
200
+ elsif type =~ /\AArray<(.*)>/i
192
201
  # check to ensure the input is an array given that the attribute
193
202
  # is documented as an array but the input is not
194
- if attributes[self.class.attribute_map[key]].is_a?(Array)
195
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
203
+ if attributes[attribute_map[key]].is_a?(Array)
204
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
196
205
  end
197
- elsif !attributes[self.class.attribute_map[key]].nil?
198
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
199
- end # or else data not found in attributes(hash), not an issue as the data can be optional
206
+ elsif !attributes[attribute_map[key]].nil?
207
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
208
+ end
200
209
  end
201
-
202
- self
210
+ new(transformed_hash)
203
211
  end
204
212
 
205
213
  # Deserializes the data based on type
206
214
  # @param string type Data type
207
215
  # @param string value Value to be deserialized
208
216
  # @return [Object] Deserialized data
209
- def _deserialize(type, value)
217
+ def self._deserialize(type, value)
210
218
  case type.to_sym
211
- when :DateTime
212
- DateTime.parse(value)
219
+ when :Time
220
+ Time.parse(value)
213
221
  when :Date
214
222
  Date.parse(value)
215
223
  when :String
@@ -239,7 +247,9 @@ module PulpCertguardClient
239
247
  end
240
248
  end
241
249
  else # model
242
- PulpCertguardClient.const_get(type).build_from_hash(value)
250
+ # models (e.g. Pet) or oneOf
251
+ klass = PulpCertguardClient.const_get(type)
252
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
243
253
  end
244
254
  end
245
255
 
@@ -265,7 +275,7 @@ module PulpCertguardClient
265
275
  is_nullable = self.class.openapi_nullable.include?(attr)
266
276
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
267
277
  end
268
-
278
+
269
279
  hash[param] = _to_hash(value)
270
280
  end
271
281
  hash
@@ -288,5 +298,7 @@ module PulpCertguardClient
288
298
  value
289
299
  end
290
300
  end
301
+
291
302
  end
303
+
292
304
  end
@@ -6,11 +6,12 @@
6
6
  The version of the OpenAPI document: v3
7
7
  Contact: pulp-list@redhat.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ Generator version: 7.10.0
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module PulpCertguardClient
16
17
  # X.509 Content Guard Serializer.
@@ -48,13 +49,18 @@ module PulpCertguardClient
48
49
  }
49
50
  end
50
51
 
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ attribute_map.values
55
+ end
56
+
51
57
  # Attribute type mapping.
52
58
  def self.openapi_types
53
59
  {
54
60
  :'pulp_href' => :'String',
55
61
  :'prn' => :'String',
56
- :'pulp_created' => :'DateTime',
57
- :'pulp_last_updated' => :'DateTime',
62
+ :'pulp_created' => :'Time',
63
+ :'pulp_last_updated' => :'Time',
58
64
  :'name' => :'String',
59
65
  :'description' => :'String',
60
66
  :'ca_certificate' => :'String'
@@ -101,6 +107,8 @@ module PulpCertguardClient
101
107
 
102
108
  if attributes.key?(:'name')
103
109
  self.name = attributes[:'name']
110
+ else
111
+ self.name = nil
104
112
  end
105
113
 
106
114
  if attributes.key?(:'description')
@@ -109,12 +117,15 @@ module PulpCertguardClient
109
117
 
110
118
  if attributes.key?(:'ca_certificate')
111
119
  self.ca_certificate = attributes[:'ca_certificate']
120
+ else
121
+ self.ca_certificate = nil
112
122
  end
113
123
  end
114
124
 
115
125
  # Show invalid properties with the reasons. Usually used together with valid?
116
126
  # @return Array for valid properties with the reasons
117
127
  def list_invalid_properties
128
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
118
129
  invalid_properties = Array.new
119
130
  if @name.nil?
120
131
  invalid_properties.push('invalid value for "name", name cannot be nil.')
@@ -130,6 +141,7 @@ module PulpCertguardClient
130
141
  # Check to see if the all the properties in the model are valid
131
142
  # @return true if the model is valid
132
143
  def valid?
144
+ warn '[DEPRECATED] the `valid?` method is obsolete'
133
145
  return false if @name.nil?
134
146
  return false if @ca_certificate.nil?
135
147
  true
@@ -165,37 +177,33 @@ module PulpCertguardClient
165
177
  # @param [Hash] attributes Model attributes in the form of hash
166
178
  # @return [Object] Returns the model itself
167
179
  def self.build_from_hash(attributes)
168
- new.build_from_hash(attributes)
169
- end
170
-
171
- # Builds the object from hash
172
- # @param [Hash] attributes Model attributes in the form of hash
173
- # @return [Object] Returns the model itself
174
- def build_from_hash(attributes)
175
180
  return nil unless attributes.is_a?(Hash)
176
- self.class.openapi_types.each_pair do |key, type|
177
- if type =~ /\AArray<(.*)>/i
181
+ attributes = attributes.transform_keys(&:to_sym)
182
+ transformed_hash = {}
183
+ openapi_types.each_pair do |key, type|
184
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
185
+ transformed_hash["#{key}"] = nil
186
+ elsif type =~ /\AArray<(.*)>/i
178
187
  # check to ensure the input is an array given that the attribute
179
188
  # is documented as an array but the input is not
180
- if attributes[self.class.attribute_map[key]].is_a?(Array)
181
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
189
+ if attributes[attribute_map[key]].is_a?(Array)
190
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
182
191
  end
183
- elsif !attributes[self.class.attribute_map[key]].nil?
184
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
185
- end # or else data not found in attributes(hash), not an issue as the data can be optional
192
+ elsif !attributes[attribute_map[key]].nil?
193
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
194
+ end
186
195
  end
187
-
188
- self
196
+ new(transformed_hash)
189
197
  end
190
198
 
191
199
  # Deserializes the data based on type
192
200
  # @param string type Data type
193
201
  # @param string value Value to be deserialized
194
202
  # @return [Object] Deserialized data
195
- def _deserialize(type, value)
203
+ def self._deserialize(type, value)
196
204
  case type.to_sym
197
- when :DateTime
198
- DateTime.parse(value)
205
+ when :Time
206
+ Time.parse(value)
199
207
  when :Date
200
208
  Date.parse(value)
201
209
  when :String
@@ -225,7 +233,9 @@ module PulpCertguardClient
225
233
  end
226
234
  end
227
235
  else # model
228
- PulpCertguardClient.const_get(type).build_from_hash(value)
236
+ # models (e.g. Pet) or oneOf
237
+ klass = PulpCertguardClient.const_get(type)
238
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
229
239
  end
230
240
  end
231
241
 
@@ -251,7 +261,7 @@ module PulpCertguardClient
251
261
  is_nullable = self.class.openapi_nullable.include?(attr)
252
262
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
253
263
  end
254
-
264
+
255
265
  hash[param] = _to_hash(value)
256
266
  end
257
267
  hash
@@ -274,5 +284,7 @@ module PulpCertguardClient
274
284
  value
275
285
  end
276
286
  end
287
+
277
288
  end
289
+
278
290
  end