pulp_python_client 3.12.5 → 3.13.1

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 (169) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +17 -16
  3. data/docs/AsyncOperationResponse.md +8 -7
  4. data/docs/ContentPackagesApi.md +170 -120
  5. data/docs/ContentSummaryResponse.md +12 -11
  6. data/docs/DistributionsPypiApi.md +385 -182
  7. data/docs/ExcludePlatformsEnum.md +4 -5
  8. data/docs/MyPermissionsResponse.md +8 -7
  9. data/docs/NestedRole.md +12 -11
  10. data/docs/NestedRoleResponse.md +12 -11
  11. data/docs/ObjectRolesResponse.md +8 -7
  12. data/docs/PackageMetadataResponse.md +14 -13
  13. data/docs/PackageTypesEnum.md +4 -5
  14. data/docs/PackageUploadTaskResponse.md +12 -11
  15. data/docs/PaginatedRepositoryVersionResponseList.md +14 -13
  16. data/docs/PaginatedpythonPythonDistributionResponseList.md +14 -13
  17. data/docs/PaginatedpythonPythonPackageContentResponseList.md +14 -13
  18. data/docs/PaginatedpythonPythonPublicationResponseList.md +14 -13
  19. data/docs/PaginatedpythonPythonRemoteResponseList.md +14 -13
  20. data/docs/PaginatedpythonPythonRepositoryResponseList.md +14 -13
  21. data/docs/PatchedpythonPythonDistribution.md +24 -23
  22. data/docs/PatchedpythonPythonRemote.md +60 -59
  23. data/docs/PatchedpythonPythonRepository.md +18 -17
  24. data/docs/PolicyEnum.md +4 -5
  25. data/docs/PublicationsPypiApi.md +267 -130
  26. data/docs/PypiApi.md +33 -17
  27. data/docs/PypiLegacyApi.md +34 -18
  28. data/docs/PypiMetadataApi.md +34 -18
  29. data/docs/PypiSimpleApi.md +95 -45
  30. data/docs/PythonPythonDistribution.md +24 -23
  31. data/docs/PythonPythonDistributionResponse.md +36 -35
  32. data/docs/PythonPythonPackageContentResponse.md +70 -69
  33. data/docs/PythonPythonPublication.md +10 -9
  34. data/docs/PythonPythonPublicationResponse.md +20 -19
  35. data/docs/PythonPythonRemote.md +60 -59
  36. data/docs/PythonPythonRemoteResponse.md +60 -59
  37. data/docs/PythonPythonRemoteResponseHiddenFieldsInner.md +20 -0
  38. data/docs/PythonPythonRepository.md +18 -17
  39. data/docs/PythonPythonRepositoryResponse.md +30 -29
  40. data/docs/RemotesPythonApi.md +420 -198
  41. data/docs/Repair.md +8 -7
  42. data/docs/RepositoriesPythonApi.md +444 -207
  43. data/docs/RepositoriesPythonVersionsApi.md +152 -82
  44. data/docs/RepositoryAddRemoveContent.md +12 -11
  45. data/docs/RepositorySyncURL.md +10 -9
  46. data/docs/RepositoryVersionResponse.md +22 -21
  47. data/docs/SetLabel.md +10 -9
  48. data/docs/SetLabelResponse.md +10 -9
  49. data/docs/SummaryResponse.md +12 -11
  50. data/docs/UnsetLabel.md +8 -7
  51. data/docs/UnsetLabelResponse.md +10 -9
  52. data/lib/pulp_python_client/api/content_packages_api.rb +21 -15
  53. data/lib/pulp_python_client/api/distributions_pypi_api.rb +89 -56
  54. data/lib/pulp_python_client/api/publications_pypi_api.rb +67 -47
  55. data/lib/pulp_python_client/api/pypi_api.rb +6 -5
  56. data/lib/pulp_python_client/api/pypi_legacy_api.rb +11 -7
  57. data/lib/pulp_python_client/api/pypi_metadata_api.rb +6 -5
  58. data/lib/pulp_python_client/api/pypi_simple_api.rb +19 -13
  59. data/lib/pulp_python_client/api/remotes_python_api.rb +113 -73
  60. data/lib/pulp_python_client/api/repositories_python_api.rb +107 -66
  61. data/lib/pulp_python_client/api/repositories_python_versions_api.rb +40 -30
  62. data/lib/pulp_python_client/api_client.rb +137 -102
  63. data/lib/pulp_python_client/api_error.rb +2 -1
  64. data/lib/pulp_python_client/configuration.rb +162 -21
  65. data/lib/pulp_python_client/models/async_operation_response.rb +32 -22
  66. data/lib/pulp_python_client/models/content_summary_response.rb +36 -22
  67. data/lib/pulp_python_client/models/exclude_platforms_enum.rb +8 -4
  68. data/lib/pulp_python_client/models/my_permissions_response.rb +32 -22
  69. data/lib/pulp_python_client/models/nested_role.rb +32 -22
  70. data/lib/pulp_python_client/models/nested_role_response.rb +32 -22
  71. data/lib/pulp_python_client/models/object_roles_response.rb +32 -22
  72. data/lib/pulp_python_client/models/package_metadata_response.rb +41 -37
  73. data/lib/pulp_python_client/models/package_types_enum.rb +8 -4
  74. data/lib/pulp_python_client/models/package_upload_task_response.rb +37 -23
  75. data/lib/pulp_python_client/models/paginated_repository_version_response_list.rb +34 -22
  76. data/lib/pulp_python_client/models/paginatedpython_python_distribution_response_list.rb +34 -22
  77. data/lib/pulp_python_client/models/paginatedpython_python_package_content_response_list.rb +34 -22
  78. data/lib/pulp_python_client/models/paginatedpython_python_publication_response_list.rb +34 -22
  79. data/lib/pulp_python_client/models/paginatedpython_python_remote_response_list.rb +34 -22
  80. data/lib/pulp_python_client/models/paginatedpython_python_repository_response_list.rb +34 -22
  81. data/lib/pulp_python_client/models/patchedpython_python_distribution.rb +40 -24
  82. data/lib/pulp_python_client/models/patchedpython_python_remote.rb +82 -44
  83. data/lib/pulp_python_client/models/patchedpython_python_repository.rb +35 -23
  84. data/lib/pulp_python_client/models/policy_enum.rb +8 -4
  85. data/lib/pulp_python_client/models/python_python_distribution.rb +34 -22
  86. data/lib/pulp_python_client/models/python_python_distribution_response.rb +36 -24
  87. data/lib/pulp_python_client/models/python_python_package_content_response.rb +38 -24
  88. data/lib/pulp_python_client/models/python_python_publication.rb +30 -22
  89. data/lib/pulp_python_client/models/python_python_publication_response.rb +32 -24
  90. data/lib/pulp_python_client/models/python_python_remote.rb +76 -42
  91. data/lib/pulp_python_client/models/python_python_remote_response.rb +79 -45
  92. data/lib/pulp_python_client/models/{python_python_remote_response_hidden_fields.rb → python_python_remote_response_hidden_fields_inner.rb} +37 -25
  93. data/lib/pulp_python_client/models/python_python_repository.rb +32 -22
  94. data/lib/pulp_python_client/models/python_python_repository_response.rb +34 -24
  95. data/lib/pulp_python_client/models/repair.rb +30 -22
  96. data/lib/pulp_python_client/models/repository_add_remove_content.rb +30 -22
  97. data/lib/pulp_python_client/models/repository_sync_url.rb +30 -22
  98. data/lib/pulp_python_client/models/repository_version_response.rb +32 -24
  99. data/lib/pulp_python_client/models/set_label.rb +34 -22
  100. data/lib/pulp_python_client/models/set_label_response.rb +34 -22
  101. data/lib/pulp_python_client/models/summary_response.rb +36 -22
  102. data/lib/pulp_python_client/models/unset_label.rb +32 -22
  103. data/lib/pulp_python_client/models/unset_label_response.rb +32 -22
  104. data/lib/pulp_python_client/version.rb +2 -2
  105. data/lib/pulp_python_client.rb +2 -5
  106. data/pulp_python_client.gemspec +9 -6
  107. data/spec/api/content_packages_api_spec.rb +4 -4
  108. data/spec/api/distributions_pypi_api_spec.rb +13 -13
  109. data/spec/api/publications_pypi_api_spec.rb +16 -15
  110. data/spec/api/pypi_api_spec.rb +2 -2
  111. data/spec/api/pypi_legacy_api_spec.rb +2 -2
  112. data/spec/api/pypi_metadata_api_spec.rb +2 -2
  113. data/spec/api/pypi_simple_api_spec.rb +4 -4
  114. data/spec/api/remotes_python_api_spec.rb +21 -20
  115. data/spec/api/repositories_python_api_spec.rb +15 -15
  116. data/spec/api/repositories_python_versions_api_spec.rb +12 -11
  117. data/spec/models/async_operation_response_spec.rb +7 -12
  118. data/spec/models/content_summary_response_spec.rb +9 -14
  119. data/spec/models/exclude_platforms_enum_spec.rb +6 -11
  120. data/spec/models/my_permissions_response_spec.rb +7 -12
  121. data/spec/models/nested_role_response_spec.rb +9 -14
  122. data/spec/models/nested_role_spec.rb +9 -14
  123. data/spec/models/object_roles_response_spec.rb +7 -12
  124. data/spec/models/package_metadata_response_spec.rb +10 -15
  125. data/spec/models/package_types_enum_spec.rb +6 -11
  126. data/spec/models/package_upload_task_response_spec.rb +9 -14
  127. data/spec/models/paginated_repository_version_response_list_spec.rb +10 -15
  128. data/spec/models/paginatedpython_python_distribution_response_list_spec.rb +10 -15
  129. data/spec/models/paginatedpython_python_package_content_response_list_spec.rb +10 -15
  130. data/spec/models/paginatedpython_python_publication_response_list_spec.rb +10 -15
  131. data/spec/models/paginatedpython_python_remote_response_list_spec.rb +10 -15
  132. data/spec/models/paginatedpython_python_repository_response_list_spec.rb +10 -15
  133. data/spec/models/patchedpython_python_distribution_spec.rb +15 -20
  134. data/spec/models/patchedpython_python_remote_spec.rb +33 -38
  135. data/spec/models/patchedpython_python_repository_spec.rb +12 -17
  136. data/spec/models/policy_enum_spec.rb +6 -11
  137. data/spec/models/python_python_distribution_response_spec.rb +21 -26
  138. data/spec/models/python_python_distribution_spec.rb +15 -20
  139. data/spec/models/python_python_package_content_response_spec.rb +38 -43
  140. data/spec/models/python_python_publication_response_spec.rb +13 -18
  141. data/spec/models/python_python_publication_spec.rb +8 -13
  142. data/spec/models/{python_python_remote_response_hidden_fields_spec.rb → python_python_remote_response_hidden_fields_inner_spec.rb} +11 -16
  143. data/spec/models/python_python_remote_response_spec.rb +33 -38
  144. data/spec/models/python_python_remote_spec.rb +33 -38
  145. data/spec/models/python_python_repository_response_spec.rb +18 -23
  146. data/spec/models/python_python_repository_spec.rb +12 -17
  147. data/spec/models/repair_spec.rb +7 -12
  148. data/spec/models/repository_add_remove_content_spec.rb +9 -14
  149. data/spec/models/repository_sync_url_spec.rb +8 -13
  150. data/spec/models/repository_version_response_spec.rb +14 -19
  151. data/spec/models/set_label_response_spec.rb +8 -13
  152. data/spec/models/set_label_spec.rb +8 -13
  153. data/spec/models/summary_response_spec.rb +9 -14
  154. data/spec/models/unset_label_response_spec.rb +8 -13
  155. data/spec/models/unset_label_spec.rb +7 -12
  156. data/spec/spec_helper.rb +1 -1
  157. metadata +81 -69
  158. data/docs/PackageUpload.md +0 -21
  159. data/docs/PythonBanderRemote.md +0 -21
  160. data/docs/PythonPythonPackageContent.md +0 -71
  161. data/docs/PythonPythonRemoteResponseHiddenFields.md +0 -19
  162. data/lib/pulp_python_client/models/package_upload.rb +0 -283
  163. data/lib/pulp_python_client/models/python_bander_remote.rb +0 -257
  164. data/lib/pulp_python_client/models/python_python_package_content.rb +0 -534
  165. data/spec/api_client_spec.rb +0 -188
  166. data/spec/configuration_spec.rb +0 -42
  167. data/spec/models/package_upload_spec.rb +0 -53
  168. data/spec/models/python_bander_remote_spec.rb +0 -53
  169. data/spec/models/python_python_package_content_spec.rb +0 -203
