pulp_maven_client 0.8.2 → 0.9.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 (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 -23
  52. data/lib/pulp_maven_client/models/maven_maven_remote_response.rb +60 -26
  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 -22
  55. data/lib/pulp_maven_client/models/maven_maven_repository_response.rb +34 -24
  56. data/lib/pulp_maven_client/models/paginated_repository_version_response_list.rb +34 -22
  57. data/lib/pulp_maven_client/models/paginatedmaven_maven_artifact_response_list.rb +34 -22
  58. data/lib/pulp_maven_client/models/paginatedmaven_maven_distribution_response_list.rb +34 -22
  59. data/lib/pulp_maven_client/models/paginatedmaven_maven_remote_response_list.rb +34 -22
  60. data/lib/pulp_maven_client/models/paginatedmaven_maven_repository_response_list.rb +34 -22
  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 -25
  63. data/lib/pulp_maven_client/models/patchedmaven_maven_repository.rb +35 -23
  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.')
@@ -334,6 +367,7 @@ module PulpMavenClient
334
367
  # Check to see if the all the properties in the model are valid
335
368
  # @return true if the model is valid
336
369
  def valid?
370
+ warn '[DEPRECATED] the `valid?` method is obsolete'
337
371
  return false if @name.nil?
338
372
  return false if @name.to_s.length < 1
339
373
  return false if @url.nil?
@@ -556,37 +590,33 @@ module PulpMavenClient
556
590
  # @param [Hash] attributes Model attributes in the form of hash
557
591
  # @return [Object] Returns the model itself
558
592
  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
593
  return nil unless attributes.is_a?(Hash)
567
- self.class.openapi_types.each_pair do |key, type|
568
- if type =~ /\AArray<(.*)>/i
594
+ attributes = attributes.transform_keys(&:to_sym)
595
+ transformed_hash = {}
596
+ openapi_types.each_pair do |key, type|
597
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
598
+ transformed_hash["#{key}"] = nil
599
+ elsif type =~ /\AArray<(.*)>/i
569
600
  # check to ensure the input is an array given that the attribute
570
601
  # 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) })
602
+ if attributes[attribute_map[key]].is_a?(Array)
603
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
573
604
  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
605
+ elsif !attributes[attribute_map[key]].nil?
606
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
607
+ end
577
608
  end
578
-
579
- self
609
+ new(transformed_hash)
580
610
  end
581
611
 
582
612
  # Deserializes the data based on type
583
613
  # @param string type Data type
584
614
  # @param string value Value to be deserialized
585
615
  # @return [Object] Deserialized data
586
- def _deserialize(type, value)
616
+ def self._deserialize(type, value)
587
617
  case type.to_sym
588
- when :DateTime
589
- DateTime.parse(value)
618
+ when :Time
619
+ Time.parse(value)
590
620
  when :Date
591
621
  Date.parse(value)
592
622
  when :String
@@ -616,7 +646,9 @@ module PulpMavenClient
616
646
  end
617
647
  end
618
648
  else # model
619
- PulpMavenClient.const_get(type).build_from_hash(value)
649
+ # models (e.g. Pet) or oneOf
650
+ klass = PulpMavenClient.const_get(type)
651
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
620
652
  end
621
653
  end
622
654
 
@@ -642,7 +674,7 @@ module PulpMavenClient
642
674
  is_nullable = self.class.openapi_nullable.include?(attr)
643
675
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
644
676
  end
645
-
677
+
646
678
  hash[param] = _to_hash(value)
647
679
  end
648
680
  hash
@@ -665,5 +697,7 @@ module PulpMavenClient
665
697
  value
666
698
  end
667
699
  end
700
+
668
701
  end
702
+
669
703
  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.')
@@ -290,6 +323,7 @@ module PulpMavenClient
290
323
  # Check to see if the all the properties in the model are valid
291
324
  # @return true if the model is valid
292
325
  def valid?
326
+ warn '[DEPRECATED] the `valid?` method is obsolete'
293
327
  return false if @name.nil?
294
328
  return false if @url.nil?
295
329
  return false if !@download_concurrency.nil? && @download_concurrency < 1
@@ -394,37 +428,33 @@ module PulpMavenClient
394
428
  # @param [Hash] attributes Model attributes in the form of hash
395
429
  # @return [Object] Returns the model itself
396
430
  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
431
  return nil unless attributes.is_a?(Hash)
405
- self.class.openapi_types.each_pair do |key, type|
406
- if type =~ /\AArray<(.*)>/i
432
+ attributes = attributes.transform_keys(&:to_sym)
433
+ transformed_hash = {}
434
+ openapi_types.each_pair do |key, type|
435
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
436
+ transformed_hash["#{key}"] = nil
437
+ elsif type =~ /\AArray<(.*)>/i
407
438
  # check to ensure the input is an array given that the attribute
408
439
  # 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) })
440
+ if attributes[attribute_map[key]].is_a?(Array)
441
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
411
442
  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
443
+ elsif !attributes[attribute_map[key]].nil?
444
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
445
+ end
415
446
  end
416
-
417
- self
447
+ new(transformed_hash)
418
448
  end
419
449
 
420
450
  # Deserializes the data based on type
421
451
  # @param string type Data type
422
452
  # @param string value Value to be deserialized
423
453
  # @return [Object] Deserialized data
424
- def _deserialize(type, value)
454
+ def self._deserialize(type, value)
425
455
  case type.to_sym
426
- when :DateTime
427
- DateTime.parse(value)
456
+ when :Time
457
+ Time.parse(value)
428
458
  when :Date
429
459
  Date.parse(value)
430
460
  when :String
@@ -454,7 +484,9 @@ module PulpMavenClient
454
484
  end
455
485
  end
456
486
  else # model
457
- PulpMavenClient.const_get(type).build_from_hash(value)
487
+ # models (e.g. Pet) or oneOf
488
+ klass = PulpMavenClient.const_get(type)
489
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
458
490
  end
459
491
  end
460
492
 
@@ -480,7 +512,7 @@ module PulpMavenClient
480
512
  is_nullable = self.class.openapi_nullable.include?(attr)
481
513
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
482
514
  end
483
-
515
+
484
516
  hash[param] = _to_hash(value)
485
517
  end
486
518
  hash
@@ -503,5 +535,7 @@ module PulpMavenClient
503
535
  value
504
536
  end
505
537
  end
538
+
506
539
  end
540
+
507
541
  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.')
@@ -124,6 +133,7 @@ module PulpMavenClient
124
133
  # Check to see if the all the properties in the model are valid
125
134
  # @return true if the model is valid
126
135
  def valid?
136
+ warn '[DEPRECATED] the `valid?` method is obsolete'
127
137
  return false if @name.nil?
128
138
  return false if @name.to_s.length < 1
129
139
  return false if !@description.nil? && @description.to_s.length < 1
@@ -193,37 +203,33 @@ module PulpMavenClient
193
203
  # @param [Hash] attributes Model attributes in the form of hash
194
204
  # @return [Object] Returns the model itself
195
205
  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
206
  return nil unless attributes.is_a?(Hash)
204
- self.class.openapi_types.each_pair do |key, type|
205
- if type =~ /\AArray<(.*)>/i
207
+ attributes = attributes.transform_keys(&:to_sym)
208
+ transformed_hash = {}
209
+ openapi_types.each_pair do |key, type|
210
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
211
+ transformed_hash["#{key}"] = nil
212
+ elsif type =~ /\AArray<(.*)>/i
206
213
  # check to ensure the input is an array given that the attribute
207
214
  # 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) })
215
+ if attributes[attribute_map[key]].is_a?(Array)
216
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
210
217
  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
218
+ elsif !attributes[attribute_map[key]].nil?
219
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
220
+ end
214
221
  end
215
-
216
- self
222
+ new(transformed_hash)
217
223
  end
218
224
 
219
225
  # Deserializes the data based on type
220
226
  # @param string type Data type
221
227
  # @param string value Value to be deserialized
222
228
  # @return [Object] Deserialized data
223
- def _deserialize(type, value)
229
+ def self._deserialize(type, value)
224
230
  case type.to_sym
225
- when :DateTime
226
- DateTime.parse(value)
231
+ when :Time
232
+ Time.parse(value)
227
233
  when :Date
228
234
  Date.parse(value)
229
235
  when :String
@@ -253,7 +259,9 @@ module PulpMavenClient
253
259
  end
254
260
  end
255
261
  else # model
256
- PulpMavenClient.const_get(type).build_from_hash(value)
262
+ # models (e.g. Pet) or oneOf
263
+ klass = PulpMavenClient.const_get(type)
264
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
257
265
  end
258
266
  end
259
267
 
@@ -279,7 +287,7 @@ module PulpMavenClient
279
287
  is_nullable = self.class.openapi_nullable.include?(attr)
280
288
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
281
289
  end
282
-
290
+
283
291
  hash[param] = _to_hash(value)
284
292
  end
285
293
  hash
@@ -302,5 +310,7 @@ module PulpMavenClient
302
310
  value
303
311
  end
304
312
  end
313
+
305
314
  end
315
+
306
316
  end