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
  # Serializer to add/remove object roles to/from users/groups. This is used in conjunction with ``pulpcore.app.viewsets.base.RolesMixin`` and requires the underlying object to be passed as ``content_object`` in the context.
@@ -30,6 +31,11 @@ module PulpPythonClient
30
31
  }
31
32
  end
32
33
 
34
+ # Returns all the JSON keys this model knows about
35
+ def self.acceptable_attributes
36
+ attribute_map.values
37
+ end
38
+
33
39
  # Attribute type mapping.
34
40
  def self.openapi_types
35
41
  {
@@ -74,12 +80,15 @@ module PulpPythonClient
74
80
 
75
81
  if attributes.key?(:'role')
76
82
  self.role = attributes[:'role']
83
+ else
84
+ self.role = nil
77
85
  end
78
86
  end
79
87
 
80
88
  # Show invalid properties with the reasons. Usually used together with valid?
81
89
  # @return Array for valid properties with the reasons
82
90
  def list_invalid_properties
91
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
83
92
  invalid_properties = Array.new
84
93
  if @role.nil?
85
94
  invalid_properties.push('invalid value for "role", role cannot be nil.')
@@ -91,6 +100,7 @@ module PulpPythonClient
91
100
  # Check to see if the all the properties in the model are valid
92
101
  # @return true if the model is valid
93
102
  def valid?
103
+ warn '[DEPRECATED] the `valid?` method is obsolete'
94
104
  return false if @role.nil?
95
105
  true
96
106
  end
@@ -121,37 +131,33 @@ module PulpPythonClient
121
131
  # @param [Hash] attributes Model attributes in the form of hash
122
132
  # @return [Object] Returns the model itself
123
133
  def self.build_from_hash(attributes)
124
- new.build_from_hash(attributes)
125
- end
126
-
127
- # Builds the object from hash
128
- # @param [Hash] attributes Model attributes in the form of hash
129
- # @return [Object] Returns the model itself
130
- def build_from_hash(attributes)
131
134
  return nil unless attributes.is_a?(Hash)
132
- self.class.openapi_types.each_pair do |key, type|
133
- if type =~ /\AArray<(.*)>/i
135
+ attributes = attributes.transform_keys(&:to_sym)
136
+ transformed_hash = {}
137
+ openapi_types.each_pair do |key, type|
138
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
139
+ transformed_hash["#{key}"] = nil
140
+ elsif type =~ /\AArray<(.*)>/i
134
141
  # check to ensure the input is an array given that the attribute
135
142
  # is documented as an array but the input is not
136
- if attributes[self.class.attribute_map[key]].is_a?(Array)
137
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
143
+ if attributes[attribute_map[key]].is_a?(Array)
144
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
138
145
  end
139
- elsif !attributes[self.class.attribute_map[key]].nil?
140
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
141
- end # or else data not found in attributes(hash), not an issue as the data can be optional
146
+ elsif !attributes[attribute_map[key]].nil?
147
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
148
+ end
142
149
  end
143
-
144
- self
150
+ new(transformed_hash)
145
151
  end
146
152
 
147
153
  # Deserializes the data based on type
148
154
  # @param string type Data type
149
155
  # @param string value Value to be deserialized
150
156
  # @return [Object] Deserialized data
151
- def _deserialize(type, value)
157
+ def self._deserialize(type, value)
152
158
  case type.to_sym
153
- when :DateTime
154
- DateTime.parse(value)
159
+ when :Time
160
+ Time.parse(value)
155
161
  when :Date
156
162
  Date.parse(value)
157
163
  when :String
@@ -181,7 +187,9 @@ module PulpPythonClient
181
187
  end
182
188
  end
183
189
  else # model
184
- PulpPythonClient.const_get(type).build_from_hash(value)
190
+ # models (e.g. Pet) or oneOf
191
+ klass = PulpPythonClient.const_get(type)
192
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
185
193
  end
186
194
  end
187
195
 
@@ -207,7 +215,7 @@ module PulpPythonClient
207
215
  is_nullable = self.class.openapi_nullable.include?(attr)
208
216
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
209
217
  end
210
-
218
+
211
219
  hash[param] = _to_hash(value)
212
220
  end
213
221
  hash
@@ -230,5 +238,7 @@ module PulpPythonClient
230
238
  value
231
239
  end
232
240
  end
241
+
233
242
  end
243
+
234
244
  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
  class ObjectRolesResponse
@@ -23,6 +24,11 @@ module PulpPythonClient
23
24
  }