@@ -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 PulpPythonClient
16
17
  class PolicyEnum
@@ -18,6 +19,10 @@ module PulpPythonClient
18
19
  ON_DEMAND = "on_demand".freeze
19
20
  STREAMED = "streamed".freeze
20
21
 
22
+ def self.all_vars
23
+ @all_vars ||= [IMMEDIATE, ON_DEMAND, STREAMED].freeze
24
+ end
25
+
21
26
  # Builds the enum from string
22
27
  # @param [String] The enum value in the form of the string
23
28
  # @return [String] The enum value
@@ -29,9 +34,8 @@ module PulpPythonClient
29
34
  # @param [String] The enum value in the form of the string
30
35
  # @return [String] The enum value
31
36
  def build_from_hash(value)
32
- constantValues = PolicyEnum.constants.select { |c| PolicyEnum::const_get(c) == value }
33
- raise "Invalid ENUM value #{value} for class #PolicyEnum" if constantValues.empty?
34
- value
37
+ return value if PolicyEnum.all_vars.include?(value)
38
+ raise "Invalid ENUM value #{value} for class #PolicyEnum"
35
39
  end
36
40
  end
37
41
  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 PulpPythonClient
16
17
  # Serializer for Pulp distributions for the Python type.
@@ -56,6 +57,11 @@ module PulpPythonClient
56
57
  }
