pulp_python_client 3.12.5 → 3.13.0

Sign up to get free protection for your applications and to get access to all the features.
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
  # A mixin for validating unknown serializers' fields.
@@ -29,6 +30,11 @@ module PulpPythonClient
29
30
  }
30
31
  end
31
32
 
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
32
38
  # Attribute type mapping.
33
39
  def self.openapi_types
34
40
  {
@@ -72,6 +78,7 @@ module PulpPythonClient
72
78
  # Show invalid properties with the reasons. Usually used together with valid?
73
79
  # @return Array for valid properties with the reasons
74
80
  def list_invalid_properties
81
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
75
82
  invalid_properties = Array.new
76
83
  invalid_properties
77
84
  end
@@ -79,6 +86,7 @@ module PulpPythonClient
79
86
  # Check to see if the all the properties in the model are valid
80
87
  # @return true if the model is valid
81
88
  def valid?
89
+ warn '[DEPRECATED] the `valid?` method is obsolete'
82
90
  true
83
91
  end
84
92
 
@@ -107,37 +115,33 @@ module PulpPythonClient
107
115
  # @param [Hash] attributes Model attributes in the form of hash
108
116
  # @return [Object] Returns the model itself
109
117
  def self.build_from_hash(attributes)
110
- new.build_from_hash(attributes)
111
- end
112
-
113
- # Builds the object from hash
114
- # @param [Hash] attributes Model attributes in the form of hash
115
- # @return [Object] Returns the model itself
116
- def build_from_hash(attributes)
117
118
  return nil unless attributes.is_a?(Hash)
118
- self.class.openapi_types.each_pair do |key, type|
119
- if type =~ /\AArray<(.*)>/i
119
+ attributes = attributes.transform_keys(&:to_sym)
120
+ transformed_hash = {}
121
+ openapi_types.each_pair do |key, type|
122
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
123
+ transformed_hash["#{key}"] = nil
124
+ elsif type =~ /\AArray<(.*)>/i
120
125
  # check to ensure the input is an array given that the attribute
121
126
  # is documented as an array but the input is not
122
- if attributes[self.class.attribute_map[key]].is_a?(Array)
123
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
127
+ if attributes[attribute_map[key]].is_a?(Array)
128
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
124
129
  end
125
- elsif !attributes[self.class.attribute_map[key]].nil?
126
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
127
- end # or else data not found in attributes(hash), not an issue as the data can be optional
130
+ elsif !attributes[attribute_map[key]].nil?
131
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
132
+ end
128
133
  end
129
-
130
- self
134
+ new(transformed_hash)
131
135
  end
132
136
 
133
137
  # Deserializes the data based on type
134
138
  # @param string type Data type
135
139
  # @param string value Value to be deserialized
136
140
  # @return [Object] Deserialized data
137
- def _deserialize(type, value)
141
+ def self._deserialize(type, value)
138
142
  case type.to_sym
139
- when :DateTime
140
- DateTime.parse(value)
143
+ when :Time
144
+ Time.parse(value)
141
145
  when :Date
142
146
  Date.parse(value)
143
147
  when :String
@@ -167,7 +171,9 @@ module PulpPythonClient
167
171
  end
168
172
  end
169
173
  else # model
170
- PulpPythonClient.const_get(type).build_from_hash(value)
174
+ # models (e.g. Pet) or oneOf
175
+ klass = PulpPythonClient.const_get(type)
176
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
171
177
  end
172
178
  end
173
179
 
@@ -193,7 +199,7 @@ module PulpPythonClient
193
199
  is_nullable = self.class.openapi_nullable.include?(attr)
194
200
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
195
201
  end
196
-
202
+
197
203
  hash[param] = _to_hash(value)
198
204
  end
199
205
  hash
@@ -216,5 +222,7 @@ module PulpPythonClient
216
222
  value
217
223
  end
218
224
  end
225
+
219
226
  end
227
+
220
228
  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
  # Base serializer for use with [pulpcore.app.models.Model][] This ensures that all Serializers provide values for the 'pulp_href` field. The class provides a default for the ``ref_name`` attribute in the ModelSerializers's ``Meta`` class. This ensures that the OpenAPI definitions of plugins are namespaced properly.
@@ -50,13 +51,18 @@ module PulpPythonClient
50
51
  }
51
52
  end
