pulp_python_client 3.12.6 → 3.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +17 -16
- data/docs/AsyncOperationResponse.md +8 -7
- data/docs/ContentPackagesApi.md +170 -120
- data/docs/ContentSummaryResponse.md +12 -11
- data/docs/DistributionsPypiApi.md +385 -182
- data/docs/ExcludePlatformsEnum.md +4 -5
- data/docs/MyPermissionsResponse.md +8 -7
- data/docs/NestedRole.md +12 -11
- data/docs/NestedRoleResponse.md +12 -11
- data/docs/ObjectRolesResponse.md +8 -7
- data/docs/PackageMetadataResponse.md +14 -13
- data/docs/PackageTypesEnum.md +4 -5
- data/docs/PackageUploadTaskResponse.md +12 -11
- data/docs/PaginatedRepositoryVersionResponseList.md +14 -13
- data/docs/PaginatedpythonPythonDistributionResponseList.md +14 -13
- data/docs/PaginatedpythonPythonPackageContentResponseList.md +14 -13
- data/docs/PaginatedpythonPythonPublicationResponseList.md +14 -13
- data/docs/PaginatedpythonPythonRemoteResponseList.md +14 -13
- data/docs/PaginatedpythonPythonRepositoryResponseList.md +14 -13
- data/docs/PatchedpythonPythonDistribution.md +24 -23
- data/docs/PatchedpythonPythonRemote.md +60 -59
- data/docs/PatchedpythonPythonRepository.md +18 -17
- data/docs/PolicyEnum.md +4 -5
- data/docs/PublicationsPypiApi.md +267 -130
- data/docs/PypiApi.md +33 -17
- data/docs/PypiLegacyApi.md +34 -18
- data/docs/PypiMetadataApi.md +34 -18
- data/docs/PypiSimpleApi.md +95 -45
- data/docs/PythonPythonDistribution.md +24 -23
- data/docs/PythonPythonDistributionResponse.md +36 -35
- data/docs/PythonPythonPackageContentResponse.md +70 -69
- data/docs/PythonPythonPublication.md +10 -9
- data/docs/PythonPythonPublicationResponse.md +20 -19
- data/docs/PythonPythonRemote.md +60 -59
- data/docs/PythonPythonRemoteResponse.md +60 -59
- data/docs/PythonPythonRemoteResponseHiddenFieldsInner.md +20 -0
- data/docs/PythonPythonRepository.md +18 -17
- data/docs/PythonPythonRepositoryResponse.md +30 -29
- data/docs/RemotesPythonApi.md +420 -198
- data/docs/Repair.md +8 -7
- data/docs/RepositoriesPythonApi.md +444 -207
- data/docs/RepositoriesPythonVersionsApi.md +152 -82
- data/docs/RepositoryAddRemoveContent.md +12 -11
- data/docs/RepositorySyncURL.md +10 -9
- data/docs/RepositoryVersionResponse.md +22 -21
- data/docs/SetLabel.md +10 -9
- data/docs/SetLabelResponse.md +10 -9
- data/docs/SummaryResponse.md +12 -11
- data/docs/UnsetLabel.md +8 -7
- data/docs/UnsetLabelResponse.md +10 -9
- data/lib/pulp_python_client/api/content_packages_api.rb +21 -15
- data/lib/pulp_python_client/api/distributions_pypi_api.rb +89 -56
- data/lib/pulp_python_client/api/publications_pypi_api.rb +67 -47
- data/lib/pulp_python_client/api/pypi_api.rb +6 -5
- data/lib/pulp_python_client/api/pypi_legacy_api.rb +11 -7
- data/lib/pulp_python_client/api/pypi_metadata_api.rb +6 -5
- data/lib/pulp_python_client/api/pypi_simple_api.rb +19 -13
- data/lib/pulp_python_client/api/remotes_python_api.rb +113 -73
- data/lib/pulp_python_client/api/repositories_python_api.rb +107 -66
- data/lib/pulp_python_client/api/repositories_python_versions_api.rb +40 -30
- data/lib/pulp_python_client/api_client.rb +137 -102
- data/lib/pulp_python_client/api_error.rb +2 -1
- data/lib/pulp_python_client/configuration.rb +162 -21
- data/lib/pulp_python_client/models/async_operation_response.rb +32 -22
- data/lib/pulp_python_client/models/content_summary_response.rb +36 -22
- data/lib/pulp_python_client/models/exclude_platforms_enum.rb +8 -4
- data/lib/pulp_python_client/models/my_permissions_response.rb +32 -22
- data/lib/pulp_python_client/models/nested_role.rb +32 -22
- data/lib/pulp_python_client/models/nested_role_response.rb +32 -22
- data/lib/pulp_python_client/models/object_roles_response.rb +32 -22
- data/lib/pulp_python_client/models/package_metadata_response.rb +41 -37
- data/lib/pulp_python_client/models/package_types_enum.rb +8 -4
- data/lib/pulp_python_client/models/package_upload_task_response.rb +37 -23
- data/lib/pulp_python_client/models/paginated_repository_version_response_list.rb +34 -22
- data/lib/pulp_python_client/models/paginatedpython_python_distribution_response_list.rb +34 -22
- data/lib/pulp_python_client/models/paginatedpython_python_package_content_response_list.rb +34 -22
- data/lib/pulp_python_client/models/paginatedpython_python_publication_response_list.rb +34 -22
- data/lib/pulp_python_client/models/paginatedpython_python_remote_response_list.rb +34 -22
- data/lib/pulp_python_client/models/paginatedpython_python_repository_response_list.rb +34 -22
- data/lib/pulp_python_client/models/patchedpython_python_distribution.rb +40 -24
- data/lib/pulp_python_client/models/patchedpython_python_remote.rb +62 -24
- data/lib/pulp_python_client/models/patchedpython_python_repository.rb +35 -23
- data/lib/pulp_python_client/models/policy_enum.rb +8 -4
- data/lib/pulp_python_client/models/python_python_distribution.rb +34 -22
- data/lib/pulp_python_client/models/python_python_distribution_response.rb +36 -24
- data/lib/pulp_python_client/models/python_python_package_content_response.rb +38 -24
- data/lib/pulp_python_client/models/python_python_publication.rb +30 -22
- data/lib/pulp_python_client/models/python_python_publication_response.rb +32 -24
- data/lib/pulp_python_client/models/python_python_remote.rb +56 -22
- data/lib/pulp_python_client/models/python_python_remote_response.rb +59 -25
- data/lib/pulp_python_client/models/{python_python_remote_response_hidden_fields.rb → python_python_remote_response_hidden_fields_inner.rb} +37 -25
- data/lib/pulp_python_client/models/python_python_repository.rb +32 -22
- data/lib/pulp_python_client/models/python_python_repository_response.rb +34 -24
- data/lib/pulp_python_client/models/repair.rb +30 -22
- data/lib/pulp_python_client/models/repository_add_remove_content.rb +30 -22
- data/lib/pulp_python_client/models/repository_sync_url.rb +30 -22
- data/lib/pulp_python_client/models/repository_version_response.rb +32 -24
- data/lib/pulp_python_client/models/set_label.rb +34 -22
- data/lib/pulp_python_client/models/set_label_response.rb +34 -22
- data/lib/pulp_python_client/models/summary_response.rb +36 -22
- data/lib/pulp_python_client/models/unset_label.rb +32 -22
- data/lib/pulp_python_client/models/unset_label_response.rb +32 -22
- data/lib/pulp_python_client/version.rb +2 -2
- data/lib/pulp_python_client.rb +2 -5
- data/pulp_python_client.gemspec +9 -6
- data/spec/api/content_packages_api_spec.rb +4 -4
- data/spec/api/distributions_pypi_api_spec.rb +13 -13
- data/spec/api/publications_pypi_api_spec.rb +16 -15
- data/spec/api/pypi_api_spec.rb +2 -2
- data/spec/api/pypi_legacy_api_spec.rb +2 -2
- data/spec/api/pypi_metadata_api_spec.rb +2 -2
- data/spec/api/pypi_simple_api_spec.rb +4 -4
- data/spec/api/remotes_python_api_spec.rb +21 -20
- data/spec/api/repositories_python_api_spec.rb +15 -15
- data/spec/api/repositories_python_versions_api_spec.rb +12 -11
- data/spec/models/async_operation_response_spec.rb +7 -12
- data/spec/models/content_summary_response_spec.rb +9 -14
- data/spec/models/exclude_platforms_enum_spec.rb +6 -11
- data/spec/models/my_permissions_response_spec.rb +7 -12
- data/spec/models/nested_role_response_spec.rb +9 -14
- data/spec/models/nested_role_spec.rb +9 -14
- data/spec/models/object_roles_response_spec.rb +7 -12
- data/spec/models/package_metadata_response_spec.rb +10 -15
- data/spec/models/package_types_enum_spec.rb +6 -11
- data/spec/models/package_upload_task_response_spec.rb +9 -14
- data/spec/models/paginated_repository_version_response_list_spec.rb +10 -15
- data/spec/models/paginatedpython_python_distribution_response_list_spec.rb +10 -15
- data/spec/models/paginatedpython_python_package_content_response_list_spec.rb +10 -15
- data/spec/models/paginatedpython_python_publication_response_list_spec.rb +10 -15
- data/spec/models/paginatedpython_python_remote_response_list_spec.rb +10 -15
- data/spec/models/paginatedpython_python_repository_response_list_spec.rb +10 -15
- data/spec/models/patchedpython_python_distribution_spec.rb +15 -20
- data/spec/models/patchedpython_python_remote_spec.rb +33 -38
- data/spec/models/patchedpython_python_repository_spec.rb +12 -17
- data/spec/models/policy_enum_spec.rb +6 -11
- data/spec/models/python_python_distribution_response_spec.rb +21 -26
- data/spec/models/python_python_distribution_spec.rb +15 -20
- data/spec/models/python_python_package_content_response_spec.rb +38 -43
- data/spec/models/python_python_publication_response_spec.rb +13 -18
- data/spec/models/python_python_publication_spec.rb +8 -13
- data/spec/models/{python_python_remote_response_hidden_fields_spec.rb → python_python_remote_response_hidden_fields_inner_spec.rb} +11 -16
- data/spec/models/python_python_remote_response_spec.rb +33 -38
- data/spec/models/python_python_remote_spec.rb +33 -38
- data/spec/models/python_python_repository_response_spec.rb +18 -23
- data/spec/models/python_python_repository_spec.rb +12 -17
- data/spec/models/repair_spec.rb +7 -12
- data/spec/models/repository_add_remove_content_spec.rb +9 -14
- data/spec/models/repository_sync_url_spec.rb +8 -13
- data/spec/models/repository_version_response_spec.rb +14 -19
- data/spec/models/set_label_response_spec.rb +8 -13
- data/spec/models/set_label_spec.rb +8 -13
- data/spec/models/summary_response_spec.rb +9 -14
- data/spec/models/unset_label_response_spec.rb +8 -13
- data/spec/models/unset_label_spec.rb +7 -12
- data/spec/spec_helper.rb +1 -1
- metadata +79 -67
- data/docs/PackageUpload.md +0 -21
- data/docs/PythonBanderRemote.md +0 -21
- data/docs/PythonPythonPackageContent.md +0 -71
- data/docs/PythonPythonRemoteResponseHiddenFields.md +0 -19
- data/lib/pulp_python_client/models/package_upload.rb +0 -283
- data/lib/pulp_python_client/models/python_bander_remote.rb +0 -257
- data/lib/pulp_python_client/models/python_python_package_content.rb +0 -534
- data/spec/api_client_spec.rb +0 -188
- data/spec/configuration_spec.rb +0 -42
- data/spec/models/package_upload_spec.rb +0 -53
- data/spec/models/python_bander_remote_spec.rb +0 -53
- 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
|
-
|
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 PaginatedpythonPythonRepositoryResponseList
|
@@ -32,6 +33,11 @@ module PulpPythonClient
|
|
32
33
|
}
|
33
34
|
end
|
34
35
|
|
36
|
+
# Returns all the JSON keys this model knows about
|
37
|
+
def self.acceptable_attributes
|
38
|
+
attribute_map.values
|
39
|
+
end
|
40
|
+
|
35
41
|
# Attribute type mapping.
|
36
42
|
def self.openapi_types
|
37
43
|
{
|
@@ -67,6 +73,8 @@ module PulpPythonClient
|
|
67
73
|
|
68
74
|
if attributes.key?(:'count')
|
69
75
|
self.count = attributes[:'count']
|
76
|
+
else
|
77
|
+
self.count = nil
|
70
78
|
end
|
71
79
|
|
72
80
|
if attributes.key?(:'_next')
|
@@ -81,12 +89,15 @@ module PulpPythonClient
|
|
81
89
|
if (value = attributes[:'results']).is_a?(Array)
|
82
90
|
self.results = value
|
83
91
|
end
|
92
|
+
else
|
93
|
+
self.results = nil
|
84
94
|
end
|
85
95
|
end
|
86
96
|
|
87
97
|
# Show invalid properties with the reasons. Usually used together with valid?
|
88
98
|
# @return Array for valid properties with the reasons
|
89
99
|
def list_invalid_properties
|
100
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
90
101
|
invalid_properties = Array.new
|
91
102
|
if @count.nil?
|
92
103
|
invalid_properties.push('invalid value for "count", count cannot be nil.')
|
@@ -102,6 +113,7 @@ module PulpPythonClient
|
|
102
113
|
# Check to see if the all the properties in the model are valid
|
103
114
|
# @return true if the model is valid
|
104
115
|
def valid?
|
116
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
105
117
|
return false if @count.nil?
|
106
118
|
return false if @results.nil?
|
107
119
|
true
|
@@ -134,37 +146,33 @@ module PulpPythonClient
|
|
134
146
|
# @param [Hash] attributes Model attributes in the form of hash
|
135
147
|
# @return [Object] Returns the model itself
|
136
148
|
def self.build_from_hash(attributes)
|
137
|
-
new.build_from_hash(attributes)
|
138
|
-
end
|
139
|
-
|
140
|
-
# Builds the object from hash
|
141
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
142
|
-
# @return [Object] Returns the model itself
|
143
|
-
def build_from_hash(attributes)
|
144
149
|
return nil unless attributes.is_a?(Hash)
|
145
|
-
|
146
|
-
|
150
|
+
attributes = attributes.transform_keys(&:to_sym)
|
151
|
+
transformed_hash = {}
|
152
|
+
openapi_types.each_pair do |key, type|
|
153
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
154
|
+
transformed_hash["#{key}"] = nil
|
155
|
+
elsif type =~ /\AArray<(.*)>/i
|
147
156
|
# check to ensure the input is an array given that the attribute
|
148
157
|
# is documented as an array but the input is not
|
149
|
-
if attributes[
|
150
|
-
|
158
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
159
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
151
160
|
end
|
152
|
-
elsif !attributes[
|
153
|
-
|
154
|
-
end
|
161
|
+
elsif !attributes[attribute_map[key]].nil?
|
162
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
163
|
+
end
|
155
164
|
end
|
156
|
-
|
157
|
-
self
|
165
|
+
new(transformed_hash)
|
158
166
|
end
|
159
167
|
|
160
168
|
# Deserializes the data based on type
|
161
169
|
# @param string type Data type
|
162
170
|
# @param string value Value to be deserialized
|
163
171
|
# @return [Object] Deserialized data
|
164
|
-
def _deserialize(type, value)
|
172
|
+
def self._deserialize(type, value)
|
165
173
|
case type.to_sym
|
166
|
-
when :
|
167
|
-
|
174
|
+
when :Time
|
175
|
+
Time.parse(value)
|
168
176
|
when :Date
|
169
177
|
Date.parse(value)
|
170
178
|
when :String
|
@@ -194,7 +202,9 @@ module PulpPythonClient
|
|
194
202
|
end
|
195
203
|
end
|
196
204
|
else # model
|
197
|
-
|
205
|
+
# models (e.g. Pet) or oneOf
|
206
|
+
klass = PulpPythonClient.const_get(type)
|
207
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
198
208
|
end
|
199
209
|
end
|
200
210
|
|
@@ -220,7 +230,7 @@ module PulpPythonClient
|
|
220
230
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
221
231
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
222
232
|
end
|
223
|
-
|
233
|
+
|
224
234
|
hash[param] = _to_hash(value)
|
225
235
|
end
|
226
236
|
hash
|
@@ -243,5 +253,7 @@ module PulpPythonClient
|
|
243
253
|
value
|
244
254
|
end
|
245
255
|
end
|
256
|
+
|
246
257
|
end
|
258
|
+
|
247
259
|
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
|
-
|
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
|
{
|
@@ -142,6 +148,7 @@ module PulpPythonClient
|
|
142
148
|
# Show invalid properties with the reasons. Usually used together with valid?
|
143
149
|
# @return Array for valid properties with the reasons
|
144
150
|
def list_invalid_properties
|
151
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
145
152
|
invalid_properties = Array.new
|
146
153
|
if !@base_path.nil? && @base_path.to_s.length < 1
|
147
154
|
invalid_properties.push('invalid value for "base_path", the character length must be great than or equal to 1.')
|
@@ -157,6 +164,7 @@ module PulpPythonClient
|
|
157
164
|
# Check to see if the all the properties in the model are valid
|
158
165
|
# @return true if the model is valid
|
159
166
|
def valid?
|
167
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
160
168
|
return false if !@base_path.nil? && @base_path.to_s.length < 1
|
161
169
|
return false if !@name.nil? && @name.to_s.length < 1
|
162
170
|
true
|
@@ -165,7 +173,11 @@ module PulpPythonClient
|
|
165
173
|
# Custom attribute writer method with validation
|
166
174
|
# @param [Object] base_path Value to be assigned
|
167
175
|
def base_path=(base_path)
|
168
|
-
if
|
176
|
+
if base_path.nil?
|
177
|
+
fail ArgumentError, 'base_path cannot be nil'
|
178
|
+
end
|
179
|
+
|
180
|
+
if base_path.to_s.length < 1
|
169
181
|
fail ArgumentError, 'invalid value for "base_path", the character length must be great than or equal to 1.'
|
170
182
|
end
|
171
183
|
|
@@ -175,7 +187,11 @@ module PulpPythonClient
|
|
175
187
|
# Custom attribute writer method with validation
|
176
188
|
# @param [Object] name Value to be assigned
|
177
189
|
def name=(name)
|
178
|
-
if
|
190
|
+
if name.nil?
|
191
|
+
fail ArgumentError, 'name cannot be nil'
|
192
|
+
end
|
193
|
+
|
194
|
+
if name.to_s.length < 1
|
179
195
|
fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
|
180
196
|
end
|
181
197
|
|
@@ -214,37 +230,33 @@ module PulpPythonClient
|
|
214
230
|
# @param [Hash] attributes Model attributes in the form of hash
|
215
231
|
# @return [Object] Returns the model itself
|
216
232
|
def self.build_from_hash(attributes)
|
217
|
-
new.build_from_hash(attributes)
|
218
|
-
end
|
219
|
-
|
220
|
-
# Builds the object from hash
|
221
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
222
|
-
# @return [Object] Returns the model itself
|
223
|
-
def build_from_hash(attributes)
|
224
233
|
return nil unless attributes.is_a?(Hash)
|
225
|
-
|
226
|
-
|
234
|
+
attributes = attributes.transform_keys(&:to_sym)
|
235
|
+
transformed_hash = {}
|
236
|
+
openapi_types.each_pair do |key, type|
|
237
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
238
|
+
transformed_hash["#{key}"] = nil
|
239
|
+
elsif type =~ /\AArray<(.*)>/i
|
227
240
|
# check to ensure the input is an array given that the attribute
|
228
241
|
# is documented as an array but the input is not
|
229
|
-
if attributes[
|
230
|
-
|
242
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
243
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
231
244
|
end
|
232
|
-
elsif !attributes[
|
233
|
-
|
234
|
-
end
|
245
|
+
elsif !attributes[attribute_map[key]].nil?
|
246
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
247
|
+
end
|
235
248
|
end
|
236
|
-
|
237
|
-
self
|
249
|
+
new(transformed_hash)
|
238
250
|
end
|
239
251
|
|
240
252
|
# Deserializes the data based on type
|
241
253
|
# @param string type Data type
|
242
254
|
# @param string value Value to be deserialized
|
243
255
|
# @return [Object] Deserialized data
|
244
|
-
def _deserialize(type, value)
|
256
|
+
def self._deserialize(type, value)
|
245
257
|
case type.to_sym
|
246
|
-
when :
|
247
|
-
|
258
|
+
when :Time
|
259
|
+
Time.parse(value)
|
248
260
|
when :Date
|
249
261
|
Date.parse(value)
|
250
262
|
when :String
|
@@ -274,7 +286,9 @@ module PulpPythonClient
|
|
274
286
|
end
|
275
287
|
end
|
276
288
|
else # model
|
277
|
-
|
289
|
+
# models (e.g. Pet) or oneOf
|
290
|
+
klass = PulpPythonClient.const_get(type)
|
291
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
278
292
|
end
|
279
293
|
end
|
280
294
|
|
@@ -300,7 +314,7 @@ module PulpPythonClient
|
|
300
314
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
301
315
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
302
316
|
end
|
303
|
-
|
317
|
+
|
304
318
|
hash[param] = _to_hash(value)
|
305
319
|
end
|
306
320
|
hash
|
@@ -323,5 +337,7 @@ module PulpPythonClient
|
|
323
337
|
value
|
324
338
|
end
|
325
339
|
end
|
340
|
+
|
326
341
|
end
|
342
|
+
|
327
343
|
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
|
-
|
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 PythonRemote.
|
@@ -95,6 +96,28 @@ module PulpPythonClient
|
|
95
96
|
# List of platforms to exclude syncing Python packages for. Possible valuesinclude: windows, macos, freebsd, and linux.
|
96
97
|
attr_accessor :exclude_platforms
|
97
98
|
|
99
|
+
class EnumAttributeValidator
|
100
|
+
attr_reader :datatype
|
101
|
+
attr_reader :allowable_values
|
102
|
+
|
103
|
+
def initialize(datatype, allowable_values)
|
104
|
+
@allowable_values = allowable_values.map do |value|
|
105
|
+
case datatype.to_s
|
106
|
+
when /Integer/i
|
107
|
+
value.to_i
|
108
|
+
when /Float/i
|
109
|
+
value.to_f
|
110
|
+
else
|
111
|
+
value
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
def valid?(value)
|
117
|
+
!value || allowable_values.include?(value)
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
98
121
|
# Attribute mapping from ruby-style variable name to JSON key.
|
99
122
|
def self.attribute_map
|
100
123
|
{
|
@@ -128,6 +151,11 @@ module PulpPythonClient
|
|
128
151
|
}
|
129
152
|
end
|
130
153
|
|
154
|
+
# Returns all the JSON keys this model knows about
|
155
|
+
def self.acceptable_attributes
|
156
|
+
attribute_map.values
|
157
|
+
end
|
158
|
+
|
131
159
|
# Attribute type mapping.
|
132
160
|
def self.openapi_types
|
133
161
|
{
|
@@ -323,6 +351,7 @@ module PulpPythonClient
|
|
323
351
|
# Show invalid properties with the reasons. Usually used together with valid?
|
324
352
|
# @return Array for valid properties with the reasons
|
325
353
|
def list_invalid_properties
|
354
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
326
355
|
invalid_properties = Array.new
|
327
356
|
if !@name.nil? && @name.to_s.length < 1
|
328
357
|
invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
|
@@ -390,6 +419,7 @@ module PulpPythonClient
|
|
390
419
|
# Check to see if the all the properties in the model are valid
|
391
420
|
# @return true if the model is valid
|
392
421
|
def valid?
|
422
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
393
423
|
return false if !@name.nil? && @name.to_s.length < 1
|
394
424
|
return false if !@url.nil? && @url.to_s.length < 1
|
395
425
|
return false if !@ca_cert.nil? && @ca_cert.to_s.length < 1
|
@@ -411,7 +441,11 @@ module PulpPythonClient
|
|
411
441
|
# Custom attribute writer method with validation
|
412
442
|
# @param [Object] name Value to be assigned
|
413
443
|
def name=(name)
|
414
|
-
if
|
444
|
+
if name.nil?
|
445
|
+
fail ArgumentError, 'name cannot be nil'
|
446
|
+
end
|
447
|
+
|
448
|
+
if name.to_s.length < 1
|
415
449
|
fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
|
416
450
|
end
|
417
451
|
|
@@ -421,7 +455,11 @@ module PulpPythonClient
|
|
421
455
|
# Custom attribute writer method with validation
|
422
456
|
# @param [Object] url Value to be assigned
|
423
457
|
def url=(url)
|
424
|
-
if
|
458
|
+
if url.nil?
|
459
|
+
fail ArgumentError, 'url cannot be nil'
|
460
|
+
end
|
461
|
+
|
462
|
+
if url.to_s.length < 1
|
425
463
|
fail ArgumentError, 'invalid value for "url", the character length must be great than or equal to 1.'
|
426
464
|
end
|
427
465
|
|
@@ -608,37 +646,33 @@ module PulpPythonClient
|
|
608
646
|
# @param [Hash] attributes Model attributes in the form of hash
|
609
647
|
# @return [Object] Returns the model itself
|
610
648
|
def self.build_from_hash(attributes)
|
611
|
-
new.build_from_hash(attributes)
|
612
|
-
end
|
613
|
-
|
614
|
-
# Builds the object from hash
|
615
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
616
|
-
# @return [Object] Returns the model itself
|
617
|
-
def build_from_hash(attributes)
|
618
649
|
return nil unless attributes.is_a?(Hash)
|
619
|
-
|
620
|
-
|
650
|
+
attributes = attributes.transform_keys(&:to_sym)
|
651
|
+
transformed_hash = {}
|
652
|
+
openapi_types.each_pair do |key, type|
|
653
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
654
|
+
transformed_hash["#{key}"] = nil
|
655
|
+
elsif type =~ /\AArray<(.*)>/i
|
621
656
|
# check to ensure the input is an array given that the attribute
|
622
657
|
# is documented as an array but the input is not
|
623
|
-
if attributes[
|
624
|
-
|
658
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
659
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
625
660
|
end
|
626
|
-
elsif !attributes[
|
627
|
-
|
628
|
-
end
|
661
|
+
elsif !attributes[attribute_map[key]].nil?
|
662
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
663
|
+
end
|
629
664
|
end
|
630
|
-
|
631
|
-
self
|
665
|
+
new(transformed_hash)
|
632
666
|
end
|
633
667
|
|
634
668
|
# Deserializes the data based on type
|
635
669
|
# @param string type Data type
|
636
670
|
# @param string value Value to be deserialized
|
637
671
|
# @return [Object] Deserialized data
|
638
|
-
def _deserialize(type, value)
|
672
|
+
def self._deserialize(type, value)
|
639
673
|
case type.to_sym
|
640
|
-
when :
|
641
|
-
|
674
|
+
when :Time
|
675
|
+
Time.parse(value)
|
642
676
|
when :Date
|
643
677
|
Date.parse(value)
|
644
678
|
when :String
|
@@ -668,7 +702,9 @@ module PulpPythonClient
|
|
668
702
|
end
|
669
703
|
end
|
670
704
|
else # model
|
671
|
-
|
705
|
+
# models (e.g. Pet) or oneOf
|
706
|
+
klass = PulpPythonClient.const_get(type)
|
707
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
672
708
|
end
|
673
709
|
end
|
674
710
|
|
@@ -694,7 +730,7 @@ module PulpPythonClient
|
|
694
730
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
695
731
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
696
732
|
end
|
697
|
-
|
733
|
+
|
698
734
|
hash[param] = _to_hash(value)
|
699
735
|
end
|
700
736
|
hash
|
@@ -717,5 +753,7 @@ module PulpPythonClient
|
|
717
753
|
value
|
718
754
|
end
|
719
755
|
end
|
756
|
+
|
720
757
|
end
|
758
|
+
|
721
759
|
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
|
-
|
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 Python Repositories.
|
@@ -44,6 +45,11 @@ module PulpPythonClient
|
|
44
45
|
}
|
45
46
|
end
|
46
47
|
|
48
|
+
# Returns all the JSON keys this model knows about
|
49
|
+
def self.acceptable_attributes
|
50
|
+
attribute_map.values
|
51
|
+
end
|
52
|
+
|
47
53
|
# Attribute type mapping.
|
48
54
|
def self.openapi_types
|
49
55
|
{
|
@@ -112,6 +118,7 @@ module PulpPythonClient
|
|
112
118
|
# Show invalid properties with the reasons. Usually used together with valid?
|
113
119
|
# @return Array for valid properties with the reasons
|
114
120
|
def list_invalid_properties
|
121
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
115
122
|
invalid_properties = Array.new
|
116
123
|
if !@name.nil? && @name.to_s.length < 1
|
117
124
|
invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
|
@@ -131,6 +138,7 @@ module PulpPythonClient
|
|
131
138
|
# Check to see if the all the properties in the model are valid
|
132
139
|
# @return true if the model is valid
|
133
140
|
def valid?
|
141
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
134
142
|
return false if !@name.nil? && @name.to_s.length < 1
|
135
143
|
return false if !@description.nil? && @description.to_s.length < 1
|
136
144
|
return false if !@retain_repo_versions.nil? && @retain_repo_versions < 1
|
@@ -140,7 +148,11 @@ module PulpPythonClient
|
|
140
148
|
# Custom attribute writer method with validation
|
141
149
|
# @param [Object] name Value to be assigned
|
142
150
|
def name=(name)
|
143
|
-
if
|
151
|
+
if name.nil?
|
152
|
+
fail ArgumentError, 'name cannot be nil'
|
153
|
+
end
|
154
|
+
|
155
|
+
if name.to_s.length < 1
|
144
156
|
fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
|
145
157
|
end
|
146
158
|
|
@@ -196,37 +208,33 @@ module PulpPythonClient
|
|
196
208
|
# @param [Hash] attributes Model attributes in the form of hash
|
197
209
|
# @return [Object] Returns the model itself
|
198
210
|
def self.build_from_hash(attributes)
|
199
|
-
new.build_from_hash(attributes)
|
200
|
-
end
|
201
|
-
|
202
|
-
# Builds the object from hash
|
203
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
204
|
-
# @return [Object] Returns the model itself
|
205
|
-
def build_from_hash(attributes)
|
206
211
|
return nil unless attributes.is_a?(Hash)
|
207
|
-
|
208
|
-
|
212
|
+
attributes = attributes.transform_keys(&:to_sym)
|
213
|
+
transformed_hash = {}
|
214
|
+
openapi_types.each_pair do |key, type|
|
215
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
216
|
+
transformed_hash["#{key}"] = nil
|
217
|
+
elsif type =~ /\AArray<(.*)>/i
|
209
218
|
# check to ensure the input is an array given that the attribute
|
210
219
|
# is documented as an array but the input is not
|
211
|
-
if attributes[
|
212
|
-
|
220
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
221
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
213
222
|
end
|
214
|
-
elsif !attributes[
|
215
|
-
|
216
|
-
end
|
223
|
+
elsif !attributes[attribute_map[key]].nil?
|
224
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
225
|
+
end
|
217
226
|
end
|
218
|
-
|
219
|
-
self
|
227
|
+
new(transformed_hash)
|
220
228
|
end
|
221
229
|
|
222
230
|
# Deserializes the data based on type
|
223
231
|
# @param string type Data type
|
224
232
|
# @param string value Value to be deserialized
|
225
233
|
# @return [Object] Deserialized data
|
226
|
-
def _deserialize(type, value)
|
234
|
+
def self._deserialize(type, value)
|
227
235
|
case type.to_sym
|
228
|
-
when :
|
229
|
-
|
236
|
+
when :Time
|
237
|
+
Time.parse(value)
|
230
238
|
when :Date
|
231
239
|
Date.parse(value)
|
232
240
|
when :String
|
@@ -256,7 +264,9 @@ module PulpPythonClient
|
|
256
264
|
end
|
257
265
|
end
|
258
266
|
else # model
|
259
|
-
|
267
|
+
# models (e.g. Pet) or oneOf
|
268
|
+
klass = PulpPythonClient.const_get(type)
|
269
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
260
270
|
end
|
261
271
|
end
|
262
272
|
|
@@ -282,7 +292,7 @@ module PulpPythonClient
|
|
282
292
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
283
293
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
284
294
|
end
|
285
|
-
|
295
|
+
|
286
296
|
hash[param] = _to_hash(value)
|
287
297
|
end
|
288
298
|
hash
|
@@ -305,5 +315,7 @@ module PulpPythonClient
|
|
305
315
|
value
|
306
316
|
end
|
307
317
|
end
|
318
|
+
|
308
319
|
end
|
320
|
+
|
309
321
|
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
|
-
|
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
|
-
|
33
|
-
raise "Invalid ENUM value #{value} for class #PolicyEnum"
|
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
|