pulp_maven_client 0.8.1 → 0.8.3

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.md +11 -7
  3. data/docs/AsyncOperationResponse.md +8 -7
  4. data/docs/ContentArtifactApi.md +116 -64
  5. data/docs/ContentSummaryResponse.md +12 -11
  6. data/docs/DistributionsMavenApi.md +267 -130
  7. data/docs/MavenMavenArtifact.md +12 -11
  8. data/docs/MavenMavenArtifactResponse.md +24 -21
  9. data/docs/MavenMavenDistribution.md +20 -19
  10. data/docs/MavenMavenDistributionResponse.md +32 -27
  11. data/docs/MavenMavenRemote.md +48 -47
  12. data/docs/MavenMavenRemoteResponse.md +48 -45
  13. data/docs/MavenMavenRemoteResponseHiddenFieldsInner.md +20 -0
  14. data/docs/MavenMavenRepository.md +16 -15
  15. data/docs/MavenMavenRepositoryResponse.md +28 -25
  16. data/docs/PaginatedRepositoryVersionResponseList.md +14 -13
  17. data/docs/PaginatedmavenMavenArtifactResponseList.md +14 -13
  18. data/docs/PaginatedmavenMavenDistributionResponseList.md +14 -13
  19. data/docs/PaginatedmavenMavenRemoteResponseList.md +14 -13
  20. data/docs/PaginatedmavenMavenRepositoryResponseList.md +14 -13
  21. data/docs/PatchedmavenMavenDistribution.md +20 -19
  22. data/docs/PatchedmavenMavenRemote.md +48 -47
  23. data/docs/PatchedmavenMavenRepository.md +16 -15
  24. data/docs/PolicyEnum.md +4 -5
  25. data/docs/PulpMavenApi.md +61 -26
  26. data/docs/RemotesMavenApi.md +271 -132
  27. data/docs/Repair.md +8 -7
  28. data/docs/RepositoriesMavenApi.md +300 -146
  29. data/docs/RepositoriesMavenVersionsApi.md +155 -83
  30. data/docs/RepositoryAddCachedContent.md +8 -7
  31. data/docs/RepositoryVersionResponse.md +22 -19
  32. data/docs/SetLabel.md +10 -9
  33. data/docs/SetLabelResponse.md +10 -9
  34. data/docs/UnsetLabel.md +8 -7
  35. data/docs/UnsetLabelResponse.md +10 -9
  36. data/lib/pulp_maven_client/api/content_artifact_api.rb +31 -22
  37. data/lib/pulp_maven_client/api/distributions_maven_api.rb +66 -40
  38. data/lib/pulp_maven_client/api/pulp_maven_api.rb +9 -7
  39. data/lib/pulp_maven_client/api/remotes_maven_api.rb +81 -52
  40. data/lib/pulp_maven_client/api/repositories_maven_api.rb +79 -49
  41. data/lib/pulp_maven_client/api/repositories_maven_versions_api.rb +50 -37
  42. data/lib/pulp_maven_client/api_client.rb +137 -102
  43. data/lib/pulp_maven_client/api_error.rb +2 -1
  44. data/lib/pulp_maven_client/configuration.rb +162 -21
  45. data/lib/pulp_maven_client/models/async_operation_response.rb +32 -22
  46. data/lib/pulp_maven_client/models/content_summary_response.rb +36 -22
  47. data/lib/pulp_maven_client/models/maven_maven_artifact.rb +34 -22
  48. data/lib/pulp_maven_client/models/maven_maven_artifact_response.rb +45 -25
  49. data/lib/pulp_maven_client/models/maven_maven_distribution.rb +34 -22
  50. data/lib/pulp_maven_client/models/maven_maven_distribution_response.rb +57 -25
  51. data/lib/pulp_maven_client/models/maven_maven_remote.rb +57 -38
  52. data/lib/pulp_maven_client/models/maven_maven_remote_response.rb +71 -42
  53. data/lib/pulp_maven_client/models/{maven_maven_remote_response_hidden_fields.rb → maven_maven_remote_response_hidden_fields_inner.rb} +37 -25
  54. data/lib/pulp_maven_client/models/maven_maven_repository.rb +32 -37
  55. data/lib/pulp_maven_client/models/maven_maven_repository_response.rb +45 -40
  56. data/lib/pulp_maven_client/models/paginated_repository_version_response_list.rb +34 -24
  57. data/lib/pulp_maven_client/models/paginatedmaven_maven_artifact_response_list.rb +34 -24
  58. data/lib/pulp_maven_client/models/paginatedmaven_maven_distribution_response_list.rb +34 -24
  59. data/lib/pulp_maven_client/models/paginatedmaven_maven_remote_response_list.rb +34 -24
  60. data/lib/pulp_maven_client/models/paginatedmaven_maven_repository_response_list.rb +34 -24
  61. data/lib/pulp_maven_client/models/patchedmaven_maven_distribution.rb +40 -24
  62. data/lib/pulp_maven_client/models/patchedmaven_maven_remote.rb +63 -40
  63. data/lib/pulp_maven_client/models/patchedmaven_maven_repository.rb +35 -38
  64. data/lib/pulp_maven_client/models/policy_enum.rb +8 -5
  65. data/lib/pulp_maven_client/models/repair.rb +30 -22
  66. data/lib/pulp_maven_client/models/repository_add_cached_content.rb +30 -22
  67. data/lib/pulp_maven_client/models/repository_version_response.rb +44 -26
  68. data/lib/pulp_maven_client/models/set_label.rb +34 -22
  69. data/lib/pulp_maven_client/models/set_label_response.rb +34 -22
  70. data/lib/pulp_maven_client/models/unset_label.rb +32 -22
  71. data/lib/pulp_maven_client/models/unset_label_response.rb +32 -22
  72. data/lib/pulp_maven_client/version.rb +2 -2
  73. data/lib/pulp_maven_client.rb +2 -2
  74. data/pulp_maven_client.gemspec +9 -6
  75. data/spec/api/content_artifact_api_spec.rb +9 -8
  76. data/spec/api/distributions_maven_api_spec.rb +11 -10
  77. data/spec/api/pulp_maven_api_spec.rb +3 -3
  78. data/spec/api/remotes_maven_api_spec.rb +18 -16
  79. data/spec/api/repositories_maven_api_spec.rb +14 -13
  80. data/spec/api/repositories_maven_versions_api_spec.rb +16 -14
  81. data/spec/models/async_operation_response_spec.rb +7 -12
  82. data/spec/models/content_summary_response_spec.rb +9 -14
  83. data/spec/models/maven_maven_artifact_response_spec.rb +20 -19
  84. data/spec/models/maven_maven_artifact_spec.rb +9 -14
  85. data/spec/models/maven_maven_distribution_response_spec.rb +29 -22
  86. data/spec/models/maven_maven_distribution_spec.rb +13 -18
  87. data/spec/models/{maven_maven_remote_response_hidden_fields_spec.rb → maven_maven_remote_response_hidden_fields_inner_spec.rb} +11 -16
  88. data/spec/models/maven_maven_remote_response_spec.rb +32 -31
  89. data/spec/models/maven_maven_remote_spec.rb +27 -32
  90. data/spec/models/maven_maven_repository_response_spec.rb +22 -21
  91. data/spec/models/maven_maven_repository_spec.rb +11 -16
  92. data/spec/models/paginated_repository_version_response_list_spec.rb +10 -15
  93. data/spec/models/paginatedmaven_maven_artifact_response_list_spec.rb +10 -15
  94. data/spec/models/paginatedmaven_maven_distribution_response_list_spec.rb +10 -15
  95. data/spec/models/paginatedmaven_maven_remote_response_list_spec.rb +10 -15
  96. data/spec/models/paginatedmaven_maven_repository_response_list_spec.rb +10 -15
  97. data/spec/models/patchedmaven_maven_distribution_spec.rb +13 -18
  98. data/spec/models/patchedmaven_maven_remote_spec.rb +27 -32
  99. data/spec/models/patchedmaven_maven_repository_spec.rb +11 -16
  100. data/spec/models/policy_enum_spec.rb +6 -11
  101. data/spec/models/repair_spec.rb +7 -12
  102. data/spec/models/repository_add_cached_content_spec.rb +7 -12
  103. data/spec/models/repository_version_response_spec.rb +19 -18
  104. data/spec/models/set_label_response_spec.rb +8 -13
  105. data/spec/models/set_label_spec.rb +8 -13
  106. data/spec/models/unset_label_response_spec.rb +8 -13
  107. data/spec/models/unset_label_spec.rb +7 -12
  108. data/spec/spec_helper.rb +1 -1
  109. metadata +78 -54
  110. data/docs/MavenMavenRemoteResponseHiddenFields.md +0 -19
  111. data/spec/api_client_spec.rb +0 -188
  112. data/spec/configuration_spec.rb +0 -42