57
58
  end
58
59
 
60
+ # Returns all the JSON keys this model knows about
61
+ def self.acceptable_attributes
62
+ attribute_map.values
63
+ end
64
+
59
65
  # Attribute type mapping.
60
66
  def self.openapi_types
61
67
  {
@@ -98,6 +104,8 @@ module PulpPythonClient
98
104
 
99
105
  if attributes.key?(:'base_path')
100
106
  self.base_path = attributes[:'base_path']
107
+ else
108
+ self.base_path = nil
101
109
  end
102
110
 
103
111
  if attributes.key?(:'content_guard')
@@ -118,6 +126,8 @@ module PulpPythonClient
118
126
 
119
127
  if attributes.key?(:'name')
120
128
  self.name = attributes[:'name']
129
+ else
130
+ self.name = nil
121
131
  end
122
132
 
123
133
  if attributes.key?(:'repository')
@@ -142,6 +152,7 @@ module PulpPythonClient
142
152
  # Show invalid properties with the reasons. Usually used together with valid?
143
153
  # @return Array for valid properties with the reasons
144
154
  def list_invalid_properties
155
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
145
156
  invalid_properties = Array.new
146
157
  if @base_path.nil?
147
158
  invalid_properties.push('invalid value for "base_path", base_path cannot be nil.')
@@ -165,6 +176,7 @@ module PulpPythonClient
165
176
  # Check to see if the all the properties in the model are valid
166
177
  # @return true if the model is valid
167
178
  def valid?
179
+ warn '[DEPRECATED] the `valid?` method is obsolete'
168
180
  return false if @base_path.nil?
169
181
  return false if @base_path.to_s.length < 1
170
182
  return false if @name.nil?
@@ -232,37 +244,33 @@ module PulpPythonClient
232
244
  # @param [Hash] attributes Model attributes in the form of hash
233
245
  # @return [Object] Returns the model itself
234
246
  def self.build_from_hash(attributes)
235
- new.build_from_hash(attributes)
236
- end
237
-
238
- # Builds the object from hash
239
- # @param [Hash] attributes Model attributes in the form of hash
240
- # @return [Object] Returns the model itself
241
- def build_from_hash(attributes)
242
247
  return nil unless attributes.is_a?(Hash)
243
- self.class.openapi_types.each_pair do |key, type|
244
- if type =~ /\AArray<(.*)>/i
248
+ attributes = attributes.transform_keys(&:to_sym)
249
+ transformed_hash = {}
250
+ openapi_types.each_pair do |key, type|
251
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
252
+ transformed_hash["#{key}"] = nil
253
+ elsif type =~ /\AArray<(.*)>/i
245
254
  # check to ensure the input is an array given that the attribute
246
255
  # is documented as an array but the input is not
247
- if attributes[self.class.attribute_map[key]].is_a?(Array)
248
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
256
+ if attributes[attribute_map[key]].is_a?(Array)
257
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
249
258
  end
250
- elsif !attributes[self.class.attribute_map[key]].nil?
251
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
252
- end # or else data not found in attributes(hash), not an issue as the data can be optional
259
+ elsif !attributes[attribute_map[key]].nil?
260
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
261
+ end
253
262
  end
254
-
255
- self
263
+ new(transformed_hash)
256
264
  end
257
265
 
258
266
  # Deserializes the data based on type
259
267
  # @param string type Data type
260
268
  # @param string value Value to be deserialized
261
269
  # @return [Object] Deserialized data
262
- def _deserialize(type, value)
270
+ def self._deserialize(type, value)
263
271
  case type.to_sym
264
- when :DateTime
265
- DateTime.parse(value)
272
+ when :Time
273
+ Time.parse(value)
266
274
  when :Date
267
275
  Date.parse(value)
268
276
  when :String
@@ -292,7 +300,9 @@ module PulpPythonClient
292
300
  end
293
301
  end
294
302
  else # model
295
- PulpPythonClient.const_get(type).build_from_hash(value)
303
+ # models (e.g. Pet) or oneOf
304
+ klass = PulpPythonClient.const_get(type)
305
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
296
306
  end
297
307
  end
298
308
 
@@ -318,7 +328,7 @@ module PulpPythonClient
318
328
  is_nullable = self.class.openapi_nullable.include?(attr)
319
329
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
320
330
  end
321
-
331
+
322
332
  hash[param] = _to_hash(value)
323
333
  end
324
334
  hash
@@ -341,5 +351,7 @@ module PulpPythonClient
341
351
  value
342
352
  end
343
353
  end
354
+
344
355
  end
356
+
345
357
  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 PulpPythonClient
16
17
  # Serializer for Pulp distributions for the Python type.
@@ -78,13 +79,18 @@ module PulpPythonClient
78
79
  }