52
53
 
54
+ # Returns all the JSON keys this model knows about
55
+ def self.acceptable_attributes
56
+ attribute_map.values
57
+ end
58
+
53
59
  # Attribute type mapping.
54
60
  def self.openapi_types
55
61
  {
56
62
  :'pulp_href' => :'String',
57
63
  :'prn' => :'String',
58
- :'pulp_created' => :'DateTime',
59
- :'pulp_last_updated' => :'DateTime',
64
+ :'pulp_created' => :'Time',
65
+ :'pulp_last_updated' => :'Time',
60
66
  :'number' => :'Integer',
61
67
  :'repository' => :'String',
62
68
  :'base_version' => :'String',
@@ -121,6 +127,7 @@ module PulpPythonClient
121
127
  # Show invalid properties with the reasons. Usually used together with valid?
122
128
  # @return Array for valid properties with the reasons
123
129
  def list_invalid_properties
130
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
124
131
  invalid_properties = Array.new
125
132
  invalid_properties
126
133
  end
@@ -128,6 +135,7 @@ module PulpPythonClient
128
135
  # Check to see if the all the properties in the model are valid
129
136
  # @return true if the model is valid
130
137
  def valid?
138
+ warn '[DEPRECATED] the `valid?` method is obsolete'
131
139
  true
132
140
  end
133
141
 
@@ -162,37 +170,33 @@ module PulpPythonClient
162
170
  # @param [Hash] attributes Model attributes in the form of hash
163
171
  # @return [Object] Returns the model itself
164
172
  def self.build_from_hash(attributes)
165
- new.build_from_hash(attributes)
166
- end
167
-
168
- # Builds the object from hash
169
- # @param [Hash] attributes Model attributes in the form of hash
170
- # @return [Object] Returns the model itself
171
- def build_from_hash(attributes)
172
173
  return nil unless attributes.is_a?(Hash)
173
- self.class.openapi_types.each_pair do |key, type|
174
- if type =~ /\AArray<(.*)>/i
174
+ attributes = attributes.transform_keys(&:to_sym)
175
+ transformed_hash = {}
176
+ openapi_types.each_pair do |key, type|
177
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
178
+ transformed_hash["#{key}"] = nil
179
+ elsif type =~ /\AArray<(.*)>/i
175
180
  # check to ensure the input is an array given that the attribute
176
181
  # is documented as an array but the input is not
177
- if attributes[self.class.attribute_map[key]].is_a?(Array)
178
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
182
+ if attributes[attribute_map[key]].is_a?(Array)
183
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
179
184
  end
180
- elsif !attributes[self.class.attribute_map[key]].nil?
181
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
182
- end # or else data not found in attributes(hash), not an issue as the data can be optional
185
+ elsif !attributes[attribute_map[key]].nil?
186
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
187
+ end
183
188
  end
184
-
185
- self
189
+ new(transformed_hash)
186
190
  end
187
191
 
188
192
  # Deserializes the data based on type
189
193
  # @param string type Data type
190
194
  # @param string value Value to be deserialized
191
195
  # @return [Object] Deserialized data
192
- def _deserialize(type, value)
196
+ def self._deserialize(type, value)
193
197
  case type.to_sym
194
- when :DateTime
195
- DateTime.parse(value)
198
+ when :Time
199
+ Time.parse(value)
196
200
  when :Date
197
201
  Date.parse(value)
198
202
  when :String
@@ -222,7 +226,9 @@ module PulpPythonClient
222
226
  end
223
227
  end
224
228
  else # model
225
- PulpPythonClient.const_get(type).build_from_hash(value)
229
+ # models (e.g. Pet) or oneOf
230
+ klass = PulpPythonClient.const_get(type)
231
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
226
232
  end
227
233
  end
228
234
 
@@ -248,7 +254,7 @@ module PulpPythonClient
248
254
  is_nullable = self.class.openapi_nullable.include?(attr)
249
255
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
250
256
  end
251
-
257
+
252
258
  hash[param] = _to_hash(value)
253
259
  end
254
260
  hash
@@ -271,5 +277,7 @@ module PulpPythonClient
271
277
  value
272
278
  end
273
279
  end
280
+
274
281
  end
282
+
275
283
  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 synchronously setting a label.
@@ -27,6 +28,11 @@ module PulpPythonClient
27
28
  }
