pulp_maven_client 0.8.2 → 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 +10 -6
  3. data/docs/AsyncOperationResponse.md +8 -7
  4. data/docs/ContentArtifactApi.md +111 -61
  5. data/docs/ContentSummaryResponse.md +12 -11
  6. data/docs/DistributionsMavenApi.md +265 -130
  7. data/docs/MavenMavenArtifact.md +12 -11
  8. data/docs/MavenMavenArtifactResponse.md +24 -23
  9. data/docs/MavenMavenDistribution.md +20 -19
  10. data/docs/MavenMavenDistributionResponse.md +32 -31
  11. data/docs/MavenMavenRemote.md +48 -47
  12. data/docs/MavenMavenRemoteResponse.md +48 -47
  13. data/docs/MavenMavenRemoteResponseHiddenFieldsInner.md +20 -0
  14. data/docs/MavenMavenRepository.md +16 -15
  15. data/docs/MavenMavenRepositoryResponse.md +28 -27
  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 +60 -25
  26. data/docs/RemotesMavenApi.md +269 -132
  27. data/docs/Repair.md +8 -7
  28. data/docs/RepositoriesMavenApi.md +296 -144
  29. data/docs/RepositoriesMavenVersionsApi.md +152 -82
  30. data/docs/RepositoryAddCachedContent.md +8 -7
  31. data/docs/RepositoryVersionResponse.md +22 -21
  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 +20 -14
  37. data/lib/pulp_maven_client/api/distributions_maven_api.rb +61 -38
  38. data/lib/pulp_maven_client/api/pulp_maven_api.rb +9 -7
  39. data/lib/pulp_maven_client/api/remotes_maven_api.rb +76 -50
  40. data/lib/pulp_maven_client/api/repositories_maven_api.rb +70 -43
  41. data/lib/pulp_maven_client/api/repositories_maven_versions_api.rb +40 -30
  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 +34 -24
  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 +36 -24
  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 +60 -41
  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 +34 -39
  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 +32 -24
  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 +4 -4
  76. data/spec/api/distributions_maven_api_spec.rb +9 -9
  77. data/spec/api/pulp_maven_api_spec.rb +3 -3
  78. data/spec/api/remotes_maven_api_spec.rb +16 -15
  79. data/spec/api/repositories_maven_api_spec.rb +10 -10
  80. data/spec/api/repositories_maven_versions_api_spec.rb +12 -11
  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 +15 -20
  84. data/spec/models/maven_maven_artifact_spec.rb +9 -14
  85. data/spec/models/maven_maven_distribution_response_spec.rb +19 -24
  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 +27 -32
  89. data/spec/models/maven_maven_remote_spec.rb +27 -32
  90. data/spec/models/maven_maven_repository_response_spec.rb +17 -22
  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 +14 -19
  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 +67 -43
  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,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
  # 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]
@@ -56,7 +57,7 @@ module PulpMavenClient
56
57
  # Maximum number of retry attempts after a download failure. If not set then the default value (3) will be used.
57
58
  attr_accessor :max_retries
58
59
 
59
- # 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.
60
+ # The policy to use when downloading content. * `immediate` - When syncing, download all metadata and content now.
60
61
  attr_accessor :policy
61
62
 
62
63
  # aiohttp.ClientTimeout.total (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
@@ -77,6 +78,28 @@ module PulpMavenClient
77
78
  # Limits requests per second for each concurrent downloader
78
79
  attr_accessor :rate_limit
79
80
 
81
+ class EnumAttributeValidator
82
+ attr_reader :datatype
83
+ attr_reader :allowable_values
84
+
85
+ def initialize(datatype, allowable_values)
86
+ @allowable_values = allowable_values.map do |value|
87
+ case datatype.to_s
88
+ when /Integer/i
89
+ value.to_i
90
+ when /Float/i
91
+ value.to_f
92
+ else
93
+ value
94
+ end
95
+ end
96
+ end
97
+
98
+ def valid?(value)
99
+ !value || allowable_values.include?(value)
100
+ end
101
+ end
102
+
80
103
  # Attribute mapping from ruby-style variable name to JSON key.
81
104
  def self.attribute_map
82
105
  {
@@ -104,6 +127,11 @@ module PulpMavenClient
104
127
  }
105
128
  end
106
129
 