@@ -6,17 +6,21 @@
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 PulpMavenClient
16
17
  # A Serializer for MavenRemote. Add any new fields if defined on MavenRemote. Similar to the example above, in MavenArtifactSerializer. Additional validators can be added to the parent validators list For example:: class Meta: validators = platform.RemoteSerializer.Meta.validators + [myValidator1, myValidator2]
17
18
  class MavenMavenRemoteResponse
18
19
  attr_accessor :pulp_href
19
20
 
21
+ # The Pulp Resource Name (PRN).
22
+ attr_accessor :prn
23
+
20
24
  # Timestamp of creation.
21
25
  attr_accessor :pulp_created
22
26
 
@@ -49,7 +53,7 @@ module PulpMavenClient
49
53
  # Maximum number of retry attempts after a download failure. If not set then the default value (3) will be used.
50
54
  attr_accessor :max_retries
51
55
 
52
- # The policy to use when downloading content. * `immediate` - immediate * `When syncing, download all metadata and content now.` - When syncing, download all metadata and content now.
56
+ # The policy to use when downloading content. * `immediate` - When syncing, download all metadata and content now.
53
57
  attr_accessor :policy
54
58
 
55
59
  # aiohttp.ClientTimeout.total (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
@@ -73,10 +77,33 @@ module PulpMavenClient
73
77
  # List of hidden (write only) fields