28
29
  end
29
30
 
31
+ # Returns all the JSON keys this model knows about
32
+ def self.acceptable_attributes
33
+ attribute_map.values
34
+ end
35
+
30
36
  # Attribute type mapping.
31
37
  def self.openapi_types
32
38
  {
@@ -59,16 +65,21 @@ module PulpPythonClient
59
65
 
60
66
  if attributes.key?(:'key')
61
67
  self.key = attributes[:'key']
68
+ else
69
+ self.key = nil
62
70
  end
63
71
 
64
72
  if attributes.key?(:'value')
65
73
  self.value = attributes[:'value']
74
+ else
75
+ self.value = nil
66
76
  end
67
77
  end
68
78
 
69
79
  # Show invalid properties with the reasons. Usually used together with valid?
70
80
  # @return Array for valid properties with the reasons
71
81
  def list_invalid_properties
82
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
72
83
  invalid_properties = Array.new
73
84
  if @key.nil?
74
85
  invalid_properties.push('invalid value for "key", key cannot be nil.')
@@ -89,6 +100,7 @@ module PulpPythonClient
89
100
  # Check to see if the all the properties in the model are valid
90
101
  # @return true if the model is valid
91
102
  def valid?
103
+ warn '[DEPRECATED] the `valid?` method is obsolete'
92
104
  return false if @key.nil?
93
105
  return false if @key.to_s.length < 1
94
106
  return false if @key !~ Regexp.new(/^[-a-zA-Z0-9_]+$/)
@@ -139,37 +151,33 @@ module PulpPythonClient
139
151
  # @param [Hash] attributes Model attributes in the form of hash
140
152
  # @return [Object] Returns the model itself
141
153
  def self.build_from_hash(attributes)
142
- new.build_from_hash(attributes)
143
- end
144
-
145
- # Builds the object from hash
146
- # @param [Hash] attributes Model attributes in the form of hash
147
- # @return [Object] Returns the model itself
148
- def build_from_hash(attributes)
149
154
  return nil unless attributes.is_a?(Hash)
150
- self.class.openapi_types.each_pair do |key, type|
151
- if type =~ /\AArray<(.*)>/i
155
+ attributes = attributes.transform_keys(&:to_sym)
156
+ transformed_hash = {}
157
+ openapi_types.each_pair do |key, type|
158
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
159
+ transformed_hash["#{key}"] = nil
160
+ elsif type =~ /\AArray<(.*)>/i
152
161
  # check to ensure the input is an array given that the attribute
153
162
  # is documented as an array but the input is not
154
- if attributes[self.class.attribute_map[key]].is_a?(Array)
155
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
163
+ if attributes[attribute_map[key]].is_a?(Array)
164
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
156
165
  end
157
- elsif !attributes[self.class.attribute_map[key]].nil?
158
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
159
- end # or else data not found in attributes(hash), not an issue as the data can be optional
166
+ elsif !attributes[attribute_map[key]].nil?
167
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
168
+ end
160
169
  end
161
-
162
- self
170
+ new(transformed_hash)
163
171
  end
164
172
 
165
173
  # Deserializes the data based on type
166
174
  # @param string type Data type
167
175
  # @param string value Value to be deserialized
168
176
  # @return [Object] Deserialized data
169
- def _deserialize(type, value)
177
+ def self._deserialize(type, value)
170
178
  case type.to_sym
171
- when :DateTime
172
- DateTime.parse(value)
179
+ when :Time
180
+ Time.parse(value)
173
181
  when :Date
174
182
  Date.parse(value)
175
183
  when :String
@@ -199,7 +207,9 @@ module PulpPythonClient
199
207
  end
200
208
  end
201
209
  else # model
202
- PulpPythonClient.const_get(type).build_from_hash(value)
210
+ # models (e.g. Pet) or oneOf
211
+ klass = PulpPythonClient.const_get(type)
212
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
203
213
  end
204
214
  end
205
215
 
@@ -225,7 +235,7 @@ module PulpPythonClient
225
235
  is_nullable = self.class.openapi_nullable.include?(attr)
226
236
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
227
237
  end
228
-
238
+
229
239
  hash[param] = _to_hash(value)
230
240
  end
231
241
  hash
@@ -248,5 +258,7 @@ module PulpPythonClient
248
258
  value
249
259
  end
250
260
  end
261
+
251
262
  end
263
+
252
264
  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 synchronously setting a label.
@@ -27,6 +28,11 @@ module PulpPythonClient
27
28
  }