24
25
  end
25
26
 
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
26
32
  # Attribute type mapping.
27
33
  def self.openapi_types
28
34
  {
@@ -55,12 +61,15 @@ module PulpPythonClient
55
61
  if (value = attributes[:'roles']).is_a?(Array)
56
62
  self.roles = value
57
63
  end
64
+ else
65
+ self.roles = nil
58
66
  end
59
67
  end
60
68
 
61
69
  # Show invalid properties with the reasons. Usually used together with valid?
62
70
  # @return Array for valid properties with the reasons
63
71
  def list_invalid_properties
72
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
64
73
  invalid_properties = Array.new
65
74
  if @roles.nil?
66
75
  invalid_properties.push('invalid value for "roles", roles cannot be nil.')
@@ -72,6 +81,7 @@ module PulpPythonClient
72
81
  # Check to see if the all the properties in the model are valid
73
82
  # @return true if the model is valid
74
83
  def valid?
84
+ warn '[DEPRECATED] the `valid?` method is obsolete'
75
85
  return false if @roles.nil?
76
86
  true
77
87
  end
@@ -100,37 +110,33 @@ module PulpPythonClient
100
110
  # @param [Hash] attributes Model attributes in the form of hash
101
111
  # @return [Object] Returns the model itself
102
112
  def self.build_from_hash(attributes)
103
- new.build_from_hash(attributes)
104
- end
105
-
106
- # Builds the object from hash
107
- # @param [Hash] attributes Model attributes in the form of hash
108
- # @return [Object] Returns the model itself
109
- def build_from_hash(attributes)
110
113
  return nil unless attributes.is_a?(Hash)
111
- self.class.openapi_types.each_pair do |key, type|
112
- if type =~ /\AArray<(.*)>/i
114
+ attributes = attributes.transform_keys(&:to_sym)
115
+ transformed_hash = {}
116
+ openapi_types.each_pair do |key, type|
117
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
118
+ transformed_hash["#{key}"] = nil
119
+ elsif type =~ /\AArray<(.*)>/i
113
120
  # check to ensure the input is an array given that the attribute
114
121
  # is documented as an array but the input is not
115
- if attributes[self.class.attribute_map[key]].is_a?(Array)
116
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
122
+ if attributes[attribute_map[key]].is_a?(Array)
123
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
117
124
  end
118
- elsif !attributes[self.class.attribute_map[key]].nil?
119
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
120
- end # or else data not found in attributes(hash), not an issue as the data can be optional
125
+ elsif !attributes[attribute_map[key]].nil?
126
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
127
+ end
121
128
  end
122
-
123
- self
129
+ new(transformed_hash)
124
130
  end
125
131
 
126
132
  # Deserializes the data based on type
127
133
  # @param string type Data type
128
134
  # @param string value Value to be deserialized
129
135
  # @return [Object] Deserialized data
130
- def _deserialize(type, value)
136
+ def self._deserialize(type, value)
131
137
  case type.to_sym
132
- when :DateTime
133
- DateTime.parse(value)
138
+ when :Time
139
+ Time.parse(value)
134
140
  when :Date
135
141
  Date.parse(value)
136
142
  when :String
@@ -160,7 +166,9 @@ module PulpPythonClient
160
166
  end
161
167
  end
162
168
  else # model
163
- PulpPythonClient.const_get(type).build_from_hash(value)
169
+ # models (e.g. Pet) or oneOf
170
+ klass = PulpPythonClient.const_get(type)
171
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
164
172
  end
165
173
  end
166
174
 
@@ -186,7 +194,7 @@ module PulpPythonClient
186
194
  is_nullable = self.class.openapi_nullable.include?(attr)
187
195
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
188
196
  end
189
-
197
+
190
198
  hash[param] = _to_hash(value)
191
199
  end
192
200
  hash
@@ -209,5 +217,7 @@ module PulpPythonClient
209
217
  value
210
218
  end
211
219
  end
220
+
212
221
  end
222
+
213
223
  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 a package's metadata.
@@ -36,6 +37,11 @@ module PulpPythonClient
36
37
  }