74
78
  attr_accessor :hidden_fields
75
79
 
80
+ class EnumAttributeValidator
81
+ attr_reader :datatype
82
+ attr_reader :allowable_values
83
+
84
+ def initialize(datatype, allowable_values)
85
+ @allowable_values = allowable_values.map do |value|
86
+ case datatype.to_s
87
+ when /Integer/i
88
+ value.to_i
89
+ when /Float/i
90
+ value.to_f
91
+ else
92
+ value
93
+ end
94
+ end
95
+ end
96
+
97
+ def valid?(value)
98
+ !value || allowable_values.include?(value)
99
+ end
100
+ end
101
+
76
102
  # Attribute mapping from ruby-style variable name to JSON key.
77
103
  def self.attribute_map
78
104
  {
79
105
  :'pulp_href' => :'pulp_href',
106
+ :'prn' => :'prn',
80
107
  :'pulp_created' => :'pulp_created',
81
108
  :'pulp_last_updated' => :'pulp_last_updated',
82
109
  :'name' => :'name',
@@ -99,12 +126,18 @@ module PulpMavenClient
99
126
  }
100
127
  end
101
128
 
129
+ # Returns all the JSON keys this model knows about
130
+ def self.acceptable_attributes
131
+ attribute_map.values
132
+ end
133
+
102
134
  # Attribute type mapping.