28
29
  end
29
30
 
31
+ # Returns all the JSON keys this model knows about
32
+ def self.acceptable_attributes
33
+ attribute_map.values
34
+ end
35
+
30
36
  # Attribute type mapping.
31
37
  def self.openapi_types
32
38
  {
@@ -59,16 +65,21 @@ module PulpPythonClient
59
65
 
60
66
  if attributes.key?(:'key')
61
67
  self.key = attributes[:'key']
68
+ else
69
+ self.key = nil
62
70
  end
63
71
 
64
72
  if attributes.key?(:'value')
65
73
  self.value = attributes[:'value']
74
+ else
75
+ self.value = nil
66
76
  end
67
77
  end
68
78
 
69
79
  # Show invalid properties with the reasons. Usually used together with valid?
70
80
  # @return Array for valid properties with the reasons
71
81
  def list_invalid_properties
82
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
72
83
  invalid_properties = Array.new
73
84
  if @key.nil?
74
85
  invalid_properties.push('invalid value for "key", key cannot be nil.')
@@ -85,6 +96,7 @@ module PulpPythonClient
85
96
  # Check to see if the all the properties in the model are valid
86
97
  # @return true if the model is valid
87
98
  def valid?
99
+ warn '[DEPRECATED] the `valid?` method is obsolete'
88
100
  return false if @key.nil?
89
101
  return false if @key !~ Regexp.new(/^[-a-zA-Z0-9_]+$/)
90
102
  true
@@ -130,37 +142,33 @@ module PulpPythonClient
130
142
  # @param [Hash] attributes Model attributes in the form of hash
131
143
  # @return [Object] Returns the model itself
132
144
  def self.build_from_hash(attributes)
133
- new.build_from_hash(attributes)
134
- end
135
-
136
- # Builds the object from hash
137
- # @param [Hash] attributes Model attributes in the form of hash
138
- # @return [Object] Returns the model itself
139
- def build_from_hash(attributes)
140
145
  return nil unless attributes.is_a?(Hash)
141
- self.class.openapi_types.each_pair do |key, type|
142
- if type =~ /\AArray<(.*)>/i
146
+ attributes = attributes.transform_keys(&:to_sym)
147
+ transformed_hash = {}
148
+ openapi_types.each_pair do |key, type|
149
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
150
+ transformed_hash["#{key}"] = nil
151
+ elsif type =~ /\AArray<(.*)>/i
143
152
  # check to ensure the input is an array given that the attribute
144
153
  # is documented as an array but the input is not
145
- if attributes[self.class.attribute_map[key]].is_a?(Array)
146
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
154
+ if attributes[attribute_map[key]].is_a?(Array)
155
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
147
156
  end
148
- elsif !attributes[self.class.attribute_map[key]].nil?
149
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
150
- end # or else data not found in attributes(hash), not an issue as the data can be optional
157
+ elsif !attributes[attribute_map[key]].nil?
158
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
159
+ end
151
160
  end
152
-
153
- self
161
+ new(transformed_hash)
154
162
  end
155
163
 
156
164
  # Deserializes the data based on type
157
165
  # @param string type Data type
158
166
  # @param string value Value to be deserialized
159
167
  # @return [Object] Deserialized data
160
- def _deserialize(type, value)
168
+ def self._deserialize(type, value)
161
169
  case type.to_sym
162
- when :DateTime
163
- DateTime.parse(value)
170
+ when :Time
171
+ Time.parse(value)
164
172
  when :Date
165
173
  Date.parse(value)
166
174
  when :String
@@ -190,7 +198,9 @@ module PulpPythonClient
190
198
  end
191
199
  end
192
200
  else # model
193
- PulpPythonClient.const_get(type).build_from_hash(value)
201
+ # models (e.g. Pet) or oneOf
202
+ klass = PulpPythonClient.const_get(type)
203
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
194
204
  end
195
205
  end
196
206
 
@@ -216,7 +226,7 @@ module PulpPythonClient
216
226
  is_nullable = self.class.openapi_nullable.include?(attr)
217
227
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
218
228
  end
219
-
229
+
220
230
  hash[param] = _to_hash(value)
221
231
  end
222
232
  hash
@@ -239,5 +249,7 @@ module PulpPythonClient
239
249
  value
240
250
  end
241
251
  end
252
+
242
253
  end
254
+
243
255
  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 summary information of an index.
@@ -33,6 +34,11 @@ module PulpPythonClient
33
34
  }
