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
  # Serializer for Maven Repositories.
17
18
  class MavenMavenRepositoryResponse
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
 
@@ -45,6 +49,7 @@ module PulpMavenClient
45
49
  def self.attribute_map
46
50
  {
47
51
  :'pulp_href' => :'pulp_href',
52
+ :'prn' => :'prn',
48
53
  :'pulp_created' => :'pulp_created',
49
54
  :'pulp_last_updated' => :'pulp_last_updated',
50
55
  :'versions_href' => :'versions_href',
@@ -57,12 +62,18 @@ module PulpMavenClient
57
62
  }
58
63
  end
59
64
 
65
+ # Returns all the JSON keys this model knows about
66
+ def self.acceptable_attributes
67
+ attribute_map.values
68
+ end
69
+
60
70
  # Attribute type mapping.
61
71
  def self.openapi_types
62
72
  {
63
73
  :'pulp_href' => :'String',
64
- :'pulp_created' => :'DateTime',
65
- :'pulp_last_updated' => :'DateTime',
74
+ :'prn' => :'String',
75
+ :'pulp_created' => :'Time',
76
+ :'pulp_last_updated' => :'Time',
66
77
  :'versions_href' => :'String',
67
78
  :'pulp_labels' => :'Hash<String, String>',
68
79
  :'latest_version_href' => :'String',
@@ -101,6 +112,10 @@ module PulpMavenClient
101
112
  self.pulp_href = attributes[:'pulp_href']
102
113
  end
103
114
 
115
+ if attributes.key?(:'prn')
116
+ self.prn = attributes[:'prn']
117
+ end
118
+
104
119
  if attributes.key?(:'pulp_created')
105
120
  self.pulp_created = attributes[:'pulp_created']
106
121
  end
@@ -125,6 +140,8 @@ module PulpMavenClient
125
140
 
126
141
  if attributes.key?(:'name')
127
142
  self.name = attributes[:'name']
143
+ else
144
+ self.name = nil
128
145
  end
129
146
 
130
147
  if attributes.key?(:'description')
@@ -143,42 +160,30 @@ module PulpMavenClient
143
160
  # Show invalid properties with the reasons. Usually used together with valid?
144
161
  # @return Array for valid properties with the reasons
145
162
  def list_invalid_properties
163
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
146
164
  invalid_properties = Array.new
147
165
  if @name.nil?
148
166
  invalid_properties.push('invalid value for "name", name cannot be nil.')
149
167
  end
150
168
 
151
- if !@retain_repo_versions.nil? && @retain_repo_versions < 1
152
- invalid_properties.push('invalid value for "retain_repo_versions", must be greater than or equal to 1.')
153
- end
154
-
155
169
  invalid_properties
156
170
  end
157
171
 
158
172
  # Check to see if the all the properties in the model are valid
159
173
  # @return true if the model is valid
160
174
  def valid?
175
+ warn '[DEPRECATED] the `valid?` method is obsolete'
161
176
  return false if @name.nil?
162
- return false if !@retain_repo_versions.nil? && @retain_repo_versions < 1
163
177
  true
164
178
  end
165
179
 
166
- # Custom attribute writer method with validation
167
- # @param [Object] retain_repo_versions Value to be assigned
168
- def retain_repo_versions=(retain_repo_versions)
169
- if !retain_repo_versions.nil? && retain_repo_versions < 1
170
- fail ArgumentError, 'invalid value for "retain_repo_versions", must be greater than or equal to 1.'
171
- end
172
-
173
- @retain_repo_versions = retain_repo_versions
174
- end
175
-
176
180
  # Checks equality by comparing each attribute.
177
181
  # @param [Object] Object to be compared
178
182
  def ==(o)
179
183
  return true if self.equal?(o)
180
184
  self.class == o.class &&
181
185
  pulp_href == o.pulp_href &&
186
+ prn == o.prn &&
182
187
  pulp_created == o.pulp_created &&
183
188
  pulp_last_updated == o.pulp_last_updated &&
184
189
  versions_href == o.versions_href &&
@@ -199,44 +204,40 @@ module PulpMavenClient
199
204
  # Calculates hash code according to all attributes.
200
205
  # @return [Integer] Hash code
201
206
  def hash
202
- [pulp_href, pulp_created, pulp_last_updated, versions_href, pulp_labels, latest_version_href, name, description, retain_repo_versions, remote].hash
207
+ [pulp_href, prn, pulp_created, pulp_last_updated, versions_href, pulp_labels, latest_version_href, name, description, retain_repo_versions, remote].hash
203
208
  end
204
209
 
205
210
  # Builds the object from hash
206
211
  # @param [Hash] attributes Model attributes in the form of hash
207
212
  # @return [Object] Returns the model itself
208
213
  def self.build_from_hash(attributes)
209
- new.build_from_hash(attributes)
210
- end
211
-
212
- # Builds the object from hash
213
- # @param [Hash] attributes Model attributes in the form of hash
214
- # @return [Object] Returns the model itself
215
- def build_from_hash(attributes)
216
214
  return nil unless attributes.is_a?(Hash)
217
- self.class.openapi_types.each_pair do |key, type|
218
- if type =~ /\AArray<(.*)>/i
215
+ attributes = attributes.transform_keys(&:to_sym)
216
+ transformed_hash = {}
217
+ openapi_types.each_pair do |key, type|
218
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
219
+ transformed_hash["#{key}"] = nil
220
+ elsif type =~ /\AArray<(.*)>/i
219
221
  # check to ensure the input is an array given that the attribute
220
222
  # is documented as an array but the input is not
221
- if attributes[self.class.attribute_map[key]].is_a?(Array)
222
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
223
+ if attributes[attribute_map[key]].is_a?(Array)
224
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
223
225
  end
224
- elsif !attributes[self.class.attribute_map[key]].nil?
225
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
226
- end # or else data not found in attributes(hash), not an issue as the data can be optional
226
+ elsif !attributes[attribute_map[key]].nil?
227
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
228
+ end
227
229
  end
228
-
229
- self
230
+ new(transformed_hash)
230
231
  end
231
232
 
232
233
  # Deserializes the data based on type
233
234
  # @param string type Data type
234
235
  # @param string value Value to be deserialized
235
236
  # @return [Object] Deserialized data
236
- def _deserialize(type, value)
237
+ def self._deserialize(type, value)
237
238
  case type.to_sym
238
- when :DateTime
239
- DateTime.parse(value)
239
+ when :Time
240
+ Time.parse(value)
240
241
  when :Date
241
242
  Date.parse(value)
242
243
  when :String
@@ -266,7 +267,9 @@ module PulpMavenClient
266
267
  end
267
268
  end
268
269
  else # model
269
- PulpMavenClient.const_get(type).build_from_hash(value)
270
+ # models (e.g. Pet) or oneOf
271
+ klass = PulpMavenClient.const_get(type)
272
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
270
273
  end
271
274
  end
272
275
 
@@ -292,7 +295,7 @@ module PulpMavenClient
292
295
  is_nullable = self.class.openapi_nullable.include?(attr)
293
296
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
294
297
  end
295
-
298
+
296
299
  hash[param] = _to_hash(value)
297
300
  end
298
301
  hash
@@ -315,5 +318,7 @@ module PulpMavenClient
315
318
  value
316
319
  end
317
320
  end
321
+
318
322
  end
323
+
319
324
  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
  class PaginatedRepositoryVersionResponseList
@@ -32,6 +33,11 @@ module PulpMavenClient
32
33
  }