103
135
  def self.openapi_types
104
136
  {
105
137
  :'pulp_href' => :'String',
106
- :'pulp_created' => :'DateTime',
107
- :'pulp_last_updated' => :'DateTime',
138
+ :'prn' => :'String',
139
+ :'pulp_created' => :'Time',
140
+ :'pulp_last_updated' => :'Time',
108
141
  :'name' => :'String',
109
142
  :'url' => :'String',
110
143
  :'ca_cert' => :'String',
@@ -121,7 +154,7 @@ module PulpMavenClient
121
154
  :'sock_read_timeout' => :'Float',
122
155
  :'headers' => :'Array<Object>',
123
156
  :'rate_limit' => :'Integer',
124
- :'hidden_fields' => :'Array<MavenMavenRemoteResponseHiddenFields>'
157
+ :'hidden_fields' => :'Array<MavenMavenRemoteResponseHiddenFieldsInner>'
125
158
  }
126
159
  end
127
160
 
@@ -160,6 +193,10 @@ module PulpMavenClient
160
193
  self.pulp_href = attributes[:'pulp_href']
161
194
  end
162
195
 
196
+ if attributes.key?(:'prn')
197
+ self.prn = attributes[:'prn']
198
+ end
199
+
163
200
  if attributes.key?(:'pulp_created')
164
201
  self.pulp_created = attributes[:'pulp_created']
165
202
  end
@@ -170,10 +207,14 @@ module PulpMavenClient
170
207
 
171
208
  if attributes.key?(:'name')
172
209
  self.name = attributes[:'name']
210
+ else
211
+ self.name = nil
173
212
  end
174
213
 
175
214
  if attributes.key?(:'url')
176
215
  self.url = attributes[:'url']
216
+ else
217
+ self.url = nil
177
218
  end
178
219
 
179
220
  if attributes.key?(:'ca_cert')
@@ -246,6 +287,7 @@ module PulpMavenClient
246
287
  # Show invalid properties with the reasons. Usually used together with valid?
247
288
  # @return Array for valid properties with the reasons
248
289
  def list_invalid_properties
290
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
249
291
  invalid_properties = Array.new
250
292
  if @name.nil?
251
293
  invalid_properties.push('invalid value for "name", name cannot be nil.')
@@ -255,10 +297,6 @@ module PulpMavenClient
255
297
  invalid_properties.push('invalid value for "url", url cannot be nil.')
256
298
  end
257
299
 
258
- if !@download_concurrency.nil? && @download_concurrency < 1
259
- invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
260
- end
261
-
262
300
  if !@total_timeout.nil? && @total_timeout < 0.0
263
301
  invalid_properties.push('invalid value for "total_timeout", must be greater than or equal to 0.0.')
264
302
  end
@@ -281,9 +319,9 @@ module PulpMavenClient
281
319
  # Check to see if the all the properties in the model are valid
282
320
  # @return true if the model is valid
283
321
  def valid?
322
+ warn '[DEPRECATED] the `valid?` method is obsolete'
284
323
  return false if @name.nil?
285
324
  return false if @url.nil?
286
- return false if !@download_concurrency.nil? && @download_concurrency < 1
287
325
  return false if !@total_timeout.nil? && @total_timeout < 0.0
288
326
  return false if !@connect_timeout.nil? && @connect_timeout < 0.0
289
327
  return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
@@ -291,16 +329,6 @@ module PulpMavenClient
291
329
  true
292
330
  end
293
331
 
294
- # Custom attribute writer method with validation
295
- # @param [Object] download_concurrency Value to be assigned
296
- def download_concurrency=(download_concurrency)
297
- if !download_concurrency.nil? && download_concurrency < 1
298
- fail ArgumentError, 'invalid value for "download_concurrency", must be greater than or equal to 1.'
299
- end
300
-
301
- @download_concurrency = download_concurrency
302
- end
303
-
304
332
  # Custom attribute writer method with validation