34
35
  end
35
36
 
37
+ # Returns all the JSON keys this model knows about
38
+ def self.acceptable_attributes
39
+ attribute_map.values
40
+ end
41
+
36
42
  # Attribute type mapping.
37
43
  def self.openapi_types
38
44
  {
@@ -65,20 +71,27 @@ module PulpPythonClient
65
71
 
66
72
  if attributes.key?(:'projects')
67
73
  self.projects = attributes[:'projects']
74
+ else
75
+ self.projects = nil
68
76
  end
69
77
 
70
78
  if attributes.key?(:'releases')
71
79
  self.releases = attributes[:'releases']
80
+ else
81
+ self.releases = nil
72
82
  end
73
83
 
74
84
  if attributes.key?(:'files')
75
85
  self.files = attributes[:'files']
86
+ else
87
+ self.files = nil
76
88
  end
77
89
  end
78
90
 
79
91
  # Show invalid properties with the reasons. Usually used together with valid?
80
92
  # @return Array for valid properties with the reasons
81
93
  def list_invalid_properties
94
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
82
95
  invalid_properties = Array.new
83
96
  if @projects.nil?
84
97
  invalid_properties.push('invalid value for "projects", projects cannot be nil.')
@@ -98,6 +111,7 @@ module PulpPythonClient
98
111
  # Check to see if the all the properties in the model are valid
99
112
  # @return true if the model is valid
100
113
  def valid?
114
+ warn '[DEPRECATED] the `valid?` method is obsolete'
101
115
  return false if @projects.nil?
102
116
  return false if @releases.nil?
103
117
  return false if @files.nil?
@@ -130,37 +144,33 @@ module PulpPythonClient
130
144
  # @param [Hash] attributes Model attributes in the form of hash
131
145
  # @return [Object] Returns the model itself
132
146
  def self.build_from_hash(attributes)
133
- new.build_from_hash(attributes)
134
- end
135
-
136
- # Builds the object from hash
137
- # @param [Hash] attributes Model attributes in the form of hash
138
- # @return [Object] Returns the model itself
139
- def build_from_hash(attributes)
140
147
  return nil unless attributes.is_a?(Hash)
141
- self.class.openapi_types.each_pair do |key, type|
142
- 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
143
154
  # check to ensure the input is an array given that the attribute
144
155
  # is documented as an array but the input is not
145
- if attributes[self.class.attribute_map[key]].is_a?(Array)
146
- 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) }
147
158
  end
148
- elsif !attributes[self.class.attribute_map[key]].nil?
149
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
150
- 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
151
162
  end
152
-
153
- self
163
+ new(transformed_hash)
154
164
  end
155
165
 
156
166
  # Deserializes the data based on type
157
167
  # @param string type Data type
158
168
  # @param string value Value to be deserialized
159
169
  # @return [Object] Deserialized data
160
- def _deserialize(type, value)
170
+ def self._deserialize(type, value)
161
171
  case type.to_sym
162
- when :DateTime
163
- DateTime.parse(value)
172
+ when :Time
173
+ Time.parse(value)
164
174
  when :Date
165
175
  Date.parse(value)
166
176
  when :String
@@ -190,7 +200,9 @@ module PulpPythonClient
190
200
  end
191
201
  end
192
202
  else # model
193
- PulpPythonClient.const_get(type).build_from_hash(value)
203
+ # models (e.g. Pet) or oneOf
204
+ klass = PulpPythonClient.const_get(type)
205
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
194
206
  end
195
207
  end
196
208
 
@@ -216,7 +228,7 @@ module PulpPythonClient
216
228
  is_nullable = self.class.openapi_nullable.include?(attr)
217
229
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
218
230
  end
219
-
231
+
220
232
  hash[param] = _to_hash(value)
221
233
  end
222
234
  hash
@@ -239,5 +251,7 @@ module PulpPythonClient
239
251
  value
240
252
  end
241
253
  end
254
+
242
255
  end
256
+
243
257
  end