33
34
  end
34
35
 
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
35
41
  # Attribute type mapping.
36
42
  def self.openapi_types
37
43
  {
@@ -45,8 +51,6 @@ module PulpMavenClient
45
51
  # List of attributes with nullable: true
46
52
  def self.openapi_nullable
47
53
  Set.new([
48
- :'_next',
49
- :'previous',
50
54
  ])
51
55
  end
52
56
 
@@ -67,6 +71,8 @@ module PulpMavenClient
67
71
 
68
72
  if attributes.key?(:'count')
69
73
  self.count = attributes[:'count']
74
+ else
75
+ self.count = nil
70
76
  end
71
77
 
72
78
  if attributes.key?(:'_next')
@@ -81,12 +87,15 @@ module PulpMavenClient
81
87
  if (value = attributes[:'results']).is_a?(Array)
82
88
  self.results = value
83
89
  end
90
+ else
91
+ self.results = nil
84
92
  end
85
93
  end
86
94
 
87
95
  # Show invalid properties with the reasons. Usually used together with valid?
88
96
  # @return Array for valid properties with the reasons
89
97
  def list_invalid_properties
98
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
90
99
  invalid_properties = Array.new
91
100
  if @count.nil?
92
101
  invalid_properties.push('invalid value for "count", count cannot be nil.')
@@ -102,6 +111,7 @@ module PulpMavenClient
102
111
  # Check to see if the all the properties in the model are valid
103
112
  # @return true if the model is valid
104
113
  def valid?
114
+ warn '[DEPRECATED] the `valid?` method is obsolete'
105
115
  return false if @count.nil?
106
116
  return false if @results.nil?
107
117
  true
@@ -134,37 +144,33 @@ module PulpMavenClient
134
144
  # @param [Hash] attributes Model attributes in the form of hash
135
145
  # @return [Object] Returns the model itself
136
146
  def self.build_from_hash(attributes)
137
- new.build_from_hash(attributes)
138
- end
139
-
140
- # Builds the object from hash
141
- # @param [Hash] attributes Model attributes in the form of hash
142
- # @return [Object] Returns the model itself
143
- def build_from_hash(attributes)
144
147
  return nil unless attributes.is_a?(Hash)
145
- self.class.openapi_types.each_pair do |key, type|
146
- if type =~ /\AArray<(.*)>/i
148
+ attributes = attributes.transform_keys(&:to_sym)
149
+ transformed_hash = {}
150
+ openapi_types.each_pair do |key, type|
151
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
152
+ transformed_hash["#{key}"] = nil
153
+ elsif type =~ /\AArray<(.*)>/i
147
154
  # check to ensure the input is an array given that the attribute
148
155
  # is documented as an array but the input is not
149
- if attributes[self.class.attribute_map[key]].is_a?(Array)
150
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
156
+ if attributes[attribute_map[key]].is_a?(Array)
157
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
151
158
  end
152
- elsif !attributes[self.class.attribute_map[key]].nil?
153
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
154
- end # or else data not found in attributes(hash), not an issue as the data can be optional
159
+ elsif !attributes[attribute_map[key]].nil?
160
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
161
+ end
155
162
  end
156
-
157
- self
163
+ new(transformed_hash)
158
164
  end
159
165
 
160
166
  # Deserializes the data based on type
161
167
  # @param string type Data type
162
168
  # @param string value Value to be deserialized
163
169
  # @return [Object] Deserialized data
164
- def _deserialize(type, value)
170
+ def self._deserialize(type, value)
165
171
  case type.to_sym
166
- when :DateTime
167
- DateTime.parse(value)
172
+ when :Time
173
+ Time.parse(value)
168
174
  when :Date
169
175
  Date.parse(value)
170
176
  when :String
@@ -194,7 +200,9 @@ module PulpMavenClient
194
200
  end
195
201
  end
196
202
  else # model
197
- PulpMavenClient.const_get(type).build_from_hash(value)
203
+ # models (e.g. Pet) or oneOf
204
+ klass = PulpMavenClient.const_get(type)
205
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
198
206
  end
199
207
  end
200
208
 
@@ -220,7 +228,7 @@ module PulpMavenClient
220
228
  is_nullable = self.class.openapi_nullable.include?(attr)
221
229
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
222
230
  end
223
-
231
+
224
232
  hash[param] = _to_hash(value)
225
233
  end
226
234
  hash
@@ -243,5 +251,7 @@ module PulpMavenClient
243
251
  value
244
252
  end
245
253
  end
254
+
246
255
  end
256
+
247
257
  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
  class PaginatedmavenMavenArtifactResponseList
@@ -32,6 +33,11 @@ module PulpMavenClient
32
33
  }