79
80
  end
80
81
 
82
+ # Returns all the JSON keys this model knows about
83
+ def self.acceptable_attributes
84
+ attribute_map.values
85
+ end
86
+
81
87
  # Attribute type mapping.
82
88
  def self.openapi_types
83
89
  {
84
90
  :'pulp_href' => :'String',
85
91
  :'prn' => :'String',
86
- :'pulp_created' => :'DateTime',
87
- :'pulp_last_updated' => :'DateTime',
92
+ :'pulp_created' => :'Time',
93
+ :'pulp_last_updated' => :'Time',
88
94
  :'base_path' => :'String',
89
95
  :'base_url' => :'String',
90
96
  :'content_guard' => :'String',
@@ -142,6 +148,8 @@ module PulpPythonClient
142
148
 
143
149
  if attributes.key?(:'base_path')
144
150
  self.base_path = attributes[:'base_path']
151
+ else
152
+ self.base_path = nil
145
153
  end
146
154
 
147
155
  if attributes.key?(:'base_url')
@@ -170,6 +178,8 @@ module PulpPythonClient
170
178
 
171
179
  if attributes.key?(:'name')
172
180
  self.name = attributes[:'name']
181
+ else
182
+ self.name = nil
173
183
  end
174
184
 
175
185
  if attributes.key?(:'repository')
@@ -194,6 +204,7 @@ module PulpPythonClient
194
204
  # Show invalid properties with the reasons. Usually used together with valid?
195
205
  # @return Array for valid properties with the reasons
196
206
  def list_invalid_properties
207
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
197
208
  invalid_properties = Array.new
198
209
  if @base_path.nil?
199
210
  invalid_properties.push('invalid value for "base_path", base_path cannot be nil.')
@@ -209,6 +220,7 @@ module PulpPythonClient
209
220
  # Check to see if the all the properties in the model are valid
210
221
  # @return true if the model is valid
211
222
  def valid?
223
+ warn '[DEPRECATED] the `valid?` method is obsolete'
212
224
  return false if @base_path.nil?
213
225
  return false if @name.nil?
214
226
  true
@@ -252,37 +264,33 @@ module PulpPythonClient
252
264
  # @param [Hash] attributes Model attributes in the form of hash
253
265
  # @return [Object] Returns the model itself
254
266
  def self.build_from_hash(attributes)
255
- new.build_from_hash(attributes)
256
- end
257
-
258
- # Builds the object from hash
259
- # @param [Hash] attributes Model attributes in the form of hash
260
- # @return [Object] Returns the model itself
261
- def build_from_hash(attributes)
262
267
  return nil unless attributes.is_a?(Hash)
263
- self.class.openapi_types.each_pair do |key, type|
264
- if type =~ /\AArray<(.*)>/i
268
+ attributes = attributes.transform_keys(&:to_sym)
269
+ transformed_hash = {}
270
+ openapi_types.each_pair do |key, type|
271
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
272
+ transformed_hash["#{key}"] = nil
273
+ elsif type =~ /\AArray<(.*)>/i
265
274
  # check to ensure the input is an array given that the attribute
266
275
  # is documented as an array but the input is not
267
- if attributes[self.class.attribute_map[key]].is_a?(Array)
268
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
276
+ if attributes[attribute_map[key]].is_a?(Array)
277
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
269
278
  end
270
- elsif !attributes[self.class.attribute_map[key]].nil?
271
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
272
- end # or else data not found in attributes(hash), not an issue as the data can be optional
279
+ elsif !attributes[attribute_map[key]].nil?
280
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
281
+ end
273
282
  end
274
-
275
- self
283
+ new(transformed_hash)
276
284
  end
277
285
 
278
286
  # Deserializes the data based on type
279
287
  # @param string type Data type
280
288
  # @param string value Value to be deserialized
281
289
  # @return [Object] Deserialized data
282
- def _deserialize(type, value)
290
+ def self._deserialize(type, value)
283
291
  case type.to_sym
284
- when :DateTime
285
- DateTime.parse(value)
292
+ when :Time
293
+ Time.parse(value)
286
294
  when :Date
287
295
  Date.parse(value)
288
296
  when :String
@@ -312,7 +320,9 @@ module PulpPythonClient
312
320
  end
313
321
  end
314
322
  else # model
315
- PulpPythonClient.const_get(type).build_from_hash(value)
323
+ # models (e.g. Pet) or oneOf
324
+ klass = PulpPythonClient.const_get(type)
325
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
316
326
  end
317
327
  end
318
328
 
@@ -338,7 +348,7 @@ module PulpPythonClient
338
348
  is_nullable = self.class.openapi_nullable.include?(attr)
339
349
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
340
350
  end
341
-
351
+
342
352
  hash[param] = _to_hash(value)
343
353
  end
344
354
  hash
@@ -361,5 +371,7 @@ module PulpPythonClient
361
371
  value
362
372
  end
363
373
  end
374
+
364
375
  end
376
+
365
377
  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 PulpPythonClient
16
17
  # A Serializer for PythonPackageContent.
@@ -148,13 +149,18 @@ module PulpPythonClient
148
149
  }
