pulp_rpm_client 3.0.0b5 → 3.0.0b6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -6
- data/docs/ContentAdvisoriesApi.md +3 -3
- data/docs/ContentModulemdApi.md +210 -0
- data/docs/ContentModulemdDefaultsApi.md +200 -0
- data/docs/ContentPackagesApi.md +17 -9
- data/docs/DistributionTreesDistributionTreesApi.md +2 -2
- data/docs/DistributionsRpmApi.md +2 -2
- data/docs/InlineResponse2001.md +1 -1
- data/docs/InlineResponse2002.md +1 -1
- data/docs/InlineResponse2003.md +1 -1
- data/docs/InlineResponse2004.md +1 -1
- data/docs/InlineResponse2005.md +1 -1
- data/docs/InlineResponse2006.md +1 -1
- data/docs/InlineResponse2007.md +23 -0
- data/docs/InlineResponse2008.md +23 -0
- data/docs/Modulemd.md +45 -0
- data/docs/ModulemdDefaults.md +35 -0
- data/docs/Package.md +23 -19
- data/docs/PublicationsRpmApi.md +2 -2
- data/docs/RemotesRpmApi.md +2 -2
- data/docs/RepoMetadataFile.md +5 -1
- data/docs/RepoMetadataFilesRepoMetadataFilesApi.md +2 -2
- data/docs/RpmCopyApi.md +1 -1
- data/lib/pulp_rpm_client/api/content_advisories_api.rb +5 -5
- data/lib/pulp_rpm_client/api/content_modulemd_api.rb +319 -0
- data/lib/pulp_rpm_client/api/content_modulemd_defaults_api.rb +272 -0
- data/lib/pulp_rpm_client/api/content_packages_api.rb +32 -18
- data/lib/pulp_rpm_client/api/distribution_trees_distribution_trees_api.rb +3 -3
- data/lib/pulp_rpm_client/api/distributions_rpm_api.rb +3 -3
- data/lib/pulp_rpm_client/api/publications_rpm_api.rb +3 -3
- data/lib/pulp_rpm_client/api/remotes_rpm_api.rb +3 -3
- data/lib/pulp_rpm_client/api/repo_metadata_files_repo_metadata_files_api.rb +3 -3
- data/lib/pulp_rpm_client/api/rpm_copy_api.rb +1 -1
- data/lib/pulp_rpm_client/models/inline_response2001.rb +1 -1
- data/lib/pulp_rpm_client/models/inline_response2002.rb +1 -1
- data/lib/pulp_rpm_client/models/inline_response2003.rb +1 -1
- data/lib/pulp_rpm_client/models/inline_response2004.rb +1 -1
- data/lib/pulp_rpm_client/models/inline_response2005.rb +1 -1
- data/lib/pulp_rpm_client/models/inline_response2006.rb +1 -1
- data/lib/pulp_rpm_client/models/inline_response2007.rb +235 -0
- data/lib/pulp_rpm_client/models/inline_response2008.rb +235 -0
- data/lib/pulp_rpm_client/models/modulemd.rb +544 -0
- data/lib/pulp_rpm_client/models/modulemd_defaults.rb +396 -0
- data/lib/pulp_rpm_client/models/package.rb +73 -156
- data/lib/pulp_rpm_client/models/repo_metadata_file.rb +21 -6
- data/lib/pulp_rpm_client/version.rb +1 -1
- data/lib/pulp_rpm_client.rb +6 -1
- data/spec/api/content_advisories_api_spec.rb +2 -2
- data/spec/api/content_modulemd_api_spec.rb +88 -0
- data/spec/api/content_modulemd_defaults_api_spec.rb +83 -0
- data/spec/api/content_packages_api_spec.rb +7 -4
- data/spec/api/distribution_trees_distribution_trees_api_spec.rb +1 -1
- data/spec/api/distributions_rpm_api_spec.rb +1 -1
- data/spec/api/publications_rpm_api_spec.rb +1 -1
- data/spec/api/remotes_rpm_api_spec.rb +1 -1
- data/spec/api/repo_metadata_files_repo_metadata_files_api_spec.rb +1 -1
- data/spec/models/inline_response2007_spec.rb +59 -0
- data/spec/models/inline_response2008_spec.rb +59 -0
- data/spec/models/modulemd_defaults_spec.rb +95 -0
- data/spec/models/modulemd_spec.rb +125 -0
- data/spec/models/package_spec.rb +16 -4
- data/spec/models/repo_metadata_file_spec.rb +12 -0
- metadata +26 -6
- data/docs/RpmUploadApi.md +0 -66
- data/lib/pulp_rpm_client/api/rpm_upload_api.rb +0 -90
- data/spec/api/rpm_upload_api_spec.rb +0 -48
@@ -0,0 +1,396 @@
|
|
1
|
+
=begin
|
2
|
+
#Pulp 3 API
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v3
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.1.3-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module PulpRpmClient
|
16
|
+
class ModulemdDefaults
|
17
|
+
attr_accessor :_href
|
18
|
+
|
19
|
+
# Timestamp of creation.
|
20
|
+
attr_accessor :_created
|
21
|
+
|
22
|
+
attr_accessor :_type
|
23
|
+
|
24
|
+
# Artifact file representing the physical content
|
25
|
+
attr_accessor :artifact
|
26
|
+
|
27
|
+
# Path where the artifact is located relative to distributions base_path
|
28
|
+
attr_accessor :relative_path
|
29
|
+
|
30
|
+
# An uploaded file that should be turned into the artifact of the content unit.
|
31
|
+
attr_accessor :file
|
32
|
+
|
33
|
+
# A URI of a repository the new content unit should be associated with.
|
34
|
+
attr_accessor :repository
|
35
|
+
|
36
|
+
# Modulemd name.
|
37
|
+
attr_accessor :_module
|
38
|
+
|
39
|
+
# Modulemd default stream.
|
40
|
+
attr_accessor :stream
|
41
|
+
|
42
|
+
# Default profiles for modulemd streams.
|
43
|
+
attr_accessor :profiles
|
44
|
+
|
45
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
46
|
+
def self.attribute_map
|
47
|
+
{
|
48
|
+
:'_href' => :'_href',
|
49
|
+
:'_created' => :'_created',
|
50
|
+
:'_type' => :'_type',
|
51
|
+
:'artifact' => :'artifact',
|
52
|
+
:'relative_path' => :'relative_path',
|
53
|
+
:'file' => :'file',
|
54
|
+
:'repository' => :'repository',
|
55
|
+
:'_module' => :'module',
|
56
|
+
:'stream' => :'stream',
|
57
|
+
:'profiles' => :'profiles'
|
58
|
+
}
|
59
|
+
end
|
60
|
+
|
61
|
+
# Attribute type mapping.
|
62
|
+
def self.openapi_types
|
63
|
+
{
|
64
|
+
:'_href' => :'String',
|
65
|
+
:'_created' => :'DateTime',
|
66
|
+
:'_type' => :'String',
|
67
|
+
:'artifact' => :'String',
|
68
|
+
:'relative_path' => :'String',
|
69
|
+
:'file' => :'String',
|
70
|
+
:'repository' => :'String',
|
71
|
+
:'_module' => :'String',
|
72
|
+
:'stream' => :'String',
|
73
|
+
:'profiles' => :'String'
|
74
|
+
}
|
75
|
+
end
|
76
|
+
|
77
|
+
# Initializes the object
|
78
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
79
|
+
def initialize(attributes = {})
|
80
|
+
if (!attributes.is_a?(Hash))
|
81
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpRpmClient::ModulemdDefaults` initialize method"
|
82
|
+
end
|
83
|
+
|
84
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
85
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
86
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
87
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpRpmClient::ModulemdDefaults`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
88
|
+
end
|
89
|
+
h[k.to_sym] = v
|
90
|
+
}
|
91
|
+
|
92
|
+
if attributes.key?(:'_href')
|
93
|
+
self._href = attributes[:'_href']
|
94
|
+
end
|
95
|
+
|
96
|
+
if attributes.key?(:'_created')
|
97
|
+
self._created = attributes[:'_created']
|
98
|
+
end
|
99
|
+
|
100
|
+
if attributes.key?(:'_type')
|
101
|
+
self._type = attributes[:'_type']
|
102
|
+
end
|
103
|
+
|
104
|
+
if attributes.key?(:'artifact')
|
105
|
+
self.artifact = attributes[:'artifact']
|
106
|
+
end
|
107
|
+
|
108
|
+
if attributes.key?(:'relative_path')
|
109
|
+
self.relative_path = attributes[:'relative_path']
|
110
|
+
end
|
111
|
+
|
112
|
+
if attributes.key?(:'file')
|
113
|
+
self.file = attributes[:'file']
|
114
|
+
end
|
115
|
+
|
116
|
+
if attributes.key?(:'repository')
|
117
|
+
self.repository = attributes[:'repository']
|
118
|
+
end
|
119
|
+
|
120
|
+
if attributes.key?(:'_module')
|
121
|
+
self._module = attributes[:'_module']
|
122
|
+
end
|
123
|
+
|
124
|
+
if attributes.key?(:'stream')
|
125
|
+
self.stream = attributes[:'stream']
|
126
|
+
end
|
127
|
+
|
128
|
+
if attributes.key?(:'profiles')
|
129
|
+
self.profiles = attributes[:'profiles']
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
134
|
+
# @return Array for valid properties with the reasons
|
135
|
+
def list_invalid_properties
|
136
|
+
invalid_properties = Array.new
|
137
|
+
if !@_type.nil? && @_type.to_s.length < 1
|
138
|
+
invalid_properties.push('invalid value for "_type", the character length must be great than or equal to 1.')
|
139
|
+
end
|
140
|
+
|
141
|
+
if @relative_path.nil?
|
142
|
+
invalid_properties.push('invalid value for "relative_path", relative_path cannot be nil.')
|
143
|
+
end
|
144
|
+
|
145
|
+
if @relative_path.to_s.length < 1
|
146
|
+
invalid_properties.push('invalid value for "relative_path", the character length must be great than or equal to 1.')
|
147
|
+
end
|
148
|
+
|
149
|
+
if @_module.nil?
|
150
|
+
invalid_properties.push('invalid value for "_module", _module cannot be nil.')
|
151
|
+
end
|
152
|
+
|
153
|
+
if @_module.to_s.length < 1
|
154
|
+
invalid_properties.push('invalid value for "_module", the character length must be great than or equal to 1.')
|
155
|
+
end
|
156
|
+
|
157
|
+
if @stream.nil?
|
158
|
+
invalid_properties.push('invalid value for "stream", stream cannot be nil.')
|
159
|
+
end
|
160
|
+
|
161
|
+
if @stream.to_s.length < 1
|
162
|
+
invalid_properties.push('invalid value for "stream", the character length must be great than or equal to 1.')
|
163
|
+
end
|
164
|
+
|
165
|
+
if @profiles.nil?
|
166
|
+
invalid_properties.push('invalid value for "profiles", profiles cannot be nil.')
|
167
|
+
end
|
168
|
+
|
169
|
+
if @profiles.to_s.length < 1
|
170
|
+
invalid_properties.push('invalid value for "profiles", the character length must be great than or equal to 1.')
|
171
|
+
end
|
172
|
+
|
173
|
+
invalid_properties
|
174
|
+
end
|
175
|
+
|
176
|
+
# Check to see if the all the properties in the model are valid
|
177
|
+
# @return true if the model is valid
|
178
|
+
def valid?
|
179
|
+
return false if !@_type.nil? && @_type.to_s.length < 1
|
180
|
+
return false if @relative_path.nil?
|
181
|
+
return false if @relative_path.to_s.length < 1
|
182
|
+
return false if @_module.nil?
|
183
|
+
return false if @_module.to_s.length < 1
|
184
|
+
return false if @stream.nil?
|
185
|
+
return false if @stream.to_s.length < 1
|
186
|
+
return false if @profiles.nil?
|
187
|
+
return false if @profiles.to_s.length < 1
|
188
|
+
true
|
189
|
+
end
|
190
|
+
|
191
|
+
# Custom attribute writer method with validation
|
192
|
+
# @param [Object] _type Value to be assigned
|
193
|
+
def _type=(_type)
|
194
|
+
if !_type.nil? && _type.to_s.length < 1
|
195
|
+
fail ArgumentError, 'invalid value for "_type", the character length must be great than or equal to 1.'
|
196
|
+
end
|
197
|
+
|
198
|
+
@_type = _type
|
199
|
+
end
|
200
|
+
|
201
|
+
# Custom attribute writer method with validation
|
202
|
+
# @param [Object] relative_path Value to be assigned
|
203
|
+
def relative_path=(relative_path)
|
204
|
+
if relative_path.nil?
|
205
|
+
fail ArgumentError, 'relative_path cannot be nil'
|
206
|
+
end
|
207
|
+
|
208
|
+
if relative_path.to_s.length < 1
|
209
|
+
fail ArgumentError, 'invalid value for "relative_path", the character length must be great than or equal to 1.'
|
210
|
+
end
|
211
|
+
|
212
|
+
@relative_path = relative_path
|
213
|
+
end
|
214
|
+
|
215
|
+
# Custom attribute writer method with validation
|
216
|
+
# @param [Object] _module Value to be assigned
|
217
|
+
def _module=(_module)
|
218
|
+
if _module.nil?
|
219
|
+
fail ArgumentError, '_module cannot be nil'
|
220
|
+
end
|
221
|
+
|
222
|
+
if _module.to_s.length < 1
|
223
|
+
fail ArgumentError, 'invalid value for "_module", the character length must be great than or equal to 1.'
|
224
|
+
end
|
225
|
+
|
226
|
+
@_module = _module
|
227
|
+
end
|
228
|
+
|
229
|
+
# Custom attribute writer method with validation
|
230
|
+
# @param [Object] stream Value to be assigned
|
231
|
+
def stream=(stream)
|
232
|
+
if stream.nil?
|
233
|
+
fail ArgumentError, 'stream cannot be nil'
|
234
|
+
end
|
235
|
+
|
236
|
+
if stream.to_s.length < 1
|
237
|
+
fail ArgumentError, 'invalid value for "stream", the character length must be great than or equal to 1.'
|
238
|
+
end
|
239
|
+
|
240
|
+
@stream = stream
|
241
|
+
end
|
242
|
+
|
243
|
+
# Custom attribute writer method with validation
|
244
|
+
# @param [Object] profiles Value to be assigned
|
245
|
+
def profiles=(profiles)
|
246
|
+
if profiles.nil?
|
247
|
+
fail ArgumentError, 'profiles cannot be nil'
|
248
|
+
end
|
249
|
+
|
250
|
+
if profiles.to_s.length < 1
|
251
|
+
fail ArgumentError, 'invalid value for "profiles", the character length must be great than or equal to 1.'
|
252
|
+
end
|
253
|
+
|
254
|
+
@profiles = profiles
|
255
|
+
end
|
256
|
+
|
257
|
+
# Checks equality by comparing each attribute.
|
258
|
+
# @param [Object] Object to be compared
|
259
|
+
def ==(o)
|
260
|
+
return true if self.equal?(o)
|
261
|
+
self.class == o.class &&
|
262
|
+
_href == o._href &&
|
263
|
+
_created == o._created &&
|
264
|
+
_type == o._type &&
|
265
|
+
artifact == o.artifact &&
|
266
|
+
relative_path == o.relative_path &&
|
267
|
+
file == o.file &&
|
268
|
+
repository == o.repository &&
|
269
|
+
_module == o._module &&
|
270
|
+
stream == o.stream &&
|
271
|
+
profiles == o.profiles
|
272
|
+
end
|
273
|
+
|
274
|
+
# @see the `==` method
|
275
|
+
# @param [Object] Object to be compared
|
276
|
+
def eql?(o)
|
277
|
+
self == o
|
278
|
+
end
|
279
|
+
|
280
|
+
# Calculates hash code according to all attributes.
|
281
|
+
# @return [Integer] Hash code
|
282
|
+
def hash
|
283
|
+
[_href, _created, _type, artifact, relative_path, file, repository, _module, stream, profiles].hash
|
284
|
+
end
|
285
|
+
|
286
|
+
# Builds the object from hash
|
287
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
288
|
+
# @return [Object] Returns the model itself
|
289
|
+
def self.build_from_hash(attributes)
|
290
|
+
new.build_from_hash(attributes)
|
291
|
+
end
|
292
|
+
|
293
|
+
# Builds the object from hash
|
294
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
295
|
+
# @return [Object] Returns the model itself
|
296
|
+
def build_from_hash(attributes)
|
297
|
+
return nil unless attributes.is_a?(Hash)
|
298
|
+
self.class.openapi_types.each_pair do |key, type|
|
299
|
+
if type =~ /\AArray<(.*)>/i
|
300
|
+
# check to ensure the input is an array given that the attribute
|
301
|
+
# is documented as an array but the input is not
|
302
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
303
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
304
|
+
end
|
305
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
306
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
307
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
308
|
+
end
|
309
|
+
|
310
|
+
self
|
311
|
+
end
|
312
|
+
|
313
|
+
# Deserializes the data based on type
|
314
|
+
# @param string type Data type
|
315
|
+
# @param string value Value to be deserialized
|
316
|
+
# @return [Object] Deserialized data
|
317
|
+
def _deserialize(type, value)
|
318
|
+
case type.to_sym
|
319
|
+
when :DateTime
|
320
|
+
DateTime.parse(value)
|
321
|
+
when :Date
|
322
|
+
Date.parse(value)
|
323
|
+
when :String
|
324
|
+
value.to_s
|
325
|
+
when :Integer
|
326
|
+
value.to_i
|
327
|
+
when :Float
|
328
|
+
value.to_f
|
329
|
+
when :Boolean
|
330
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
331
|
+
true
|
332
|
+
else
|
333
|
+
false
|
334
|
+
end
|
335
|
+
when :Object
|
336
|
+
# generic object (usually a Hash), return directly
|
337
|
+
value
|
338
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
339
|
+
inner_type = Regexp.last_match[:inner_type]
|
340
|
+
value.map { |v| _deserialize(inner_type, v) }
|
341
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
342
|
+
k_type = Regexp.last_match[:k_type]
|
343
|
+
v_type = Regexp.last_match[:v_type]
|
344
|
+
{}.tap do |hash|
|
345
|
+
value.each do |k, v|
|
346
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
347
|
+
end
|
348
|
+
end
|
349
|
+
else # model
|
350
|
+
PulpRpmClient.const_get(type).build_from_hash(value)
|
351
|
+
end
|
352
|
+
end
|
353
|
+
|
354
|
+
# Returns the string representation of the object
|
355
|
+
# @return [String] String presentation of the object
|
356
|
+
def to_s
|
357
|
+
to_hash.to_s
|
358
|
+
end
|
359
|
+
|
360
|
+
# to_body is an alias to to_hash (backward compatibility)
|
361
|
+
# @return [Hash] Returns the object in the form of hash
|
362
|
+
def to_body
|
363
|
+
to_hash
|
364
|
+
end
|
365
|
+
|
366
|
+
# Returns the object in the form of hash
|
367
|
+
# @return [Hash] Returns the object in the form of hash
|
368
|
+
def to_hash
|
369
|
+
hash = {}
|
370
|
+
self.class.attribute_map.each_pair do |attr, param|
|
371
|
+
value = self.send(attr)
|
372
|
+
next if value.nil?
|
373
|
+
hash[param] = _to_hash(value)
|
374
|
+
end
|
375
|
+
hash
|
376
|
+
end
|
377
|
+
|
378
|
+
# Outputs non-array value in the form of hash
|
379
|
+
# For object, use to_hash. Otherwise, just return the value
|
380
|
+
# @param [Object] value Any valid value
|
381
|
+
# @return [Hash] Returns the value in the form of hash
|
382
|
+
def _to_hash(value)
|
383
|
+
if value.is_a?(Array)
|
384
|
+
value.compact.map { |v| _to_hash(v) }
|
385
|
+
elsif value.is_a?(Hash)
|
386
|
+
{}.tap do |hash|
|
387
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
388
|
+
end
|
389
|
+
elsif value.respond_to? :to_hash
|
390
|
+
value.to_hash
|
391
|
+
else
|
392
|
+
value
|
393
|
+
end
|
394
|
+
end
|
395
|
+
end
|
396
|
+
end
|