305
333
  # @param [Object] total_timeout Value to be assigned
306
334
  def total_timeout=(total_timeout)
@@ -347,6 +375,7 @@ module PulpMavenClient
347
375
  return true if self.equal?(o)
348
376
  self.class == o.class &&
349
377
  pulp_href == o.pulp_href &&
378
+ prn == o.prn &&
350
379
  pulp_created == o.pulp_created &&
351
380
  pulp_last_updated == o.pulp_last_updated &&
352
381
  name == o.name &&
@@ -377,44 +406,40 @@ module PulpMavenClient
377
406
  # Calculates hash code according to all attributes.
378
407
  # @return [Integer] Hash code
379
408
  def hash
380
- [pulp_href, pulp_created, pulp_last_updated, name, url, ca_cert, client_cert, tls_validation, proxy_url, pulp_labels, download_concurrency, max_retries, policy, total_timeout, connect_timeout, sock_connect_timeout, sock_read_timeout, headers, rate_limit, hidden_fields].hash
409
+ [pulp_href, prn, pulp_created, pulp_last_updated, name, url, ca_cert, client_cert, tls_validation, proxy_url, pulp_labels, download_concurrency, max_retries, policy, total_timeout, connect_timeout, sock_connect_timeout, sock_read_timeout, headers, rate_limit, hidden_fields].hash
381
410
  end
382
411
 
383
412
  # Builds the object from hash
384
413
  # @param [Hash] attributes Model attributes in the form of hash
385
414
  # @return [Object] Returns the model itself
386
415
  def self.build_from_hash(attributes)
387
- new.build_from_hash(attributes)
388
- end
389
-
390
- # Builds the object from hash
391
- # @param [Hash] attributes Model attributes in the form of hash
392
- # @return [Object] Returns the model itself
393
- def build_from_hash(attributes)
394
416
  return nil unless attributes.is_a?(Hash)
395
- self.class.openapi_types.each_pair do |key, type|
396
- if type =~ /\AArray<(.*)>/i
417
+ attributes = attributes.transform_keys(&:to_sym)
418
+ transformed_hash = {}
419
+ openapi_types.each_pair do |key, type|
420
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
421
+ transformed_hash["#{key}"] = nil
422
+ elsif type =~ /\AArray<(.*)>/i
397
423
  # check to ensure the input is an array given that the attribute
398
424
  # is documented as an array but the input is not
399
- if attributes[self.class.attribute_map[key]].is_a?(Array)
400
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
425
+ if attributes[attribute_map[key]].is_a?(Array)
426
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
401
427
  end
402
- elsif !attributes[self.class.attribute_map[key]].nil?
403
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
404
- end # or else data not found in attributes(hash), not an issue as the data can be optional
428
+ elsif !attributes[attribute_map[key]].nil?
429
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
430
+ end
405
431
  end
406
-
407
- self
432
+ new(transformed_hash)
408
433
  end
409
434
 
410
435
  # Deserializes the data based on type
411
436
  # @param string type Data type
412
437
  # @param string value Value to be deserialized
413
438
  # @return [Object] Deserialized data
414
- def _deserialize(type, value)
439
+ def self._deserialize(type, value)
415
440
  case type.to_sym
416
- when :DateTime
417
- DateTime.parse(value)
441
+ when :Time
442
+ Time.parse(value)
418
443
  when :Date
419
444
  Date.parse(value)
420
445
  when :String
@@ -444,7 +469,9 @@ module PulpMavenClient
444
469
  end
445
470
  end
446
471
  else # model
447
- PulpMavenClient.const_get(type).build_from_hash(value)
472
+ # models (e.g. Pet) or oneOf
473
+ klass = PulpMavenClient.const_get(type)
474
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
448
475
  end
449
476
  end
450
477
 