37
38
  end
38
39
 
40
+ # Returns all the JSON keys this model knows about
41
+ def self.acceptable_attributes
42
+ attribute_map.values
43
+ end
44
+
39
45
  # Attribute type mapping.
40
46
  def self.openapi_types
41
47
  {
@@ -49,6 +55,9 @@ module PulpPythonClient
49
55
  # List of attributes with nullable: true
50
56
  def self.openapi_nullable
51
57
  Set.new([
58
+ :'info',
59
+ :'releases',
60
+ :'urls'
52
61
  ])
53
62
  end
54
63
 
@@ -69,51 +78,46 @@ module PulpPythonClient
69
78
 
70
79
  if attributes.key?(:'last_serial')
71
80
  self.last_serial = attributes[:'last_serial']
81
+ else
82
+ self.last_serial = nil
72
83
  end
73
84
 
74
85
  if attributes.key?(:'info')
75
86
  self.info = attributes[:'info']
87
+ else
88
+ self.info = nil
76
89
  end
77
90
 
78
91
  if attributes.key?(:'releases')
79
92
  self.releases = attributes[:'releases']
93
+ else
94
+ self.releases = nil
80
95
  end
81
96
 
82
97
  if attributes.key?(:'urls')
83
98
  self.urls = attributes[:'urls']
99
+ else
100
+ self.urls = nil
84
101
  end
85
102
  end
86
103
 
87
104
  # Show invalid properties with the reasons. Usually used together with valid?
88
105
  # @return Array for valid properties with the reasons
89
106
  def list_invalid_properties
107
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
90
108
  invalid_properties = Array.new
91
109
  if @last_serial.nil?
92
110
  invalid_properties.push('invalid value for "last_serial", last_serial cannot be nil.')
93
111
  end
94
112
 
95
- if @info.nil?
96
- invalid_properties.push('invalid value for "info", info cannot be nil.')
97
- end
98
-
99
- if @releases.nil?
100
- invalid_properties.push('invalid value for "releases", releases cannot be nil.')
101
- end
102
-
103
- if @urls.nil?
104
- invalid_properties.push('invalid value for "urls", urls cannot be nil.')
105
- end
106
-
107
113
  invalid_properties
108
114
  end
109
115
 
110
116
  # Check to see if the all the properties in the model are valid
111
117
  # @return true if the model is valid
112
118
  def valid?
119
+ warn '[DEPRECATED] the `valid?` method is obsolete'
113
120
  return false if @last_serial.nil?
114
- return false if @info.nil?
115
- return false if @releases.nil?
116
- return false if @urls.nil?
117
121
  true
118
122
  end
119
123
 
@@ -144,37 +148,33 @@ module PulpPythonClient
144
148
  # @param [Hash] attributes Model attributes in the form of hash
145
149
  # @return [Object] Returns the model itself
146
150
  def self.build_from_hash(attributes)
147
- new.build_from_hash(attributes)
148
- end
149
-
150
- # Builds the object from hash
151
- # @param [Hash] attributes Model attributes in the form of hash
152
- # @return [Object] Returns the model itself
153
- def build_from_hash(attributes)
154
151
  return nil unless attributes.is_a?(Hash)
155
- self.class.openapi_types.each_pair do |key, type|
156
- if type =~ /\AArray<(.*)>/i
152
+ attributes = attributes.transform_keys(&:to_sym)
153
+ transformed_hash = {}
154
+ openapi_types.each_pair do |key, type|
155
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
156
+ transformed_hash["#{key}"] = nil
157
+ elsif type =~ /\AArray<(.*)>/i
157
158
  # check to ensure the input is an array given that the attribute
158
159
  # is documented as an array but the input is not
159
- if attributes[self.class.attribute_map[key]].is_a?(Array)
160
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
160
+ if attributes[attribute_map[key]].is_a?(Array)
161
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
161
162
  end
162
- elsif !attributes[self.class.attribute_map[key]].nil?
163
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
164
- end # or else data not found in attributes(hash), not an issue as the data can be optional
163
+ elsif !attributes[attribute_map[key]].nil?
164
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
165
+ end
165
166
  end
166
-
167
- self
167
+ new(transformed_hash)
168
168
  end
169
169
 
170
170
  # Deserializes the data based on type
171
171
  # @param string type Data type
172
172
  # @param string value Value to be deserialized
173
173
  # @return [Object] Deserialized data
174
- def _deserialize(type, value)
174
+ def self._deserialize(type, value)
175
175
  case type.to_sym
176
- when :DateTime
177
- DateTime.parse(value)
176
+ when :Time
177
+ Time.parse(value)
178
178
  when :Date
179
179
  Date.parse(value)
180
180
  when :String
@@ -204,7 +204,9 @@ module PulpPythonClient
204
204
  end
205
205
  end
206
206
  else # model
207
- PulpPythonClient.const_get(type).build_from_hash(value)
207
+ # models (e.g. Pet) or oneOf
208
+ klass = PulpPythonClient.const_get(type)
209
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
208
210
  end
209
211
  end
210
212
 
@@ -230,7 +232,7 @@ module PulpPythonClient
230
232
  is_nullable = self.class.openapi_nullable.include?(attr)
231
233
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
232
234
  end
233
-
235
+
234
236
  hash[param] = _to_hash(value)
235
237
  end
236
238
  hash
@@ -253,5 +255,7 @@ module PulpPythonClient
253
255
  value
254
256
  end
255
257
  end
258
+
256
259
  end
260
+
257
261
  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
  class PackageTypesEnum
@@ -23,6 +24,10 @@ module PulpPythonClient
23
24
  BDIST_WININST = "bdist_wininst".freeze
24
25
  SDIST = "sdist".freeze
25
26
 
27
+ def self.all_vars
28
+ @all_vars ||= [BDIST_DMG, BDIST_DUMB, BDIST_EGG, BDIST_MSI, BDIST_RPM, BDIST_WHEEL, BDIST_WININST, SDIST].freeze
29
+ end
30
+
26
31
  # Builds the enum from string
27
32
  # @param [String] The enum value in the form of the string
28
33
  # @return [String] The enum value
@@ -34,9 +39,8 @@ module PulpPythonClient
34
39
  # @param [String] The enum value in the form of the string
35
40
  # @return [String] The enum value
36
41
  def build_from_hash(value)
37
- constantValues = PackageTypesEnum.constants.select { |c| PackageTypesEnum::const_get(c) == value }
38
- raise "Invalid ENUM value #{value} for class #PackageTypesEnum" if constantValues.empty?
39
- value
42
+ return value if PackageTypesEnum.all_vars.include?(value)
43
+ raise "Invalid ENUM value #{value} for class #PackageTypesEnum"
40
44
  end
41
45
  end
42
46
  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 responding to a package upload task.
@@ -30,12 +31,17 @@ module PulpPythonClient
30
31
  }
