pulp_python_client 3.9.0 → 3.11.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 +18 -8
- data/docs/ContentPackagesApi.md +17 -11
- data/docs/DistributionsPypiApi.md +130 -4
- data/docs/PatchedpythonPythonDistribution.md +2 -0
- data/docs/PatchedpythonPythonRemote.md +1 -1
- data/docs/PublicationsPypiApi.md +9 -3
- data/docs/PypiApi.md +1 -1
- data/docs/PypiLegacyApi.md +1 -1
- data/docs/PypiMetadataApi.md +1 -1
- data/docs/PypiSimpleApi.md +1 -1
- data/docs/PythonBanderRemote.md +1 -1
- data/docs/PythonPythonDistribution.md +2 -0
- data/docs/PythonPythonDistributionResponse.md +2 -0
- data/docs/PythonPythonPackageContent.md +5 -5
- data/docs/PythonPythonRemote.md +1 -1
- data/docs/PythonPythonRemoteResponse.md +1 -1
- data/docs/RemotesPythonApi.md +131 -5
- data/docs/RepositoriesPythonApi.md +134 -4
- data/docs/RepositoriesPythonVersionsApi.md +7 -3
- data/docs/SetLabel.md +19 -0
- data/docs/SetLabelResponse.md +19 -0
- data/docs/UnsetLabel.md +17 -0
- data/docs/UnsetLabelResponse.md +19 -0
- data/lib/pulp_python_client/api/content_packages_api.rb +20 -11
- data/lib/pulp_python_client/api/distributions_pypi_api.rb +164 -3
- data/lib/pulp_python_client/api/publications_pypi_api.rb +11 -2
- data/lib/pulp_python_client/api/remotes_python_api.rb +165 -4
- data/lib/pulp_python_client/api/repositories_python_api.rb +169 -2
- data/lib/pulp_python_client/api/repositories_python_versions_api.rb +8 -2
- data/lib/pulp_python_client/configuration.rb +2 -2
- data/lib/pulp_python_client/models/patchedpython_python_distribution.rb +13 -1
- data/lib/pulp_python_client/models/patchedpython_python_remote.rb +1 -1
- data/lib/pulp_python_client/models/python_bander_remote.rb +1 -1
- data/lib/pulp_python_client/models/python_python_distribution.rb +13 -1
- data/lib/pulp_python_client/models/python_python_distribution_response.rb +13 -1
- data/lib/pulp_python_client/models/python_python_package_content.rb +13 -13
- data/lib/pulp_python_client/models/python_python_remote.rb +1 -1
- data/lib/pulp_python_client/models/python_python_remote_response.rb +1 -1
- data/lib/pulp_python_client/models/set_label.rb +252 -0
- data/lib/pulp_python_client/models/set_label_response.rb +243 -0
- data/lib/pulp_python_client/models/unset_label.rb +242 -0
- data/lib/pulp_python_client/models/unset_label_response.rb +242 -0
- data/lib/pulp_python_client/version.rb +1 -1
- data/lib/pulp_python_client.rb +4 -0
- data/spec/api/content_packages_api_spec.rb +8 -5
- data/spec/api/distributions_pypi_api_spec.rb +34 -1
- data/spec/api/publications_pypi_api_spec.rb +4 -1
- data/spec/api/remotes_python_api_spec.rb +35 -2
- data/spec/api/repositories_python_api_spec.rb +36 -1
- data/spec/api/repositories_python_versions_api_spec.rb +3 -1
- data/spec/configuration_spec.rb +3 -3
- data/spec/models/patchedpython_python_distribution_spec.rb +6 -0
- data/spec/models/python_python_distribution_response_spec.rb +6 -0
- data/spec/models/python_python_distribution_spec.rb +6 -0
- data/spec/models/python_python_package_content_spec.rb +4 -4
- data/spec/models/set_label_response_spec.rb +47 -0
- data/spec/models/set_label_spec.rb +47 -0
- data/spec/models/unset_label_response_spec.rb +47 -0
- data/spec/models/unset_label_spec.rb +41 -0
- metadata +50 -34
@@ -0,0 +1,242 @@
|
|
1
|
+
=begin
|
2
|
+
#Pulp 3 API
|
3
|
+
|
4
|
+
#Fetch, Upload, Organize, and Distribute Software Packages
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v3
|
7
|
+
Contact: pulp-list@redhat.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module PulpPythonClient
|
16
|
+
# Serializer for synchronously setting a label.
|
17
|
+
class UnsetLabel
|
18
|
+
attr_accessor :key
|
19
|
+
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'key' => :'key'
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
# Attribute type mapping.
|
28
|
+
def self.openapi_types
|
29
|
+
{
|
30
|
+
:'key' => :'String'
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
# List of attributes with nullable: true
|
35
|
+
def self.openapi_nullable
|
36
|
+
Set.new([
|
37
|
+
])
|
38
|
+
end
|
39
|
+
|
40
|
+
# Initializes the object
|
41
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
42
|
+
def initialize(attributes = {})
|
43
|
+
if (!attributes.is_a?(Hash))
|
44
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpPythonClient::UnsetLabel` initialize method"
|
45
|
+
end
|
46
|
+
|
47
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
48
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
49
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
50
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpPythonClient::UnsetLabel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
51
|
+
end
|
52
|
+
h[k.to_sym] = v
|
53
|
+
}
|
54
|
+
|
55
|
+
if attributes.key?(:'key')
|
56
|
+
self.key = attributes[:'key']
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
61
|
+
# @return Array for valid properties with the reasons
|
62
|
+
def list_invalid_properties
|
63
|
+
invalid_properties = Array.new
|
64
|
+
if @key.nil?
|
65
|
+
invalid_properties.push('invalid value for "key", key cannot be nil.')
|
66
|
+
end
|
67
|
+
|
68
|
+
if @key.to_s.length < 1
|
69
|
+
invalid_properties.push('invalid value for "key", the character length must be great than or equal to 1.')
|
70
|
+
end
|
71
|
+
|
72
|
+
pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
73
|
+
if @key !~ pattern
|
74
|
+
invalid_properties.push("invalid value for \"key\", must conform to the pattern #{pattern}.")
|
75
|
+
end
|
76
|
+
|
77
|
+
invalid_properties
|
78
|
+
end
|
79
|
+
|
80
|
+
# Check to see if the all the properties in the model are valid
|
81
|
+
# @return true if the model is valid
|
82
|
+
def valid?
|
83
|
+
return false if @key.nil?
|
84
|
+
return false if @key.to_s.length < 1
|
85
|
+
return false if @key !~ Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
86
|
+
true
|
87
|
+
end
|
88
|
+
|
89
|
+
# Custom attribute writer method with validation
|
90
|
+
# @param [Object] key Value to be assigned
|
91
|
+
def key=(key)
|
92
|
+
if key.nil?
|
93
|
+
fail ArgumentError, 'key cannot be nil'
|
94
|
+
end
|
95
|
+
|
96
|
+
if key.to_s.length < 1
|
97
|
+
fail ArgumentError, 'invalid value for "key", the character length must be great than or equal to 1.'
|
98
|
+
end
|
99
|
+
|
100
|
+
pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
101
|
+
if key !~ pattern
|
102
|
+
fail ArgumentError, "invalid value for \"key\", must conform to the pattern #{pattern}."
|
103
|
+
end
|
104
|
+
|
105
|
+
@key = key
|
106
|
+
end
|
107
|
+
|
108
|
+
# Checks equality by comparing each attribute.
|
109
|
+
# @param [Object] Object to be compared
|
110
|
+
def ==(o)
|
111
|
+
return true if self.equal?(o)
|
112
|
+
self.class == o.class &&
|
113
|
+
key == o.key
|
114
|
+
end
|
115
|
+
|
116
|
+
# @see the `==` method
|
117
|
+
# @param [Object] Object to be compared
|
118
|
+
def eql?(o)
|
119
|
+
self == o
|
120
|
+
end
|
121
|
+
|
122
|
+
# Calculates hash code according to all attributes.
|
123
|
+
# @return [Integer] Hash code
|
124
|
+
def hash
|
125
|
+
[key].hash
|
126
|
+
end
|
127
|
+
|
128
|
+
# Builds the object from hash
|
129
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
130
|
+
# @return [Object] Returns the model itself
|
131
|
+
def self.build_from_hash(attributes)
|
132
|
+
new.build_from_hash(attributes)
|
133
|
+
end
|
134
|
+
|
135
|
+
# Builds the object from hash
|
136
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
137
|
+
# @return [Object] Returns the model itself
|
138
|
+
def build_from_hash(attributes)
|
139
|
+
return nil unless attributes.is_a?(Hash)
|
140
|
+
self.class.openapi_types.each_pair do |key, type|
|
141
|
+
if type =~ /\AArray<(.*)>/i
|
142
|
+
# check to ensure the input is an array given that the attribute
|
143
|
+
# is documented as an array but the input is not
|
144
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
145
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
146
|
+
end
|
147
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
148
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
149
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
150
|
+
end
|
151
|
+
|
152
|
+
self
|
153
|
+
end
|
154
|
+
|
155
|
+
# Deserializes the data based on type
|
156
|
+
# @param string type Data type
|
157
|
+
# @param string value Value to be deserialized
|
158
|
+
# @return [Object] Deserialized data
|
159
|
+
def _deserialize(type, value)
|
160
|
+
case type.to_sym
|
161
|
+
when :DateTime
|
162
|
+
DateTime.parse(value)
|
163
|
+
when :Date
|
164
|
+
Date.parse(value)
|
165
|
+
when :String
|
166
|
+
value.to_s
|
167
|
+
when :Integer
|
168
|
+
value.to_i
|
169
|
+
when :Float
|
170
|
+
value.to_f
|
171
|
+
when :Boolean
|
172
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
173
|
+
true
|
174
|
+
else
|
175
|
+
false
|
176
|
+
end
|
177
|
+
when :Object
|
178
|
+
# generic object (usually a Hash), return directly
|
179
|
+
value
|
180
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
181
|
+
inner_type = Regexp.last_match[:inner_type]
|
182
|
+
value.map { |v| _deserialize(inner_type, v) }
|
183
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
184
|
+
k_type = Regexp.last_match[:k_type]
|
185
|
+
v_type = Regexp.last_match[:v_type]
|
186
|
+
{}.tap do |hash|
|
187
|
+
value.each do |k, v|
|
188
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
189
|
+
end
|
190
|
+
end
|
191
|
+
else # model
|
192
|
+
PulpPythonClient.const_get(type).build_from_hash(value)
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
# Returns the string representation of the object
|
197
|
+
# @return [String] String presentation of the object
|
198
|
+
def to_s
|
199
|
+
to_hash.to_s
|
200
|
+
end
|
201
|
+
|
202
|
+
# to_body is an alias to to_hash (backward compatibility)
|
203
|
+
# @return [Hash] Returns the object in the form of hash
|
204
|
+
def to_body
|
205
|
+
to_hash
|
206
|
+
end
|
207
|
+
|
208
|
+
# Returns the object in the form of hash
|
209
|
+
# @return [Hash] Returns the object in the form of hash
|
210
|
+
def to_hash
|
211
|
+
hash = {}
|
212
|
+
self.class.attribute_map.each_pair do |attr, param|
|
213
|
+
value = self.send(attr)
|
214
|
+
if value.nil?
|
215
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
216
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
217
|
+
end
|
218
|
+
|
219
|
+
hash[param] = _to_hash(value)
|
220
|
+
end
|
221
|
+
hash
|
222
|
+
end
|
223
|
+
|
224
|
+
# Outputs non-array value in the form of hash
|
225
|
+
# For object, use to_hash. Otherwise, just return the value
|
226
|
+
# @param [Object] value Any valid value
|
227
|
+
# @return [Hash] Returns the value in the form of hash
|
228
|
+
def _to_hash(value)
|
229
|
+
if value.is_a?(Array)
|
230
|
+
value.compact.map { |v| _to_hash(v) }
|
231
|
+
elsif value.is_a?(Hash)
|
232
|
+
{}.tap do |hash|
|
233
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
234
|
+
end
|
235
|
+
elsif value.respond_to? :to_hash
|
236
|
+
value.to_hash
|
237
|
+
else
|
238
|
+
value
|
239
|
+
end
|
240
|
+
end
|
241
|
+
end
|
242
|
+
end
|
@@ -0,0 +1,242 @@
|
|
1
|
+
=begin
|
2
|
+
#Pulp 3 API
|
3
|
+
|
4
|
+
#Fetch, Upload, Organize, and Distribute Software Packages
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v3
|
7
|
+
Contact: pulp-list@redhat.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module PulpPythonClient
|
16
|
+
# Serializer for synchronously setting a label.
|
17
|
+
class UnsetLabelResponse
|
18
|
+
attr_accessor :key
|
19
|
+
|
20
|
+
attr_accessor :value
|
21
|
+
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
23
|
+
def self.attribute_map
|
24
|
+
{
|
25
|
+
:'key' => :'key',
|
26
|
+
:'value' => :'value'
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
# Attribute type mapping.
|
31
|
+
def self.openapi_types
|
32
|
+
{
|
33
|
+
:'key' => :'String',
|
34
|
+
:'value' => :'String'
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# List of attributes with nullable: true
|
39
|
+
def self.openapi_nullable
|
40
|
+
Set.new([
|
41
|
+
])
|
42
|
+
end
|
43
|
+
|
44
|
+
# Initializes the object
|
45
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
46
|
+
def initialize(attributes = {})
|
47
|
+
if (!attributes.is_a?(Hash))
|
48
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpPythonClient::UnsetLabelResponse` initialize method"
|
49
|
+
end
|
50
|
+
|
51
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
52
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
53
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
54
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpPythonClient::UnsetLabelResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
55
|
+
end
|
56
|
+
h[k.to_sym] = v
|
57
|
+
}
|
58
|
+
|
59
|
+
if attributes.key?(:'key')
|
60
|
+
self.key = attributes[:'key']
|
61
|
+
end
|
62
|
+
|
63
|
+
if attributes.key?(:'value')
|
64
|
+
self.value = attributes[:'value']
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
69
|
+
# @return Array for valid properties with the reasons
|
70
|
+
def list_invalid_properties
|
71
|
+
invalid_properties = Array.new
|
72
|
+
if @key.nil?
|
73
|
+
invalid_properties.push('invalid value for "key", key cannot be nil.')
|
74
|
+
end
|
75
|
+
|
76
|
+
pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
77
|
+
if @key !~ pattern
|
78
|
+
invalid_properties.push("invalid value for \"key\", must conform to the pattern #{pattern}.")
|
79
|
+
end
|
80
|
+
|
81
|
+
invalid_properties
|
82
|
+
end
|
83
|
+
|
84
|
+
# Check to see if the all the properties in the model are valid
|
85
|
+
# @return true if the model is valid
|
86
|
+
def valid?
|
87
|
+
return false if @key.nil?
|
88
|
+
return false if @key !~ Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
89
|
+
true
|
90
|
+
end
|
91
|
+
|
92
|
+
# Custom attribute writer method with validation
|
93
|
+
# @param [Object] key Value to be assigned
|
94
|
+
def key=(key)
|
95
|
+
if key.nil?
|
96
|
+
fail ArgumentError, 'key cannot be nil'
|
97
|
+
end
|
98
|
+
|
99
|
+
pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
100
|
+
if key !~ pattern
|
101
|
+
fail ArgumentError, "invalid value for \"key\", must conform to the pattern #{pattern}."
|
102
|
+
end
|
103
|
+
|
104
|
+
@key = key
|
105
|
+
end
|
106
|
+
|
107
|
+
# Checks equality by comparing each attribute.
|
108
|
+
# @param [Object] Object to be compared
|
109
|
+
def ==(o)
|
110
|
+
return true if self.equal?(o)
|
111
|
+
self.class == o.class &&
|
112
|
+
key == o.key &&
|
113
|
+
value == o.value
|
114
|
+
end
|
115
|
+
|
116
|
+
# @see the `==` method
|
117
|
+
# @param [Object] Object to be compared
|
118
|
+
def eql?(o)
|
119
|
+
self == o
|
120
|
+
end
|
121
|
+
|
122
|
+
# Calculates hash code according to all attributes.
|
123
|
+
# @return [Integer] Hash code
|
124
|
+
def hash
|
125
|
+
[key, value].hash
|
126
|
+
end
|
127
|
+
|
128
|
+
# Builds the object from hash
|
129
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
130
|
+
# @return [Object] Returns the model itself
|
131
|
+
def self.build_from_hash(attributes)
|
132
|
+
new.build_from_hash(attributes)
|
133
|
+
end
|
134
|
+
|
135
|
+
# Builds the object from hash
|
136
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
137
|
+
# @return [Object] Returns the model itself
|
138
|
+
def build_from_hash(attributes)
|
139
|
+
return nil unless attributes.is_a?(Hash)
|
140
|
+
self.class.openapi_types.each_pair do |key, type|
|
141
|
+
if type =~ /\AArray<(.*)>/i
|
142
|
+
# check to ensure the input is an array given that the attribute
|
143
|
+
# is documented as an array but the input is not
|
144
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
145
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
146
|
+
end
|
147
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
148
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
149
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
150
|
+
end
|
151
|
+
|
152
|
+
self
|
153
|
+
end
|
154
|
+
|
155
|
+
# Deserializes the data based on type
|
156
|
+
# @param string type Data type
|
157
|
+
# @param string value Value to be deserialized
|
158
|
+
# @return [Object] Deserialized data
|
159
|
+
def _deserialize(type, value)
|
160
|
+
case type.to_sym
|
161
|
+
when :DateTime
|
162
|
+
DateTime.parse(value)
|
163
|
+
when :Date
|
164
|
+
Date.parse(value)
|
165
|
+
when :String
|
166
|
+
value.to_s
|
167
|
+
when :Integer
|
168
|
+
value.to_i
|
169
|
+
when :Float
|
170
|
+
value.to_f
|
171
|
+
when :Boolean
|
172
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
173
|
+
true
|
174
|
+
else
|
175
|
+
false
|
176
|
+
end
|
177
|
+
when :Object
|
178
|
+
# generic object (usually a Hash), return directly
|
179
|
+
value
|
180
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
181
|
+
inner_type = Regexp.last_match[:inner_type]
|
182
|
+
value.map { |v| _deserialize(inner_type, v) }
|
183
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
184
|
+
k_type = Regexp.last_match[:k_type]
|
185
|
+
v_type = Regexp.last_match[:v_type]
|
186
|
+
{}.tap do |hash|
|
187
|
+
value.each do |k, v|
|
188
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
189
|
+
end
|
190
|
+
end
|
191
|
+
else # model
|
192
|
+
PulpPythonClient.const_get(type).build_from_hash(value)
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
# Returns the string representation of the object
|
197
|
+
# @return [String] String presentation of the object
|
198
|
+
def to_s
|
199
|
+
to_hash.to_s
|
200
|
+
end
|
201
|
+
|
202
|
+
# to_body is an alias to to_hash (backward compatibility)
|
203
|
+
# @return [Hash] Returns the object in the form of hash
|
204
|
+
def to_body
|
205
|
+
to_hash
|
206
|
+
end
|
207
|
+
|
208
|
+
# Returns the object in the form of hash
|
209
|
+
# @return [Hash] Returns the object in the form of hash
|
210
|
+
def to_hash
|
211
|
+
hash = {}
|
212
|
+
self.class.attribute_map.each_pair do |attr, param|
|
213
|
+
value = self.send(attr)
|
214
|
+
if value.nil?
|
215
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
216
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
217
|
+
end
|
218
|
+
|
219
|
+
hash[param] = _to_hash(value)
|
220
|
+
end
|
221
|
+
hash
|
222
|
+
end
|
223
|
+
|
224
|
+
# Outputs non-array value in the form of hash
|
225
|
+
# For object, use to_hash. Otherwise, just return the value
|
226
|
+
# @param [Object] value Any valid value
|
227
|
+
# @return [Hash] Returns the value in the form of hash
|
228
|
+
def _to_hash(value)
|
229
|
+
if value.is_a?(Array)
|
230
|
+
value.compact.map { |v| _to_hash(v) }
|
231
|
+
elsif value.is_a?(Hash)
|
232
|
+
{}.tap do |hash|
|
233
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
234
|
+
end
|
235
|
+
elsif value.respond_to? :to_hash
|
236
|
+
value.to_hash
|
237
|
+
else
|
238
|
+
value
|
239
|
+
end
|
240
|
+
end
|
241
|
+
end
|
242
|
+
end
|
data/lib/pulp_python_client.rb
CHANGED
@@ -50,7 +50,11 @@ require 'pulp_python_client/models/repair'
|
|
50
50
|
require 'pulp_python_client/models/repository_add_remove_content'
|
51
51
|
require 'pulp_python_client/models/repository_sync_url'
|
52
52
|
require 'pulp_python_client/models/repository_version_response'
|
53
|
+
require 'pulp_python_client/models/set_label'
|
54
|
+
require 'pulp_python_client/models/set_label_response'
|
53
55
|
require 'pulp_python_client/models/summary_response'
|
56
|
+
require 'pulp_python_client/models/unset_label'
|
57
|
+
require 'pulp_python_client/models/unset_label_response'
|
54
58
|
|
55
59
|
# APIs
|
56
60
|
require 'pulp_python_client/api/content_packages_api'
|
@@ -37,10 +37,10 @@ describe 'ContentPackagesApi' do
|
|
37
37
|
# Trigger an asynchronous task to create content,optionally create new repository version.
|
38
38
|
# @param relative_path Path where the artifact is located relative to distributions base_path
|
39
39
|
# @param [Hash] opts the optional parameters
|
40
|
-
# @option opts [String] :artifact Artifact file representing the physical content
|
41
|
-
# @option opts [File] :file An uploaded file that may be turned into the artifact of the content unit.
|
42
40
|
# @option opts [String] :repository A URI of a repository the new content unit should be associated with.
|
43
|
-
# @option opts [String] :
|
41
|
+
# @option opts [String] :artifact Artifact file representing the physical content
|
42
|
+
# @option opts [File] :file An uploaded file that may be turned into the content unit.
|
43
|
+
# @option opts [String] :upload An uncommitted upload that may be turned into the content unit.
|
44
44
|
# @option opts [String] :sha256 The SHA256 digest of this package.
|
45
45
|
# @option opts [String] :summary A one-line summary of what the package does.
|
46
46
|
# @option opts [String] :description A longer description of the package that can run to several paragraphs.
|
@@ -85,9 +85,12 @@ describe 'ContentPackagesApi' do
|
|
85
85
|
# @option opts [String] :name Filter results where name matches value
|
86
86
|
# @option opts [Array<String>] :name__in Filter results where name is in a comma-separated list of values
|
87
87
|
# @option opts [Integer] :offset The initial index from which to return the results.
|
88
|
-
# @option opts [Array<String>] :ordering Ordering
|
89
|
-
# @option opts [String] :packagetype Filter results where packagetype matches value
|
88
|
+
# @option opts [Array<String>] :ordering Ordering * `pulp_id` - Pulp id * `-pulp_id` - Pulp id (descending) * `pulp_created` - Pulp created * `-pulp_created` - Pulp created (descending) * `pulp_last_updated` - Pulp last updated * `-pulp_last_updated` - Pulp last updated (descending) * `pulp_type` - Pulp type * `-pulp_type` - Pulp type (descending) * `upstream_id` - Upstream id * `-upstream_id` - Upstream id (descending) * `timestamp_of_interest` - Timestamp of interest * `-timestamp_of_interest` - Timestamp of interest (descending) * `filename` - Filename * `-filename` - Filename (descending) * `packagetype` - Packagetype * `-packagetype` - Packagetype (descending) * `name` - Name * `-name` - Name (descending) * `version` - Version * `-version` - Version (descending) * `sha256` - Sha256 * `-sha256` - Sha256 (descending) * `python_version` - Python version * `-python_version` - Python version (descending) * `metadata_version` - Metadata version * `-metadata_version` - Metadata version (descending) * `summary` - Summary * `-summary` - Summary (descending) * `description` - Description * `-description` - Description (descending) * `keywords` - Keywords * `-keywords` - Keywords (descending) * `home_page` - Home page * `-home_page` - Home page (descending) * `download_url` - Download url * `-download_url` - Download url (descending) * `author` - Author * `-author` - Author (descending) * `author_email` - Author email * `-author_email` - Author email (descending) * `maintainer` - Maintainer * `-maintainer` - Maintainer (descending) * `maintainer_email` - Maintainer email * `-maintainer_email` - Maintainer email (descending) * `license` - License * `-license` - License (descending) * `requires_python` - Requires python * `-requires_python` - Requires python (descending) * `project_url` - Project url * `-project_url` - Project url (descending) * `platform` - Platform * `-platform` - Platform (descending) * `supported_platform` - Supported platform * `-supported_platform` - Supported platform (descending) * `requires_dist` - Requires dist * `-requires_dist` - Requires dist (descending) * `provides_dist` - Provides dist * `-provides_dist` - Provides dist (descending) * `obsoletes_dist` - Obsoletes dist * `-obsoletes_dist` - Obsoletes dist (descending) * `requires_external` - Requires external * `-requires_external` - Requires external (descending) * `classifiers` - Classifiers * `-classifiers` - Classifiers (descending) * `project_urls` - Project urls * `-project_urls` - Project urls (descending) * `description_content_type` - Description content type * `-description_content_type` - Description content type (descending) * `pk` - Pk * `-pk` - Pk (descending)
|
89
|
+
# @option opts [String] :packagetype Filter results where packagetype matches value * `bdist_dmg` - bdist_dmg * `bdist_dumb` - bdist_dumb * `bdist_egg` - bdist_egg * `bdist_msi` - bdist_msi * `bdist_rpm` - bdist_rpm * `bdist_wheel` - bdist_wheel * `bdist_wininst` - bdist_wininst * `sdist` - sdist
|
90
90
|
# @option opts [Array<String>] :packagetype__in Filter results where packagetype is in a comma-separated list of values
|
91
|
+
# @option opts [Array<String>] :pulp_href__in Multiple values may be separated by commas.
|
92
|
+
# @option opts [Array<String>] :pulp_id__in Multiple values may be separated by commas.
|
93
|
+
# @option opts [String] :q
|
91
94
|
# @option opts [String] :repository_version Repository Version referenced by HREF
|
92
95
|
# @option opts [String] :repository_version_added Repository Version referenced by HREF
|
93
96
|
# @option opts [String] :repository_version_removed Repository Version referenced by HREF
|
@@ -68,11 +68,18 @@ describe 'DistributionsPypiApi' do
|
|
68
68
|
# @option opts [String] :name Filter results where name matches value
|
69
69
|
# @option opts [String] :name__contains Filter results where name contains value
|
70
70
|
# @option opts [String] :name__icontains Filter results where name contains value
|
71
|
+
# @option opts [String] :name__iexact Filter results where name matches value
|
71
72
|
# @option opts [Array<String>] :name__in Filter results where name is in a comma-separated list of values
|
73
|
+
# @option opts [String] :name__iregex Filter results where name matches regex value
|
74
|
+
# @option opts [String] :name__istartswith Filter results where name starts with value
|
75
|
+
# @option opts [String] :name__regex Filter results where name matches regex value
|
72
76
|
# @option opts [String] :name__startswith Filter results where name starts with value
|
73
77
|
# @option opts [Integer] :offset The initial index from which to return the results.
|
74
|
-
# @option opts [Array<String>] :ordering Ordering
|
78
|
+
# @option opts [Array<String>] :ordering Ordering * `pulp_id` - Pulp id * `-pulp_id` - Pulp id (descending) * `pulp_created` - Pulp created * `-pulp_created` - Pulp created (descending) * `pulp_last_updated` - Pulp last updated * `-pulp_last_updated` - Pulp last updated (descending) * `pulp_type` - Pulp type * `-pulp_type` - Pulp type (descending) * `name` - Name * `-name` - Name (descending) * `pulp_labels` - Pulp labels * `-pulp_labels` - Pulp labels (descending) * `base_path` - Base path * `-base_path` - Base path (descending) * `hidden` - Hidden * `-hidden` - Hidden (descending) * `pk` - Pk * `-pk` - Pk (descending)
|
79
|
+
# @option opts [Array<String>] :pulp_href__in Multiple values may be separated by commas.
|
80
|
+
# @option opts [Array<String>] :pulp_id__in Multiple values may be separated by commas.
|
75
81
|
# @option opts [String] :pulp_label_select Filter labels by search string
|
82
|
+
# @option opts [String] :q
|
76
83
|
# @option opts [String] :repository Filter results where repository matches value
|
77
84
|
# @option opts [Array<String>] :repository__in Filter results where repository is in a comma-separated list of values
|
78
85
|
# @option opts [String] :with_content Filter distributions based on the content served by them
|
@@ -112,6 +119,32 @@ describe 'DistributionsPypiApi' do
|
|
112
119
|
end
|
113
120
|
end
|
114
121
|
|
122
|
+
# unit tests for set_label
|
123
|
+
# Set a label
|
124
|
+
# Set a single pulp_label on the object to a specific value or null.
|
125
|
+
# @param python_python_distribution_href
|
126
|
+
# @param set_label
|
127
|
+
# @param [Hash] opts the optional parameters
|
128
|
+
# @return [SetLabelResponse]
|
129
|
+
describe 'set_label test' do
|
130
|
+
it 'should work' do
|
131
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
# unit tests for unset_label
|
136
|
+
# Unset a label
|
137
|
+
# Unset a single pulp_label on the object.
|
138
|
+
# @param python_python_distribution_href
|
139
|
+
# @param unset_label
|
140
|
+
# @param [Hash] opts the optional parameters
|
141
|
+
# @return [UnsetLabelResponse]
|
142
|
+
describe 'unset_label test' do
|
143
|
+
it 'should work' do
|
144
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
115
148
|
# unit tests for update
|
116
149
|
# Update a python distribution
|
117
150
|
# Trigger an asynchronous update task
|
@@ -64,13 +64,16 @@ describe 'PublicationsPypiApi' do
|
|
64
64
|
# @option opts [String] :content__in Content Unit referenced by HREF
|
65
65
|
# @option opts [Integer] :limit Number of results to return per page.
|
66
66
|
# @option opts [Integer] :offset The initial index from which to return the results.
|
67
|
-
# @option opts [Array<String>] :ordering Ordering
|
67
|
+
# @option opts [Array<String>] :ordering Ordering * `pulp_id` - Pulp id * `-pulp_id` - Pulp id (descending) * `pulp_created` - Pulp created * `-pulp_created` - Pulp created (descending) * `pulp_last_updated` - Pulp last updated * `-pulp_last_updated` - Pulp last updated (descending) * `pulp_type` - Pulp type * `-pulp_type` - Pulp type (descending) * `complete` - Complete * `-complete` - Complete (descending) * `pass_through` - Pass through * `-pass_through` - Pass through (descending) * `pk` - Pk * `-pk` - Pk (descending)
|
68
68
|
# @option opts [DateTime] :pulp_created Filter results where pulp_created matches value
|
69
69
|
# @option opts [DateTime] :pulp_created__gt Filter results where pulp_created is greater than value
|
70
70
|
# @option opts [DateTime] :pulp_created__gte Filter results where pulp_created is greater than or equal to value
|
71
71
|
# @option opts [DateTime] :pulp_created__lt Filter results where pulp_created is less than value
|
72
72
|
# @option opts [DateTime] :pulp_created__lte Filter results where pulp_created is less than or equal to value
|
73
73
|
# @option opts [Array<DateTime>] :pulp_created__range Filter results where pulp_created is between two comma separated values
|
74
|
+
# @option opts [Array<String>] :pulp_href__in Multiple values may be separated by commas.
|
75
|
+
# @option opts [Array<String>] :pulp_id__in Multiple values may be separated by commas.
|
76
|
+
# @option opts [String] :q
|
74
77
|
# @option opts [String] :repository Repository referenced by HREF
|
75
78
|
# @option opts [String] :repository_version Repository Version referenced by HREF
|
76
79
|
# @option opts [Array<String>] :fields A list of fields to include in the response.
|