@@ -470,7 +497,7 @@ module PulpMavenClient
470
497
  is_nullable = self.class.openapi_nullable.include?(attr)
471
498
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
472
499
  end
473
-
500
+
474
501
  hash[param] = _to_hash(value)
475
502
  end
476
503
  hash
@@ -493,5 +520,7 @@ module PulpMavenClient
493
520
  value
494
521
  end
495
522
  end
523
+
496
524
  end
525
+
497
526
  end
@@ -6,14 +6,15 @@
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 PulpMavenClient
16
- class MavenMavenRemoteResponseHiddenFields
17
+ class MavenMavenRemoteResponseHiddenFieldsInner
17
18
  attr_accessor :name
18
19
 
19
20
  attr_accessor :is_set
@@ -26,6 +27,11 @@ module PulpMavenClient
26
27
  }
27
28
  end
28
29
 
30
+ # Returns all the JSON keys this model knows about
31
+ def self.acceptable_attributes
32
+ attribute_map.values
33
+ end
34
+
29
35
  # Attribute type mapping.
30
36
  def self.openapi_types
31
37
  {
@@ -44,29 +50,34 @@ module PulpMavenClient
44
50
  # @param [Hash] attributes Model attributes in the form of hash
45
51
  def initialize(attributes = {})
46
52
  if (!attributes.is_a?(Hash))
47
- fail ArgumentError, "The input argument (attributes) must be a hash in `PulpMavenClient::MavenMavenRemoteResponseHiddenFields` initialize method"
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpMavenClient::MavenMavenRemoteResponseHiddenFieldsInner` initialize method"
48
54
  end
49
55
 
50
56
  # check to see if the attribute exists and convert string to symbol for hash key
51
57
  attributes = attributes.each_with_object({}) { |(k, v), h|
52
58
  if (!self.class.attribute_map.key?(k.to_sym))
53
- fail ArgumentError, "`#{k}` is not a valid attribute in `PulpMavenClient::MavenMavenRemoteResponseHiddenFields`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpMavenClient::MavenMavenRemoteResponseHiddenFieldsInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
54
60
  end
55
61
  h[k.to_sym] = v
56
62
  }
57
63
 
58
64
  if attributes.key?(:'name')
59
65
  self.name = attributes[:'name']
66
+ else
67
+ self.name = nil
60
68
  end
61
69
 
62
70
  if attributes.key?(:'is_set')
63
71
  self.is_set = attributes[:'is_set']
72
+ else
73
+ self.is_set = nil
64
74
  end
65
75
  end
66
76
 
67
77
  # Show invalid properties with the reasons. Usually used together with valid?
68
78
  # @return Array for valid properties with the reasons
69
79
  def list_invalid_properties
80
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
70
81
  invalid_properties = Array.new
71
82
  if @name.nil?
72
83
  invalid_properties.push('invalid value for "name", name cannot be nil.')
@@ -82,6 +93,7 @@ module PulpMavenClient
82
93
  # Check to see if the all the properties in the model are valid
83
94
  # @return true if the model is valid
84
95
  def valid?
96
+ warn '[DEPRECATED] the `valid?` method is obsolete'
85
97
  return false if @name.nil?
86
98
  return false if @is_set.nil?
87
99
  true
@@ -112,37 +124,33 @@ module PulpMavenClient
112
124
  # @param [Hash] attributes Model attributes in the form of hash
113
125
  # @return [Object] Returns the model itself
114
126
  def self.build_from_hash(attributes)
115
- new.build_from_hash(attributes)
116
- end
117
-
118
- # Builds the object from hash
119
- # @param [Hash] attributes Model attributes in the form of hash
120
- # @return [Object] Returns the model itself
121
- def build_from_hash(attributes)
122
127
  return nil unless attributes.is_a?(Hash)
