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.
- 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 +82 -44
- 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 +76 -42
- data/lib/pulp_python_client/models/python_python_remote_response.rb +79 -45
- 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 +81 -69
- 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
|
# Serializer for asynchronous operations.
|
@@ -25,6 +26,11 @@ module PulpPythonClient
|
|
25
26
|
}
|
26
27
|
end
|
27
28
|
|
29
|
+
# Returns all the JSON keys this model knows about
|
30
|
+
def self.acceptable_attributes
|
31
|
+
attribute_map.values
|
32
|
+
end
|
33
|
+
|
28
34
|
# Attribute type mapping.
|
29
35
|
def self.openapi_types
|
30
36
|
{
|
@@ -55,12 +61,15 @@ module PulpPythonClient
|
|
55
61
|
|
56
62
|
if attributes.key?(:'task')
|
57
63
|
self.task = attributes[:'task']
|
64
|
+
else
|
65
|
+
self.task = 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 @task.nil?
|
66
75
|
invalid_properties.push('invalid value for "task", task 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 @task.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
|
-
|
112
|
-
|
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[
|
116
|
-
|
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[
|
119
|
-
|
120
|
-
end
|
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 :
|
133
|
-
|
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
|
-
|
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
|
-
|
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 the RepositoryVersion content summary
|
@@ -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
|
{
|
@@ -64,24 +70,31 @@ module PulpPythonClient
|
|
64
70
|
if (value = attributes[:'added']).is_a?(Hash)
|
65
71
|
self.added = value
|
66
72
|
end
|
73
|
+
else
|
74
|
+
self.added = nil
|
67
75
|
end
|
68
76
|
|
69
77
|
if attributes.key?(:'removed')
|
70
78
|
if (value = attributes[:'removed']).is_a?(Hash)
|
71
79
|
self.removed = value
|
72
80
|
end
|
81
|
+
else
|
82
|
+
self.removed = nil
|
73
83
|
end
|
74
84
|
|
75
85
|
if attributes.key?(:'present')
|
76
86
|
if (value = attributes[:'present']).is_a?(Hash)
|
77
87
|
self.present = value
|
78
88
|
end
|
89
|
+
else
|
90
|
+
self.present = nil
|
79
91
|
end
|
80
92
|
end
|
81
93
|
|
82
94
|
# Show invalid properties with the reasons. Usually used together with valid?
|
83
95
|
# @return Array for valid properties with the reasons
|
84
96
|
def list_invalid_properties
|
97
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
85
98
|
invalid_properties = Array.new
|
86
99
|
if @added.nil?
|
87
100
|
invalid_properties.push('invalid value for "added", added cannot be nil.')
|
@@ -101,6 +114,7 @@ module PulpPythonClient
|
|
101
114
|
# Check to see if the all the properties in the model are valid
|
102
115
|
# @return true if the model is valid
|
103
116
|
def valid?
|
117
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
104
118
|
return false if @added.nil?
|
105
119
|
return false if @removed.nil?
|
106
120
|
return false if @present.nil?
|
@@ -133,37 +147,33 @@ module PulpPythonClient
|
|
133
147
|
# @param [Hash] attributes Model attributes in the form of hash
|
134
148
|
# @return [Object] Returns the model itself
|
135
149
|
def self.build_from_hash(attributes)
|
136
|
-
new.build_from_hash(attributes)
|
137
|
-
end
|
138
|
-
|
139
|
-
# Builds the object from hash
|
140
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
141
|
-
# @return [Object] Returns the model itself
|
142
|
-
def build_from_hash(attributes)
|
143
150
|
return nil unless attributes.is_a?(Hash)
|
144
|
-
|
145
|
-
|
151
|
+
attributes = attributes.transform_keys(&:to_sym)
|
152
|
+
transformed_hash = {}
|
153
|
+
openapi_types.each_pair do |key, type|
|
154
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
155
|
+
transformed_hash["#{key}"] = nil
|
156
|
+
elsif type =~ /\AArray<(.*)>/i
|
146
157
|
# check to ensure the input is an array given that the attribute
|
147
158
|
# is documented as an array but the input is not
|
148
|
-
if attributes[
|
149
|
-
|
159
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
160
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
150
161
|
end
|
151
|
-
elsif !attributes[
|
152
|
-
|
153
|
-
end
|
162
|
+
elsif !attributes[attribute_map[key]].nil?
|
163
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
164
|
+
end
|
154
165
|
end
|
155
|
-
|
156
|
-
self
|
166
|
+
new(transformed_hash)
|
157
167
|
end
|
158
168
|
|
159
169
|
# Deserializes the data based on type
|
160
170
|
# @param string type Data type
|
161
171
|
# @param string value Value to be deserialized
|
162
172
|
# @return [Object] Deserialized data
|
163
|
-
def _deserialize(type, value)
|
173
|
+
def self._deserialize(type, value)
|
164
174
|
case type.to_sym
|
165
|
-
when :
|
166
|
-
|
175
|
+
when :Time
|
176
|
+
Time.parse(value)
|
167
177
|
when :Date
|
168
178
|
Date.parse(value)
|
169
179
|
when :String
|
@@ -193,7 +203,9 @@ module PulpPythonClient
|
|
193
203
|
end
|
194
204
|
end
|
195
205
|
else # model
|
196
|
-
|
206
|
+
# models (e.g. Pet) or oneOf
|
207
|
+
klass = PulpPythonClient.const_get(type)
|
208
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
197
209
|
end
|
198
210
|
end
|
199
211
|
|
@@ -219,7 +231,7 @@ module PulpPythonClient
|
|
219
231
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
220
232
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
221
233
|
end
|
222
|
-
|
234
|
+
|
223
235
|
hash[param] = _to_hash(value)
|
224
236
|
end
|
225
237
|
hash
|
@@ -242,5 +254,7 @@ module PulpPythonClient
|
|
242
254
|
value
|
243
255
|
end
|
244
256
|
end
|
257
|
+
|
245
258
|
end
|
259
|
+
|
246
260
|
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 ExcludePlatformsEnum
|
@@ -19,6 +20,10 @@ module PulpPythonClient
|
|
19
20
|
FREEBSD = "freebsd".freeze
|
20
21
|
LINUX = "linux".freeze
|
21
22
|
|
23
|
+
def self.all_vars
|
24
|
+
@all_vars ||= [WINDOWS, MACOS, FREEBSD, LINUX].freeze
|
25
|
+
end
|
26
|
+
|
22
27
|
# Builds the enum from string
|
23
28
|
# @param [String] The enum value in the form of the string
|
24
29
|
# @return [String] The enum value
|
@@ -30,9 +35,8 @@ module PulpPythonClient
|
|
30
35
|
# @param [String] The enum value in the form of the string
|
31
36
|
# @return [String] The enum value
|
32
37
|
def build_from_hash(value)
|
33
|
-
|
34
|
-
raise "Invalid ENUM value #{value} for class #ExcludePlatformsEnum"
|
35
|
-
value
|
38
|
+
return value if ExcludePlatformsEnum.all_vars.include?(value)
|
39
|
+
raise "Invalid ENUM value #{value} for class #ExcludePlatformsEnum"
|
36
40
|
end
|
37
41
|
end
|
38
42
|
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 MyPermissionsResponse
|
@@ -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[:'permissions']).is_a?(Array)
|
56
62
|
self.permissions = value
|
57
63
|
end
|
64
|
+
else
|
65
|
+
self.permissions = 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 @permissions.nil?
|
66
75
|
invalid_properties.push('invalid value for "permissions", permissions 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 @permissions.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
|
-
|
112
|
-
|
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[
|
116
|
-
|
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[
|
119
|
-
|
120
|
-
end
|
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 :
|
133
|
-
|
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
|
-
|
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
|
-
|
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.')
|
@@ -95,6 +104,7 @@ module PulpPythonClient
|
|
95
104
|
# Check to see if the all the properties in the model are valid
|
96
105
|
# @return true if the model is valid
|
97
106
|
def valid?
|
107
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
98
108
|
return false if @role.nil?
|
99
109
|
return false if @role.to_s.length < 1
|
100
110
|
true
|
@@ -140,37 +150,33 @@ module PulpPythonClient
|
|
140
150
|
# @param [Hash] attributes Model attributes in the form of hash
|
141
151
|
# @return [Object] Returns the model itself
|
142
152
|
def self.build_from_hash(attributes)
|
143
|
-
new.build_from_hash(attributes)
|
144
|
-
end
|
145
|
-
|
146
|
-
# Builds the object from hash
|
147
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
148
|
-
# @return [Object] Returns the model itself
|
149
|
-
def build_from_hash(attributes)
|
150
153
|
return nil unless attributes.is_a?(Hash)
|
151
|
-
|
152
|
-
|
154
|
+
attributes = attributes.transform_keys(&:to_sym)
|
155
|
+
transformed_hash = {}
|
156
|
+
openapi_types.each_pair do |key, type|
|
157
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
158
|
+
transformed_hash["#{key}"] = nil
|
159
|
+
elsif type =~ /\AArray<(.*)>/i
|
153
160
|
# check to ensure the input is an array given that the attribute
|
154
161
|
# is documented as an array but the input is not
|
155
|
-
if attributes[
|
156
|
-
|
162
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
163
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
157
164
|
end
|
158
|
-
elsif !attributes[
|
159
|
-
|
160
|
-
end
|
165
|
+
elsif !attributes[attribute_map[key]].nil?
|
166
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
167
|
+
end
|
161
168
|
end
|
162
|
-
|
163
|
-
self
|
169
|
+
new(transformed_hash)
|
164
170
|
end
|
165
171
|
|
166
172
|
# Deserializes the data based on type
|
167
173
|
# @param string type Data type
|
168
174
|
# @param string value Value to be deserialized
|
169
175
|
# @return [Object] Deserialized data
|
170
|
-
def _deserialize(type, value)
|
176
|
+
def self._deserialize(type, value)
|
171
177
|
case type.to_sym
|
172
|
-
when :
|
173
|
-
|
178
|
+
when :Time
|
179
|
+
Time.parse(value)
|
174
180
|
when :Date
|
175
181
|
Date.parse(value)
|
176
182
|
when :String
|
@@ -200,7 +206,9 @@ module PulpPythonClient
|
|
200
206
|
end
|
201
207
|
end
|
202
208
|
else # model
|
203
|
-
|
209
|
+
# models (e.g. Pet) or oneOf
|
210
|
+
klass = PulpPythonClient.const_get(type)
|
211
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
204
212
|
end
|
205
213
|
end
|
206
214
|
|
@@ -226,7 +234,7 @@ module PulpPythonClient
|
|
226
234
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
227
235
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
228
236
|
end
|
229
|
-
|
237
|
+
|
230
238
|
hash[param] = _to_hash(value)
|
231
239
|
end
|
232
240
|
hash
|
@@ -249,5 +257,7 @@ module PulpPythonClient
|
|
249
257
|
value
|
250
258
|
end
|
251
259
|
end
|
260
|
+
|
252
261
|
end
|
262
|
+
|
253
263
|
end
|