31
32
  end
32
33
 
34
+ # Returns all the JSON keys this model knows about
35
+ def self.acceptable_attributes
36
+ attribute_map.values
37
+ end
38
+
33
39
  # Attribute type mapping.
34
40
  def self.openapi_types
35
41
  {
36
42
  :'session' => :'String',
37
43
  :'task' => :'String',
38
- :'task_start_time' => :'DateTime'
44
+ :'task_start_time' => :'Time'
39
45
  }
40
46
  end
41
47
 
@@ -64,20 +70,27 @@ module PulpPythonClient
64
70
 
65
71
  if attributes.key?(:'session')
66
72
  self.session = attributes[:'session']
73
+ else
74
+ self.session = nil
67
75
  end
68
76
 
69
77
  if attributes.key?(:'task')
70
78
  self.task = attributes[:'task']
79
+ else
80
+ self.task = nil
71
81
  end
72
82
 
73
83
  if attributes.key?(:'task_start_time')
74
84
  self.task_start_time = attributes[:'task_start_time']
85
+ else
86
+ self.task_start_time = nil
75
87
  end
76
88
  end
77
89
 
78
90
  # Show invalid properties with the reasons. Usually used together with valid?
79
91
  # @return Array for valid properties with the reasons
80
92
  def list_invalid_properties