123
- self.class.openapi_types.each_pair do |key, type|
124
- if type =~ /\AArray<(.*)>/i
128
+ attributes = attributes.transform_keys(&:to_sym)
129
+ transformed_hash = {}
130
+ openapi_types.each_pair do |key, type|
131
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = nil
133
+ elsif type =~ /\AArray<(.*)>/i
125
134
  # check to ensure the input is an array given that the attribute
126
135
  # is documented as an array but the input is not
127
- if attributes[self.class.attribute_map[key]].is_a?(Array)
128
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
136
+ if attributes[attribute_map[key]].is_a?(Array)
137
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
129
138
  end
130
- elsif !attributes[self.class.attribute_map[key]].nil?
131
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
132
- end # or else data not found in attributes(hash), not an issue as the data can be optional
139
+ elsif !attributes[attribute_map[key]].nil?
140
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
141
+ end
133
142
  end
134
-
135
- self
143
+ new(transformed_hash)
136
144
  end
137
145
 
138
146
  # Deserializes the data based on type
139
147
  # @param string type Data type
140
148
  # @param string value Value to be deserialized
141
149
  # @return [Object] Deserialized data
142
- def _deserialize(type, value)
150
+ def self._deserialize(type, value)
143
151
  case type.to_sym
144
- when :DateTime
145
- DateTime.parse(value)
152
+ when :Time
153
+ Time.parse(value)
146
154
  when :Date
147
155
  Date.parse(value)
148
156
  when :String
@@ -172,7 +180,9 @@ module PulpMavenClient
172
180
  end
173
181
  end
174
182
  else # model
175
- PulpMavenClient.const_get(type).build_from_hash(value)
183
+ # models (e.g. Pet) or oneOf
184
+ klass = PulpMavenClient.const_get(type)
185
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
176
186
  end
177
187
  end
178
188
 
@@ -198,7 +208,7 @@ module PulpMavenClient
198
208
  is_nullable = self.class.openapi_nullable.include?(attr)
199
209
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
200
210
  end
201
-
211
+
202
212
  hash[param] = _to_hash(value)
203
213
  end
204
214
  hash
@@ -221,5 +231,7 @@ module PulpMavenClient
221
231
  value
222
232
  end
223
233
  end
234
+
224
235
  end
236
+
225
237
  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 PulpMavenClient
16
17
  # Serializer for Maven Repositories.
@@ -40,6 +41,11 @@ module PulpMavenClient
40
41
  }
41
42
  end
42
43
 
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ attribute_map.values
47
+ end
48
+
43
49
  # Attribute type mapping.
44
50
  def self.openapi_types