130
+ # Returns all the JSON keys this model knows about
131
+ def self.acceptable_attributes
132
+ attribute_map.values
133
+ end
134
+
107
135
  # Attribute type mapping.
108
136
  def self.openapi_types
109
137
  {
@@ -169,10 +197,14 @@ module PulpMavenClient
169
197
 
170
198
  if attributes.key?(:'name')
171
199
  self.name = attributes[:'name']
200
+ else
201
+ self.name = nil
172
202
  end
173
203
 
174
204
  if attributes.key?(:'url')
175
205
  self.url = attributes[:'url']
206
+ else
207
+ self.url = nil
176
208
  end
177
209
 
178
210
  if attributes.key?(:'ca_cert')
@@ -259,6 +291,7 @@ module PulpMavenClient
259
291
  # Show invalid properties with the reasons. Usually used together with valid?
260
292
  # @return Array for valid properties with the reasons
261
293
  def list_invalid_properties
294
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
262
295
  invalid_properties = Array.new
263
296
  if @name.nil?
264
297
  invalid_properties.push('invalid value for "name", name cannot be nil.')
@@ -308,10 +341,6 @@ module PulpMavenClient
308
341
  invalid_properties.push('invalid value for "password", the character length must be great than or equal to 1.')
309
342
  end
310
343
 
311
- if !@download_concurrency.nil? && @download_concurrency < 1
312
- invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
313
- end
314
-
315
344
  if !@total_timeout.nil? && @total_timeout < 0.0
316
345
  invalid_properties.push('invalid value for "total_timeout", must be greater than or equal to 0.0.')
317
346
  end
@@ -334,6 +363,7 @@ module PulpMavenClient
334
363
  # Check to see if the all the properties in the model are valid
335
364
  # @return true if the model is valid
336
365
  def valid?
366
+ warn '[DEPRECATED] the `valid?` method is obsolete'
337
367
  return false if @name.nil?
338
368
  return false if @name.to_s.length < 1
339
369
  return false if @url.nil?
@@ -346,7 +376,6 @@ module PulpMavenClient
346
376
  return false if !@proxy_password.nil? && @proxy_password.to_s.length < 1
347
377
  return false if !@username.nil? && @username.to_s.length < 1
348
378
  return false if !@password.nil? && @password.to_s.length < 1
349
- return false if !@download_concurrency.nil? && @download_concurrency < 1
350
379
  return false if !@total_timeout.nil? && @total_timeout < 0.0
351
380
  return false if !@connect_timeout.nil? && @connect_timeout < 0.0
352
381
  return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
@@ -462,16 +491,6 @@ module PulpMavenClient
462
491
  @password = password
463
492
  end
464
493
 
465
- # Custom attribute writer method with validation
466
- # @param [Object] download_concurrency Value to be assigned
467
- def download_concurrency=(download_concurrency)
468
- if !download_concurrency.nil? && download_concurrency < 1
469
- fail ArgumentError, 'invalid value for "download_concurrency", must be greater than or equal to 1.'
470
- end
471
-
472
- @download_concurrency = download_concurrency
473
- end
474
-
475
494
  # Custom attribute writer method with validation
476
495
  # @param [Object] total_timeout Value to be assigned
477
496
  def total_timeout=(total_timeout)
@@ -556,37 +575,33 @@ module PulpMavenClient
556
575
  # @param [Hash] attributes Model attributes in the form of hash
557
576
  # @return [Object] Returns the model itself
558
577
  def self.build_from_hash(attributes)
559
- new.build_from_hash(attributes)
560
- end
561
-
562
- # Builds the object from hash
563
- # @param [Hash] attributes Model attributes in the form of hash
564
- # @return [Object] Returns the model itself
565
- def build_from_hash(attributes)
566
578
  return nil unless attributes.is_a?(Hash)
567
- self.class.openapi_types.each_pair do |key, type|
568
- if type =~ /\AArray<(.*)>/i
579
+ attributes = attributes.transform_keys(&:to_sym)
580
+ transformed_hash = {}
581
+ openapi_types.each_pair do |key, type|
582
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
583
+ transformed_hash["#{key}"] = nil
584
+ elsif type =~ /\AArray<(.*)>/i
569
585
  # check to ensure the input is an array given that the attribute
570
586
  # is documented as an array but the input is not
571
- if attributes[self.class.attribute_map[key]].is_a?(Array)
572
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
587
+ if attributes[attribute_map[key]].is_a?(Array)
588
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
573
589
  end
574
- elsif !attributes[self.class.attribute_map[key]].nil?
575
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
576
- end # or else data not found in attributes(hash), not an issue as the data can be optional
590
+ elsif !attributes[attribute_map[key]].nil?
591
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
592
+ end
577
593
  end
578
-
579
- self
594
+ new(transformed_hash)
580
595
  end
581
596
 
582
597
  # Deserializes the data based on type
583
598
  # @param string type Data type
584
599
  # @param string value Value to be deserialized
585
600
  # @return [Object] Deserialized data
586
- def _deserialize(type, value)
601
+ def self._deserialize(type, value)
587
602
  case type.to_sym
588
- when :DateTime
589
- DateTime.parse(value)
603
+ when :Time
604
+ Time.parse(value)
590
605
  when :Date
591
606
  Date.parse(value)
592
607
  when :String
@@ -616,7 +631,9 @@ module PulpMavenClient
616
631
  end
617
632
  end
618
633
  else # model
619
- PulpMavenClient.const_get(type).build_from_hash(value)
634
+ # models (e.g. Pet) or oneOf
635
+ klass = PulpMavenClient.const_get(type)
636
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
620
637
  end
621
638
  end
622
639
 
@@ -642,7 +659,7 @@ module PulpMavenClient
642
659
  is_nullable = self.class.openapi_nullable.include?(attr)
643
660
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
644
661
  end
645
-
662
+
646
663
  hash[param] = _to_hash(value)
647
664
  end
648
665
  hash
@@ -665,5 +682,7 @@ module PulpMavenClient
665
682
  value
666
683
  end
667
684
  end
685
+
668
686
  end
687
+
669
688
  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
  # 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]
@@ -52,7 +53,7 @@ module PulpMavenClient
52
53
  # Maximum number of retry attempts after a download failure. If not set then the default value (3) will be used.
53
54
  attr_accessor :max_retries
54
55
 
55
- # 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.
56
57
  attr_accessor :policy
57
58
 
58
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.
@@ -76,6 +77,28 @@ module PulpMavenClient
76
77
  # List of hidden (write only) fields
77
78
  attr_accessor :hidden_fields
78
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
+
79
102
  # Attribute mapping from ruby-style variable name to JSON key.
80
103
  def self.attribute_map
81
104
  {
@@ -103,13 +126,18 @@ module PulpMavenClient
103
126
  }
104
127
  end
105
128
 
129
+ # Returns all the JSON keys this model knows about
130
+ def self.acceptable_attributes
131
+ attribute_map.values
132
+ end
133
+
106
134
  # Attribute type mapping.
107
135
  def self.openapi_types
108
136
  {
109
137
  :'pulp_href' => :'String',
110
138
  :'prn' => :'String',
111
- :'pulp_created' => :'DateTime',
112
- :'pulp_last_updated' => :'DateTime',
139
+ :'pulp_created' => :'Time',
140
+ :'pulp_last_updated' => :'Time',
113
141
  :'name' => :'String',
114
142
  :'url' => :'String',
115
143
  :'ca_cert' => :'String',
@@ -126,7 +154,7 @@ module PulpMavenClient
126
154
  :'sock_read_timeout' => :'Float',
127
155
  :'headers' => :'Array<Object>',
128
156
  :'rate_limit' => :'Integer',
129
- :'hidden_fields' => :'Array<MavenMavenRemoteResponseHiddenFields>'
157
+ :'hidden_fields' => :'Array<MavenMavenRemoteResponseHiddenFieldsInner>'
130
158
  }
131
159
  end
132
160
 
@@ -179,10 +207,14 @@ module PulpMavenClient
179
207
 
180
208
  if attributes.key?(:'name')
181
209
  self.name = attributes[:'name']
210
+ else
211
+ self.name = nil
182
212
  end
183
213
 
184
214
  if attributes.key?(:'url')
185
215
  self.url = attributes[:'url']
216
+ else
217
+ self.url = nil
186
218
  end
187
219
 
188
220
  if attributes.key?(:'ca_cert')
@@ -255,6 +287,7 @@ module PulpMavenClient
255
287
  # Show invalid properties with the reasons. Usually used together with valid?
256
288
  # @return Array for valid properties with the reasons
257
289
  def list_invalid_properties
290
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
258
291
  invalid_properties = Array.new
259
292
  if @name.nil?
260
293
  invalid_properties.push('invalid value for "name", name cannot be nil.')
@@ -264,10 +297,6 @@ module PulpMavenClient
264
297
  invalid_properties.push('invalid value for "url", url cannot be nil.')
265
298
  end
266
299
 
267
- if !@download_concurrency.nil? && @download_concurrency < 1
268
- invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
269
- end
270
-
271
300
  if !@total_timeout.nil? && @total_timeout < 0.0
272
301
  invalid_properties.push('invalid value for "total_timeout", must be greater than or equal to 0.0.')
273
302
  end
@@ -290,9 +319,9 @@ module PulpMavenClient
290
319
  # Check to see if the all the properties in the model are valid
291
320
  # @return true if the model is valid
292
321
  def valid?
322
+ warn '[DEPRECATED] the `valid?` method is obsolete'
293
323
  return false if @name.nil?
294
324
  return false if @url.nil?
295
- return false if !@download_concurrency.nil? && @download_concurrency < 1
296
325
  return false if !@total_timeout.nil? && @total_timeout < 0.0
297
326
  return false if !@connect_timeout.nil? && @connect_timeout < 0.0
298
327
  return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
@@ -300,16 +329,6 @@ module PulpMavenClient
300
329
  true
301
330
  end
302
331
 
303
- # Custom attribute writer method with validation
304
- # @param [Object] download_concurrency Value to be assigned
305
- def download_concurrency=(download_concurrency)
306
- if !download_concurrency.nil? && download_concurrency < 1
307
- fail ArgumentError, 'invalid value for "download_concurrency", must be greater than or equal to 1.'
308
- end
309
-
310
- @download_concurrency = download_concurrency
311
- end
312
-
313
332
  # Custom attribute writer method with validation
314
333
  # @param [Object] total_timeout Value to be assigned
315
334
  def total_timeout=(total_timeout)
@@ -394,37 +413,33 @@ module PulpMavenClient
394
413
  # @param [Hash] attributes Model attributes in the form of hash
395
414
  # @return [Object] Returns the model itself
396
415
  def self.build_from_hash(attributes)
397
- new.build_from_hash(attributes)
398
- end
399
-
400
- # Builds the object from hash
401
- # @param [Hash] attributes Model attributes in the form of hash
402
- # @return [Object] Returns the model itself
403
- def build_from_hash(attributes)
404
416
  return nil unless attributes.is_a?(Hash)
405
- self.class.openapi_types.each_pair do |key, type|
406
- 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
407
423
  # check to ensure the input is an array given that the attribute
408
424
  # is documented as an array but the input is not
409
- if attributes[self.class.attribute_map[key]].is_a?(Array)
410
- 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) }
411
427
  end