149
150
  end
150
151
 
152
+ # Returns all the JSON keys this model knows about
153
+ def self.acceptable_attributes
154
+ attribute_map.values
155
+ end
156
+
151
157
  # Attribute type mapping.
152
158
  def self.openapi_types
153
159
  {
154
160
  :'pulp_href' => :'String',
155
161
  :'prn' => :'String',
156
- :'pulp_created' => :'DateTime',
157
- :'pulp_last_updated' => :'DateTime',
162
+ :'pulp_created' => :'Time',
163
+ :'pulp_last_updated' => :'Time',
158
164
  :'artifact' => :'String',
159
165
  :'filename' => :'String',
160
166
  :'packagetype' => :'String',
@@ -189,6 +195,12 @@ module PulpPythonClient
189
195
  # List of attributes with nullable: true
190
196
  def self.openapi_nullable
191
197
  Set.new([
198
+ :'project_urls',
199
+ :'requires_dist',
200
+ :'provides_dist',
201
+ :'obsoletes_dist',
202
+ :'requires_external',
203
+ :'classifiers'
192
204
  ])
193
205
  end
194
206
 
@@ -341,6 +353,7 @@ module PulpPythonClient
341
353
  # Show invalid properties with the reasons. Usually used together with valid?
342
354
  # @return Array for valid properties with the reasons
343
355
  def list_invalid_properties
356
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
344
357
  invalid_properties = Array.new
345
358
  invalid_properties
346
359
  end
@@ -348,6 +361,7 @@ module PulpPythonClient
348
361
  # Check to see if the all the properties in the model are valid
349
362
  # @return true if the model is valid
350
363
  def valid?
364
+ warn '[DEPRECATED] the `valid?` method is obsolete'
351
365
  true
352
366
  end
353
367
 
@@ -406,37 +420,33 @@ module PulpPythonClient
406
420
  # @param [Hash] attributes Model attributes in the form of hash
407
421
  # @return [Object] Returns the model itself
408
422
  def self.build_from_hash(attributes)
409
- new.build_from_hash(attributes)
410
- end
411
-
412
- # Builds the object from hash
413
- # @param [Hash] attributes Model attributes in the form of hash
414
- # @return [Object] Returns the model itself
415
- def build_from_hash(attributes)
416
423
  return nil unless attributes.is_a?(Hash)
417
- self.class.openapi_types.each_pair do |key, type|
418
- if type =~ /\AArray<(.*)>/i
424
+ attributes = attributes.transform_keys(&:to_sym)
425
+ transformed_hash = {}
426
+ openapi_types.each_pair do |key, type|
427
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
428
+ transformed_hash["#{key}"] = nil
429
+ elsif type =~ /\AArray<(.*)>/i
419
430
  # check to ensure the input is an array given that the attribute
420
431
  # is documented as an array but the input is not
421
- if attributes[self.class.attribute_map[key]].is_a?(Array)
422
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
432
+ if attributes[attribute_map[key]].is_a?(Array)
433
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
423
434
  end
424
- elsif !attributes[self.class.attribute_map[key]].nil?
425
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
426
- end # or else data not found in attributes(hash), not an issue as the data can be optional
435
+ elsif !attributes[attribute_map[key]].nil?
436
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
437
+ end
427
438
  end
428
-
429
- self
439
+ new(transformed_hash)
430
440
  end
431
441
 
432
442
  # Deserializes the data based on type
433
443
  # @param string type Data type
434
444
  # @param string value Value to be deserialized
435
445
  # @return [Object] Deserialized data
436
- def _deserialize(type, value)
446
+ def self._deserialize(type, value)
437
447
  case type.to_sym
438
- when :DateTime
439
- DateTime.parse(value)
448
+ when :Time
449
+ Time.parse(value)
440
450
  when :Date
441
451
  Date.parse(value)
442
452
  when :String
@@ -466,7 +476,9 @@ module PulpPythonClient
466
476
  end
467
477
  end
468
478
  else # model
469
- PulpPythonClient.const_get(type).build_from_hash(value)
479
+ # models (e.g. Pet) or oneOf
480
+ klass = PulpPythonClient.const_get(type)
481
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
470
482
  end
471
483
  end
472
484
 
@@ -492,7 +504,7 @@ module PulpPythonClient
492
504
  is_nullable = self.class.openapi_nullable.include?(attr)
493
505
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
494
506
  end
495
-
507
+
496
508
  hash[param] = _to_hash(value)
497
509
  end
498
510
  hash
@@ -515,5 +527,7 @@ module PulpPythonClient
515
527
  value
516
528
  end
517
529
  end
530
+
518
531
  end
532
+
519
533
  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 PulpPythonClient
16
17
  # A Serializer for PythonPublication.
@@ -28,6 +29,11 @@ module PulpPythonClient
28
29
  }