93
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
81
94
  invalid_properties = Array.new
82
95
  if @task.nil?
83
96
  invalid_properties.push('invalid value for "task", task cannot be nil.')
@@ -89,6 +102,7 @@ module PulpPythonClient
89
102
  # Check to see if the all the properties in the model are valid
90
103
  # @return true if the model is valid
91
104
  def valid?
105
+ warn '[DEPRECATED] the `valid?` method is obsolete'
92
106
  return false if @task.nil?
93
107
  true
94
108
  end
@@ -119,37 +133,33 @@ module PulpPythonClient
119
133
  # @param [Hash] attributes Model attributes in the form of hash
120
134
  # @return [Object] Returns the model itself
121
135
  def self.build_from_hash(attributes)
122
- new.build_from_hash(attributes)
123
- end
124
-
125
- # Builds the object from hash
126
- # @param [Hash] attributes Model attributes in the form of hash
127
- # @return [Object] Returns the model itself
128
- def build_from_hash(attributes)
129
136
  return nil unless attributes.is_a?(Hash)
130
- self.class.openapi_types.each_pair do |key, type|
131
- if type =~ /\AArray<(.*)>/i
137
+ attributes = attributes.transform_keys(&:to_sym)
138
+ transformed_hash = {}
139
+ openapi_types.each_pair do |key, type|
140
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = nil
142
+ elsif type =~ /\AArray<(.*)>/i
132
143
  # check to ensure the input is an array given that the attribute
133
144
  # is documented as an array but the input is not
134
- if attributes[self.class.attribute_map[key]].is_a?(Array)
135
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
145
+ if attributes[attribute_map[key]].is_a?(Array)
146
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
136
147
  end
137
- elsif !attributes[self.class.attribute_map[key]].nil?
138
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
139
- end # or else data not found in attributes(hash), not an issue as the data can be optional
148
+ elsif !attributes[attribute_map[key]].nil?
149
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
150
+ end
140
151
  end
141
-
142
- self
152
+ new(transformed_hash)
143
153
  end
144
154
 
145
155
  # Deserializes the data based on type
146
156
  # @param string type Data type
147
157
  # @param string value Value to be deserialized
148
158
  # @return [Object] Deserialized data
149
- def _deserialize(type, value)
159
+ def self._deserialize(type, value)
150
160
  case type.to_sym
151
- when :DateTime
152
- DateTime.parse(value)
161
+ when :Time
162
+ Time.parse(value)
153
163
  when :Date
154
164
  Date.parse(value)
155
165
  when :String
@@ -179,7 +189,9 @@ module PulpPythonClient
179
189
  end
180
190
  end
181
191
  else # model
182
- PulpPythonClient.const_get(type).build_from_hash(value)
192
+ # models (e.g. Pet) or oneOf
193
+ klass = PulpPythonClient.const_get(type)
194
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
183
195
  end
184
196
  end
185
197
 
@@ -205,7 +217,7 @@ module PulpPythonClient
205
217
  is_nullable = self.class.openapi_nullable.include?(attr)
206
218
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
207
219
  end
208
-
220
+
209
221
  hash[param] = _to_hash(value)
210
222
  end
211
223
  hash
@@ -228,5 +240,7 @@ module PulpPythonClient
228
240
  value
229
241
  end
230
242
  end
243
+
231
244
  end
245
+
232
246
  end