412
- elsif !attributes[self.class.attribute_map[key]].nil?
413
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
414
- 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
415
431
  end
416
-
417
- self
432
+ new(transformed_hash)
418
433
  end
419
434
 
420
435
  # Deserializes the data based on type
421
436
  # @param string type Data type
422
437
  # @param string value Value to be deserialized
423
438
  # @return [Object] Deserialized data
424
- def _deserialize(type, value)
439
+ def self._deserialize(type, value)
425
440
  case type.to_sym
426
- when :DateTime
427
- DateTime.parse(value)
441
+ when :Time
442
+ Time.parse(value)
428
443
  when :Date
429
444
  Date.parse(value)
430
445
  when :String
@@ -454,7 +469,9 @@ module PulpMavenClient
454
469
  end
455
470
  end
456
471
  else # model
457
- 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)
458
475
  end
459
476
  end
460
477
 
@@ -480,7 +497,7 @@ module PulpMavenClient
480
497
  is_nullable = self.class.openapi_nullable.include?(attr)
481
498
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
482
499
  end
483
-
500
+
484
501
  hash[param] = _to_hash(value)
485
502
  end
486
503
  hash
@@ -503,5 +520,7 @@ module PulpMavenClient
503
520
  value
504
521
  end
505
522
  end
523
+
506
524
  end
525
+
507
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