33
34
  end
34
35
 
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
35
41
  # Attribute type mapping.
36
42
  def self.openapi_types
37
43
  {
@@ -45,8 +51,6 @@ module PulpMavenClient
45
51
  # List of attributes with nullable: true
46
52
  def self.openapi_nullable
47
53
  Set.new([
48
- :'_next',
49
- :'previous',
50
54
  ])
51
55
  end
52
56
 
@@ -67,6 +71,8 @@ module PulpMavenClient
67
71
 
68
72
  if attributes.key?(:'count')
69
73
  self.count = attributes[:'count']
74
+ else
75
+ self.count = nil
70
76
  end
71
77
 
72
78
  if attributes.key?(:'_next')
@@ -81,12 +87,15 @@ module PulpMavenClient
81
87
  if (value = attributes[:'results']).is_a?(Array)
82
88
  self.results = value
83
89
  end
90
+ else
91
+ self.results = nil
84
92
  end
85
93
  end
86
94
 
87
95
  # Show invalid properties with the reasons. Usually used together with valid?
88
96
  # @return Array for valid properties with the reasons
89
97
  def list_invalid_properties
98
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
90
99
  invalid_properties = Array.new
91
100
  if @count.nil?
92
101
  invalid_properties.push('invalid value for "count", count cannot be nil.')
@@ -102,6 +111,7 @@ module PulpMavenClient
102
111
  # Check to see if the all the properties in the model are valid
103
112
  # @return true if the model is valid
104
113
  def valid?
114
+ warn '[DEPRECATED] the `valid?` method is obsolete'
105
115
  return false if @count.nil?
106
116
  return false if @results.nil?
107
117
  true
@@ -134,37 +144,33 @@ module PulpMavenClient
134
144
  # @param [Hash] attributes Model attributes in the form of hash
135
145
  # @return [Object] Returns the model itself
136
146
  def self.build_from_hash(attributes)
137
- new.build_from_hash(attributes)
138
- end
139
-
140
- # Builds the object from hash
141
- # @param [Hash] attributes Model attributes in the form of hash
142
- # @return [Object] Returns the model itself
143
- def build_from_hash(attributes)
144
147
  return nil unless attributes.is_a?(Hash)
145
- self.class.openapi_types.each_pair do |key, type|
146
- if type =~ /\AArray<(.*)>/i
148
+ attributes = attributes.transform_keys(&:to_sym)
149
+ transformed_hash = {}
150
+ openapi_types.each_pair do |key, type|
151
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
152
+ transformed_hash["#{key}"] = nil
153
+ elsif type =~ /\AArray<(.*)>/i
147
154
  # check to ensure the input is an array given that the attribute
148
155
  # is documented as an array but the input is not
149
- if attributes[self.class.attribute_map[key]].is_a?(Array)
150
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
156
+ if attributes[attribute_map[key]].is_a?(Array)
157
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
151
158
  end
152
- elsif !attributes[self.class.attribute_map[key]].nil?
153
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
154
- end # or else data not found in attributes(hash), not an issue as the data can be optional
159
+ elsif !attributes[attribute_map[key]].nil?
160
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
161
+ end
155
162
  end
156
-
157
- self
163
+ new(transformed_hash)
158
164
  end
159
165
 
160
166
  # Deserializes the data based on type
161
167
  # @param string type Data type
162
168
  # @param string value Value to be deserialized
163
169
  # @return [Object] Deserialized data
164
- def _deserialize(type, value)
170
+ def self._deserialize(type, value)
165
171
  case type.to_sym
166
- when :DateTime
167
- DateTime.parse(value)
172
+ when :Time
173
+ Time.parse(value)
168
174
  when :Date
169
175
  Date.parse(value)
170
176
  when :String
@@ -194,7 +200,9 @@ module PulpMavenClient
194
200
  end
195
201
  end
196
202
  else # model
197
- PulpMavenClient.const_get(type).build_from_hash(value)
203
+ # models (e.g. Pet) or oneOf
204
+ klass = PulpMavenClient.const_get(type)
205
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
198
206
  end
199
207
  end
200
208
 
@@ -220,7 +228,7 @@ module PulpMavenClient
220
228
  is_nullable = self.class.openapi_nullable.include?(attr)
221
229
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
222
230
  end
223
-
231
+
224
232
  hash[param] = _to_hash(value)
225
233
  end
226
234
  hash
@@ -243,5 +251,7 @@ module PulpMavenClient
243
251
  value
244
252
  end
245
253
  end
254
+
246
255
  end
256
+
247
257
  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
  class PaginatedmavenMavenDistributionResponseList
@@ -32,6 +33,11 @@ module PulpMavenClient
32
33
  }
