pulp_rpm_client 3.0.0b4.dev0.1561996773 → 3.0.0b5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +21 -6
  3. data/docs/Addon.md +27 -0
  4. data/docs/Artifact.md +35 -0
  5. data/docs/Checksum.md +19 -0
  6. data/docs/ContentAdvisoriesApi.md +12 -6
  7. data/docs/ContentPackagesApi.md +12 -6
  8. data/docs/DistributionTree.md +53 -0
  9. data/docs/DistributionTreesDistributionTreesApi.md +179 -0
  10. data/docs/DistributionsRpmApi.md +14 -8
  11. data/docs/Image.md +23 -0
  12. data/docs/InlineResponse200.md +3 -3
  13. data/docs/InlineResponse2001.md +3 -3
  14. data/docs/InlineResponse2002.md +4 -4
  15. data/docs/InlineResponse2003.md +4 -4
  16. data/docs/InlineResponse2004.md +4 -4
  17. data/docs/InlineResponse2005.md +23 -0
  18. data/docs/InlineResponse2006.md +23 -0
  19. data/docs/Package.md +9 -7
  20. data/docs/PublicationsRpmApi.md +14 -8
  21. data/docs/RemotesRpmApi.md +14 -8
  22. data/docs/RepoMetadataFile.md +31 -0
  23. data/docs/RepoMetadataFilesRepoMetadataFilesApi.md +179 -0
  24. data/docs/Variant.md +37 -0
  25. data/git_push.sh +10 -7
  26. data/lib/pulp_rpm_client/api/content_advisories_api.rb +15 -9
  27. data/lib/pulp_rpm_client/api/content_packages_api.rb +15 -9
  28. data/lib/pulp_rpm_client/api/distribution_trees_distribution_trees_api.rb +212 -0
  29. data/lib/pulp_rpm_client/api/distributions_rpm_api.rb +21 -15
  30. data/lib/pulp_rpm_client/api/publications_rpm_api.rb +19 -13
  31. data/lib/pulp_rpm_client/api/remotes_rpm_api.rb +22 -16
  32. data/lib/pulp_rpm_client/api/repo_metadata_files_repo_metadata_files_api.rb +212 -0
  33. data/lib/pulp_rpm_client/api/rpm_copy_api.rb +2 -2
  34. data/lib/pulp_rpm_client/api/rpm_upload_api.rb +2 -2
  35. data/lib/pulp_rpm_client/api_client.rb +77 -62
  36. data/lib/pulp_rpm_client/api_error.rb +1 -1
  37. data/lib/pulp_rpm_client/configuration.rb +13 -21
  38. data/lib/pulp_rpm_client/models/addon.rb +372 -0
  39. data/lib/pulp_rpm_client/models/artifact.rb +376 -0
  40. data/lib/pulp_rpm_client/models/async_operation_response.rb +1 -1
  41. data/lib/pulp_rpm_client/models/checksum.rb +255 -0
  42. data/lib/pulp_rpm_client/models/distribution_tree.rb +660 -0
  43. data/lib/pulp_rpm_client/models/image.rb +303 -0
  44. data/lib/pulp_rpm_client/models/inline_response200.rb +11 -11
  45. data/lib/pulp_rpm_client/models/inline_response2001.rb +11 -11
  46. data/lib/pulp_rpm_client/models/inline_response2002.rb +12 -12
  47. data/lib/pulp_rpm_client/models/inline_response2003.rb +12 -12
  48. data/lib/pulp_rpm_client/models/inline_response2004.rb +12 -12
  49. data/lib/pulp_rpm_client/models/inline_response2005.rb +235 -0
  50. data/lib/pulp_rpm_client/models/inline_response2006.rb +235 -0
  51. data/lib/pulp_rpm_client/models/package.rb +70 -41
  52. data/lib/pulp_rpm_client/models/repo_metadata_file.rb +381 -0
  53. data/lib/pulp_rpm_client/models/repository_sync_url.rb +1 -1
  54. data/lib/pulp_rpm_client/models/rpm_distribution.rb +1 -1
  55. data/lib/pulp_rpm_client/models/rpm_publication.rb +1 -1
  56. data/lib/pulp_rpm_client/models/rpm_remote.rb +1 -1
  57. data/lib/pulp_rpm_client/models/update_record.rb +1 -1
  58. data/lib/pulp_rpm_client/models/variant.rb +542 -0
  59. data/lib/pulp_rpm_client/version.rb +2 -2
  60. data/lib/pulp_rpm_client.rb +12 -1
  61. data/pulp_rpm_client.gemspec +3 -9
  62. data/spec/api/content_advisories_api_spec.rb +5 -3
  63. data/spec/api/content_packages_api_spec.rb +5 -3
  64. data/spec/api/distribution_trees_distribution_trees_api_spec.rb +74 -0
  65. data/spec/api/distributions_rpm_api_spec.rb +6 -4
  66. data/spec/api/publications_rpm_api_spec.rb +6 -4
  67. data/spec/api/remotes_rpm_api_spec.rb +6 -4
  68. data/spec/api/repo_metadata_files_repo_metadata_files_api_spec.rb +74 -0
  69. data/spec/api/rpm_copy_api_spec.rb +1 -1
  70. data/spec/api/rpm_upload_api_spec.rb +1 -1
  71. data/spec/api_client_spec.rb +1 -39
  72. data/spec/configuration_spec.rb +1 -1
  73. data/spec/models/addon_spec.rb +71 -0
  74. data/spec/models/artifact_spec.rb +95 -0
  75. data/spec/models/async_operation_response_spec.rb +1 -1
  76. data/spec/models/checksum_spec.rb +47 -0
  77. data/spec/models/distribution_tree_spec.rb +149 -0
  78. data/spec/models/image_spec.rb +59 -0
  79. data/spec/models/inline_response2001_spec.rb +4 -4
  80. data/spec/models/inline_response2002_spec.rb +4 -4
  81. data/spec/models/inline_response2003_spec.rb +4 -4
  82. data/spec/models/inline_response2004_spec.rb +4 -4
  83. data/spec/models/inline_response2005_spec.rb +59 -0
  84. data/spec/models/inline_response2006_spec.rb +59 -0
  85. data/spec/models/inline_response200_spec.rb +4 -4
  86. data/spec/models/package_spec.rb +16 -10
  87. data/spec/models/repo_metadata_file_spec.rb +83 -0
  88. data/spec/models/repository_sync_url_spec.rb +1 -1
  89. data/spec/models/rpm_distribution_spec.rb +1 -1
  90. data/spec/models/rpm_publication_spec.rb +1 -1
  91. data/spec/models/rpm_remote_spec.rb +1 -1
  92. data/spec/models/update_record_spec.rb +1 -1
  93. data/spec/models/variant_spec.rb +101 -0
  94. data/spec/spec_helper.rb +1 -1
  95. metadata +50 -133
  96. data/Gemfile.lock +0 -79