45
51
  {
@@ -83,6 +89,8 @@ module PulpMavenClient
83
89
 
84
90
  if attributes.key?(:'name')
85
91
  self.name = attributes[:'name']
92
+ else
93
+ self.name = nil
86
94
  end
87
95
 
88
96
  if attributes.key?(:'description')
@@ -101,6 +109,7 @@ module PulpMavenClient
101
109
  # Show invalid properties with the reasons. Usually used together with valid?
102
110
  # @return Array for valid properties with the reasons
103
111
  def list_invalid_properties
112
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
104
113
  invalid_properties = Array.new
105
114
  if @name.nil?
106
115
  invalid_properties.push('invalid value for "name", name cannot be nil.')
@@ -114,20 +123,16 @@ module PulpMavenClient
114
123
  invalid_properties.push('invalid value for "description", the character length must be great than or equal to 1.')
115
124
  end
116
125
 
117
- if !@retain_repo_versions.nil? && @retain_repo_versions < 1
118
- invalid_properties.push('invalid value for "retain_repo_versions", must be greater than or equal to 1.')
119
- end
120
-
121
126
  invalid_properties
122
127
  end
123
128
 
124
129
  # Check to see if the all the properties in the model are valid
125
130
  # @return true if the model is valid
126
131
  def valid?
132
+ warn '[DEPRECATED] the `valid?` method is obsolete'
127
133
  return false if @name.nil?
128
134
  return false if @name.to_s.length < 1
129
135
  return false if !@description.nil? && @description.to_s.length < 1
130
- return false if !@retain_repo_versions.nil? && @retain_repo_versions < 1
131
136
  true
132
137
  end
133
138
 
@@ -155,16 +160,6 @@ module PulpMavenClient
155
160
  @description = description
156
161
  end
157
162
 
158
- # Custom attribute writer method with validation
159
- # @param [Object] retain_repo_versions Value to be assigned
160
- def retain_repo_versions=(retain_repo_versions)
161
- if !retain_repo_versions.nil? && retain_repo_versions < 1
162
- fail ArgumentError, 'invalid value for "retain_repo_versions", must be greater than or equal to 1.'
163
- end
164
-
165
- @retain_repo_versions = retain_repo_versions
166
- end
167
-
168
163
  # Checks equality by comparing each attribute.
169
164
  # @param [Object] Object to be compared
170
165
  def ==(o)
@@ -193,37 +188,33 @@ module PulpMavenClient
193
188
  # @param [Hash] attributes Model attributes in the form of hash
194
189
  # @return [Object] Returns the model itself
195
190
  def self.build_from_hash(attributes)
196
- new.build_from_hash(attributes)
197
- end
198
-
199
- # Builds the object from hash
200
- # @param [Hash] attributes Model attributes in the form of hash
201
- # @return [Object] Returns the model itself
202
- def build_from_hash(attributes)
203
191
  return nil unless attributes.is_a?(Hash)
204
- self.class.openapi_types.each_pair do |key, type|
205
- if type =~ /\AArray<(.*)>/i
192
+ attributes = attributes.transform_keys(&:to_sym)
193
+ transformed_hash = {}
194
+ openapi_types.each_pair do |key, type|
195
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
196
+ transformed_hash["#{key}"] = nil
197
+ elsif type =~ /\AArray<(.*)>/i
206
198
  # check to ensure the input is an array given that the attribute
207
199
  # is documented as an array but the input is not
208
- if attributes[self.class.attribute_map[key]].is_a?(Array)
209
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
200
+ if attributes[attribute_map[key]].is_a?(Array)
201
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
210
202
  end
211
- elsif !attributes[self.class.attribute_map[key]].nil?
212
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
213
- end # or else data not found in attributes(hash), not an issue as the data can be optional
203
+ elsif !attributes[attribute_map[key]].nil?
204
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
205
+ end
214
206
  end
215
-
216
- self
207
+ new(transformed_hash)
217
208
  end
218
209
 
219
210
  # Deserializes the data based on type
220
211
  # @param string type Data type
221
212
  # @param string value Value to be deserialized
222
213
  # @return [Object] Deserialized data
223
- def _deserialize(type, value)
214
+ def self._deserialize(type, value)
224
215
  case type.to_sym
225
- when :DateTime
226
- DateTime.parse(value)
216
+ when :Time
217
+ Time.parse(value)
227
218
  when :Date
228
219
  Date.parse(value)
229
220
  when :String
@@ -253,7 +244,9 @@ module PulpMavenClient
253
244
  end
254
245
  end
255
246
  else # model
256
- PulpMavenClient.const_get(type).build_from_hash(value)
247
+ # models (e.g. Pet) or oneOf
248
+ klass = PulpMavenClient.const_get(type)
249
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
257
250
  end
258
251
  end
259
252
 
@@ -279,7 +272,7 @@ module PulpMavenClient
279
272
  is_nullable = self.class.openapi_nullable.include?(attr)
280
273
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
281
274
  end
282
-
275
+
283
276
  hash[param] = _to_hash(value)
284
277
  end
285
278
  hash
@@ -302,5 +295,7 @@ module PulpMavenClient
302
295
  value
303
296
  end
304
297
  end
298
+
305
299
  end
300
+
306
301
  end