33
34
  end
34
35
 
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
35
41
  # Attribute type mapping.
36
42
  def self.openapi_types
37
43
  {
@@ -45,8 +51,6 @@ module PulpMavenClient
45
51
  # List of attributes with nullable: true
46
52
  def self.openapi_nullable
47
53
  Set.new([
48
- :'_next',
49
- :'previous',
50
54
  ])
51
55
  end
52
56
 
@@ -67,6 +71,8 @@ module PulpMavenClient
67
71
 
68
72
  if attributes.key?(:'count')
69
73
  self.count = attributes[:'count']
74
+ else
75
+ self.count = nil
70
76
  end
71
77
 
72
78
  if attributes.key?(:'_next')
@@ -81,12 +87,15 @@ module PulpMavenClient
81
87
  if (value = attributes[:'results']).is_a?(Array)
82
88
  self.results = value
83
89
  end
90
+ else
91
+ self.results = nil
84
92
  end
85
93
  end
86
94
 
87
95
  # Show invalid properties with the reasons. Usually used together with valid?
88
96
  # @return Array for valid properties with the reasons
89
97
  def list_invalid_properties
98
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
90
99
  invalid_properties = Array.new
91
100
  if @count.nil?
92
101
  invalid_properties.push('invalid value for "count", count cannot be nil.')
@@ -102,6 +111,7 @@ module PulpMavenClient
102
111
  # Check to see if the all the properties in the model are valid
103
112
  # @return true if the model is valid
104
113
  def valid?
114
+ warn '[DEPRECATED] the `valid?` method is obsolete'
105
115
  return false if @count.nil?
106
116
  return false if @results.nil?
107
117
  true
@@ -134,37 +144,33 @@ module PulpMavenClient
134
144
  # @param [Hash] attributes Model attributes in the form of hash
135
145
  # @return [Object] Returns the model itself
136
146
  def self.build_from_hash(attributes)
137
- new.build_from_hash(attributes)
138
- end
139
-
140
- # Builds the object from hash
141
- # @param [Hash] attributes Model attributes in the form of hash
142
- # @return [Object] Returns the model itself
143
- def build_from_hash(attributes)
144
147
  return nil unless attributes.is_a?(Hash)
145
- self.class.openapi_types.each_pair do |key, type|
146
- if type =~ /\AArray<(.*)>/i
148
+ attributes = attributes.transform_keys(&:to_sym)
149
+ transformed_hash = {}
150
+ openapi_types.each_pair do |key, type|
151
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
152
+ transformed_hash["#{key}"] = nil
153
+ elsif type =~ /\AArray<(.*)>/i
147
154
  # check to ensure the input is an array given that the attribute
148
155
  # is documented as an array but the input is not
149
- if attributes[self.class.attribute_map[key]].is_a?(Array)
150
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
156
+ if attributes[attribute_map[key]].is_a?(Array)
157
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
151
158
  end
152
- elsif !attributes[self.class.attribute_map[key]].nil?
153
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
154
- end # or else data not found in attributes(hash), not an issue as the data can be optional
159
+ elsif !attributes[attribute_map[key]].nil?
160
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
161
+ end
155
162
  end
156
-
157
- self
163
+ new(transformed_hash)
158
164
  end
159
165
 
160
166
  # Deserializes the data based on type
161
167
  # @param string type Data type
162
168
  # @param string value Value to be deserialized
163
169
  # @return [Object] Deserialized data
164
- def _deserialize(type, value)
170
+ def self._deserialize(type, value)
165
171
  case type.to_sym
166
- when :DateTime
167
- DateTime.parse(value)
172
+ when :Time
173
+ Time.parse(value)
168
174
  when :Date
169
175
  Date.parse(value)
170
176
  when :String
@@ -194,7 +200,9 @@ module PulpMavenClient
194
200
  end
195
201
  end
196
202
  else # model
197
- PulpMavenClient.const_get(type).build_from_hash(value)
203
+ # models (e.g. Pet) or oneOf
204
+ klass = PulpMavenClient.const_get(type)
205
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
198
206
  end
199
207
  end
200
208
 
@@ -220,7 +228,7 @@ module PulpMavenClient
220
228
  is_nullable = self.class.openapi_nullable.include?(attr)
221
229
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
222
230
  end
223
-
231
+
224
232
  hash[param] = _to_hash(value)
225
233
  end
226
234
  hash
@@ -243,5 +251,7 @@ module PulpMavenClient
243
251
  value
244
252
  end
245
253
  end
254
+
246
255
  end
256
+
247
257
  end