@@ -0,0 +1,372 @@
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 Addon
17
+ # Addon id.
18
+ attr_accessor :addon_id
19
+
20
+ # Addon uid.
21
+ attr_accessor :uid
22
+
23
+ # Addon name.
24
+ attr_accessor :name
25
+
26
+ # Addon type.
27
+ attr_accessor :type
28
+
29
+ # Relative path to directory with binary RPMs.
30
+ attr_accessor :packages
31
+
32
+ # A URI of the repository containing the content for this Addon.
33
+ attr_accessor :repository
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'addon_id' => :'addon_id',
39
+ :'uid' => :'uid',
40
+ :'name' => :'name',
41
+ :'type' => :'type',
42
+ :'packages' => :'packages',
43
+ :'repository' => :'repository'
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'addon_id' => :'String',
51
+ :'uid' => :'String',
52
+ :'name' => :'String',
53
+ :'type' => :'String',
54
+ :'packages' => :'String',
55
+ :'repository' => :'String'
56
+ }
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpRpmClient::Addon` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!self.class.attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpRpmClient::Addon`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'addon_id')
75
+ self.addon_id = attributes[:'addon_id']
76
+ end
77
+
78
+ if attributes.key?(:'uid')
79
+ self.uid = attributes[:'uid']
80
+ end
81
+
82
+ if attributes.key?(:'name')
83
+ self.name = attributes[:'name']
84
+ end
85
+
86
+ if attributes.key?(:'type')
87
+ self.type = attributes[:'type']
88
+ end
89
+
90
+ if attributes.key?(:'packages')
91
+ self.packages = attributes[:'packages']
92
+ end
93
+
94
+ if attributes.key?(:'repository')
95
+ self.repository = attributes[:'repository']
96
+ end
97
+ end
98
+
99
+ # Show invalid properties with the reasons. Usually used together with valid?
100
+ # @return Array for valid properties with the reasons
101
+ def list_invalid_properties
102
+ invalid_properties = Array.new
103
+ if @addon_id.nil?
104
+ invalid_properties.push('invalid value for "addon_id", addon_id cannot be nil.')
105
+ end
106
+
107
+ if @addon_id.to_s.length < 1
108
+ invalid_properties.push('invalid value for "addon_id", the character length must be great than or equal to 1.')
109
+ end
110
+
111
+ if @uid.nil?
112
+ invalid_properties.push('invalid value for "uid", uid cannot be nil.')
113
+ end
114
+
115
+ if @uid.to_s.length < 1
116
+ invalid_properties.push('invalid value for "uid", the character length must be great than or equal to 1.')
117
+ end
118
+
119
+ if @name.nil?
120
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
121
+ end
122
+
123
+ if @name.to_s.length < 1
124
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
125
+ end
126
+
127
+ if @type.nil?
128
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
129
+ end
130
+
131
+ if @type.to_s.length < 1
132
+ invalid_properties.push('invalid value for "type", the character length must be great than or equal to 1.')
133
+ end
134
+
135
+ if @packages.nil?
136
+ invalid_properties.push('invalid value for "packages", packages cannot be nil.')
137
+ end
138
+
139
+ if @packages.to_s.length < 1
140
+ invalid_properties.push('invalid value for "packages", the character length must be great than or equal to 1.')
141
+ end
142
+
143
+ if @repository.nil?
144
+ invalid_properties.push('invalid value for "repository", repository cannot be nil.')
145
+ end
146
+
147
+ invalid_properties
148
+ end
149
+
150
+ # Check to see if the all the properties in the model are valid
151
+ # @return true if the model is valid
152
+ def valid?
153
+ return false if @addon_id.nil?
154
+ return false if @addon_id.to_s.length < 1
155
+ return false if @uid.nil?
156
+ return false if @uid.to_s.length < 1
157
+ return false if @name.nil?
158
+ return false if @name.to_s.length < 1
159
+ return false if @type.nil?
160
+ return false if @type.to_s.length < 1
161
+ return false if @packages.nil?
162
+ return false if @packages.to_s.length < 1
163
+ return false if @repository.nil?
164
+ true
165
+ end
166
+
167
+ # Custom attribute writer method with validation
168
+ # @param [Object] addon_id Value to be assigned
169
+ def addon_id=(addon_id)
170
+ if addon_id.nil?
171
+ fail ArgumentError, 'addon_id cannot be nil'
172
+ end
173
+
174
+ if addon_id.to_s.length < 1
175
+ fail ArgumentError, 'invalid value for "addon_id", the character length must be great than or equal to 1.'
176
+ end
177
+
178
+ @addon_id = addon_id
179
+ end
180
+
181
+ # Custom attribute writer method with validation
182
+ # @param [Object] uid Value to be assigned
183
+ def uid=(uid)
184
+ if uid.nil?
185
+ fail ArgumentError, 'uid cannot be nil'
186
+ end
187
+
188
+ if uid.to_s.length < 1
189
+ fail ArgumentError, 'invalid value for "uid", the character length must be great than or equal to 1.'
190
+ end
191
+
192
+ @uid = uid
193
+ end
194
+
195
+ # Custom attribute writer method with validation
196
+ # @param [Object] name Value to be assigned
197
+ def name=(name)
198
+ if name.nil?
199
+ fail ArgumentError, 'name cannot be nil'
200
+ end
201
+
202
+ if name.to_s.length < 1
203
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
204
+ end
205
+
206
+ @name = name
207
+ end
208
+
209
+ # Custom attribute writer method with validation
210
+ # @param [Object] type Value to be assigned
211
+ def type=(type)
212
+ if type.nil?
213
+ fail ArgumentError, 'type cannot be nil'
214
+ end
215
+
216
+ if type.to_s.length < 1
217
+ fail ArgumentError, 'invalid value for "type", the character length must be great than or equal to 1.'
218
+ end
219
+
220
+ @type = type
221
+ end
222
+
223
+ # Custom attribute writer method with validation
224
+ # @param [Object] packages Value to be assigned
225
+ def packages=(packages)
226
+ if packages.nil?
227
+ fail ArgumentError, 'packages cannot be nil'
228
+ end
229
+
230
+ if packages.to_s.length < 1
231
+ fail ArgumentError, 'invalid value for "packages", the character length must be great than or equal to 1.'
232
+ end
233
+
234
+ @packages = packages
235
+ end
236
+
237
+ # Checks equality by comparing each attribute.
238
+ # @param [Object] Object to be compared
239
+ def ==(o)
240
+ return true if self.equal?(o)
241
+ self.class == o.class &&
242
+ addon_id == o.addon_id &&
243
+ uid == o.uid &&
244
+ name == o.name &&
245
+ type == o.type &&
246
+ packages == o.packages &&
247
+ repository == o.repository
248
+ end
249
+
250
+ # @see the `==` method
251
+ # @param [Object] Object to be compared
252
+ def eql?(o)
253
+ self == o
254
+ end
255
+
256
+ # Calculates hash code according to all attributes.
257
+ # @return [Integer] Hash code
258
+ def hash
259
+ [addon_id, uid, name, type, packages, repository].hash
260
+ end
261
+
262
+ # Builds the object from hash
263
+ # @param [Hash] attributes Model attributes in the form of hash
264
+ # @return [Object] Returns the model itself
265
+ def self.build_from_hash(attributes)
266
+ new.build_from_hash(attributes)
267
+ end
268
+
269
+ # Builds the object from hash
270
+ # @param [Hash] attributes Model attributes in the form of hash
271
+ # @return [Object] Returns the model itself
272
+ def build_from_hash(attributes)
273
+ return nil unless attributes.is_a?(Hash)
274
+ self.class.openapi_types.each_pair do |key, type|
275
+ if type =~ /\AArray<(.*)>/i
276
+ # check to ensure the input is an array given that the attribute
277
+ # is documented as an array but the input is not
278
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
279
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
280
+ end
281
+ elsif !attributes[self.class.attribute_map[key]].nil?
282
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
283
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
284
+ end
285
+
286
+ self
287
+ end
288
+
289
+ # Deserializes the data based on type
290
+ # @param string type Data type
291
+ # @param string value Value to be deserialized
292
+ # @return [Object] Deserialized data
293
+ def _deserialize(type, value)
294
+ case type.to_sym
295
+ when :DateTime
296
+ DateTime.parse(value)
297
+ when :Date
298
+ Date.parse(value)
299
+ when :String
300
+ value.to_s
301
+ when :Integer
302
+ value.to_i
303
+ when :Float
304
+ value.to_f
305
+ when :Boolean
306
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
307
+ true
308
+ else
309
+ false
310
+ end
311
+ when :Object
312
+ # generic object (usually a Hash), return directly
313
+ value
314
+ when /\AArray<(?<inner_type>.+)>\z/
315
+ inner_type = Regexp.last_match[:inner_type]
316
+ value.map { |v| _deserialize(inner_type, v) }
317
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
318
+ k_type = Regexp.last_match[:k_type]
319
+ v_type = Regexp.last_match[:v_type]
320
+ {}.tap do |hash|
321
+ value.each do |k, v|
322
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
323
+ end
324
+ end
325
+ else # model
326
+ PulpRpmClient.const_get(type).build_from_hash(value)
327
+ end
328
+ end
329
+
330
+ # Returns the string representation of the object
331
+ # @return [String] String presentation of the object
332
+ def to_s
333
+ to_hash.to_s
334
+ end
335
+
336
+ # to_body is an alias to to_hash (backward compatibility)
337
+ # @return [Hash] Returns the object in the form of hash
338
+ def to_body
339
+ to_hash
340
+ end
341
+
342
+ # Returns the object in the form of hash
343
+ # @return [Hash] Returns the object in the form of hash
344
+ def to_hash
345
+ hash = {}
346
+ self.class.attribute_map.each_pair do |attr, param|
347
+ value = self.send(attr)
348
+ next if value.nil?
349
+ hash[param] = _to_hash(value)
350
+ end
351
+ hash
352
+ end
353
+
354
+ # Outputs non-array value in the form of hash
355
+ # For object, use to_hash. Otherwise, just return the value
356
+ # @param [Object] value Any valid value
357
+ # @return [Hash] Returns the value in the form of hash
358
+ def _to_hash(value)
359
+ if value.is_a?(Array)
360
+ value.compact.map { |v| _to_hash(v) }
361
+ elsif value.is_a?(Hash)
362
+ {}.tap do |hash|
363
+ value.each { |k, v| hash[k] = _to_hash(v) }
364
+ end
365
+ elsif value.respond_to? :to_hash
366
+ value.to_hash
367
+ else
368
+ value
369
+ end
370
+ end
371
+ end
372
+ end