29
30
  end
30
31
 
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
31
37
  # Attribute type mapping.
32
38
  def self.openapi_types
33
39
  {
@@ -69,6 +75,7 @@ module PulpPythonClient
69
75
  # Show invalid properties with the reasons. Usually used together with valid?
70
76
  # @return Array for valid properties with the reasons
71
77
  def list_invalid_properties
78
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
72
79
  invalid_properties = Array.new
73
80
  invalid_properties
74
81
  end
@@ -76,6 +83,7 @@ module PulpPythonClient
76
83
  # Check to see if the all the properties in the model are valid
77
84
  # @return true if the model is valid
78
85
  def valid?
86
+ warn '[DEPRECATED] the `valid?` method is obsolete'
79
87
  true
80
88
  end
81
89
 
@@ -104,37 +112,33 @@ module PulpPythonClient
104
112
  # @param [Hash] attributes Model attributes in the form of hash
105
113
  # @return [Object] Returns the model itself
106
114
  def self.build_from_hash(attributes)
107
- new.build_from_hash(attributes)
108
- end
109
-
110
- # Builds the object from hash
111
- # @param [Hash] attributes Model attributes in the form of hash
112
- # @return [Object] Returns the model itself
113
- def build_from_hash(attributes)
114
115
  return nil unless attributes.is_a?(Hash)
115
- self.class.openapi_types.each_pair do |key, type|
116
- if type =~ /\AArray<(.*)>/i
116
+ attributes = attributes.transform_keys(&:to_sym)
117
+ transformed_hash = {}
118
+ openapi_types.each_pair do |key, type|
119
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
120
+ transformed_hash["#{key}"] = nil
121
+ elsif type =~ /\AArray<(.*)>/i
117
122
  # check to ensure the input is an array given that the attribute
118
123
  # is documented as an array but the input is not
119
- if attributes[self.class.attribute_map[key]].is_a?(Array)
120
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
124
+ if attributes[attribute_map[key]].is_a?(Array)
125
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
121
126
  end
122
- elsif !attributes[self.class.attribute_map[key]].nil?
123
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
124
- end # or else data not found in attributes(hash), not an issue as the data can be optional
127
+ elsif !attributes[attribute_map[key]].nil?
128
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
129
+ end
125
130
  end
126
-
127
- self
131
+ new(transformed_hash)
128
132
  end
129
133
 
130
134
  # Deserializes the data based on type
131
135
  # @param string type Data type
132
136
  # @param string value Value to be deserialized
133
137
  # @return [Object] Deserialized data
134
- def _deserialize(type, value)
138
+ def self._deserialize(type, value)
135
139
  case type.to_sym
136
- when :DateTime
137
- DateTime.parse(value)
140
+ when :Time
141
+ Time.parse(value)
138
142
  when :Date
139
143
  Date.parse(value)
140
144
  when :String
@@ -164,7 +168,9 @@ module PulpPythonClient
164
168
  end
165
169
  end
166
170
  else # model
167
- PulpPythonClient.const_get(type).build_from_hash(value)
171
+ # models (e.g. Pet) or oneOf
172
+ klass = PulpPythonClient.const_get(type)
173
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
168
174
  end
169
175
  end
170
176
 
@@ -190,7 +196,7 @@ module PulpPythonClient
190
196
  is_nullable = self.class.openapi_nullable.include?(attr)
191
197
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
192
198
  end
193
-
199
+
194
200
  hash[param] = _to_hash(value)
195
201
  end
196
202
  hash
@@ -213,5 +219,7 @@ module PulpPythonClient
213
219
  value
214
220
  end
215
221
  end
222
+
216
223
  end
224
+
217
225
  end