pulp_rpm_client 3.0.0b4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +79 -0
  4. data/README.md +134 -0
  5. data/Rakefile +10 -0
  6. data/docs/AsyncOperationResponse.md +17 -0
  7. data/docs/ContentAdvisoriesApi.md +196 -0
  8. data/docs/ContentPackagesApi.md +208 -0
  9. data/docs/DistributionsRpmApi.md +352 -0
  10. data/docs/InlineResponse200.md +23 -0
  11. data/docs/InlineResponse2001.md +23 -0
  12. data/docs/InlineResponse2002.md +23 -0
  13. data/docs/InlineResponse2003.md +23 -0
  14. data/docs/InlineResponse2004.md +23 -0
  15. data/docs/Package.md +95 -0
  16. data/docs/PublicationsRpmApi.md +229 -0
  17. data/docs/RemotesRpmApi.md +412 -0
  18. data/docs/RepositorySyncURL.md +19 -0
  19. data/docs/RpmCopyApi.md +70 -0
  20. data/docs/RpmDistribution.md +29 -0
  21. data/docs/RpmPublication.md +27 -0
  22. data/docs/RpmRemote.md +45 -0
  23. data/docs/RpmUploadApi.md +66 -0
  24. data/docs/UpdateRecord.md +55 -0
  25. data/git_push.sh +55 -0
  26. data/lib/pulp_rpm_client/api/content_advisories_api.rb +243 -0
  27. data/lib/pulp_rpm_client/api/content_packages_api.rb +261 -0
  28. data/lib/pulp_rpm_client/api/distributions_rpm_api.rb +430 -0
  29. data/lib/pulp_rpm_client/api/publications_rpm_api.rb +273 -0
  30. data/lib/pulp_rpm_client/api/remotes_rpm_api.rb +506 -0
  31. data/lib/pulp_rpm_client/api/rpm_copy_api.rb +96 -0
  32. data/lib/pulp_rpm_client/api/rpm_upload_api.rb +90 -0
  33. data/lib/pulp_rpm_client/api_client.rb +387 -0
  34. data/lib/pulp_rpm_client/api_error.rb +57 -0
  35. data/lib/pulp_rpm_client/configuration.rb +251 -0
  36. data/lib/pulp_rpm_client/models/async_operation_response.rb +202 -0
  37. data/lib/pulp_rpm_client/models/inline_response200.rb +235 -0
  38. data/lib/pulp_rpm_client/models/inline_response2001.rb +235 -0
  39. data/lib/pulp_rpm_client/models/inline_response2002.rb +235 -0
  40. data/lib/pulp_rpm_client/models/inline_response2003.rb +235 -0
  41. data/lib/pulp_rpm_client/models/inline_response2004.rb +235 -0
  42. data/lib/pulp_rpm_client/models/package.rb +983 -0
  43. data/lib/pulp_rpm_client/models/repository_sync_url.rb +214 -0
  44. data/lib/pulp_rpm_client/models/rpm_distribution.rb +337 -0
  45. data/lib/pulp_rpm_client/models/rpm_publication.rb +258 -0
  46. data/lib/pulp_rpm_client/models/rpm_remote.rb +539 -0
  47. data/lib/pulp_rpm_client/models/update_record.rb +764 -0
  48. data/lib/pulp_rpm_client/version.rb +15 -0
  49. data/lib/pulp_rpm_client.rb +58 -0
  50. data/pulp_rpm_client.gemspec +45 -0
  51. data/spec/api/content_advisories_api_spec.rb +83 -0
  52. data/spec/api/content_packages_api_spec.rb +89 -0
  53. data/spec/api/distributions_rpm_api_spec.rb +116 -0
  54. data/spec/api/publications_rpm_api_spec.rb +85 -0
  55. data/spec/api/remotes_rpm_api_spec.rb +131 -0
  56. data/spec/api/rpm_copy_api_spec.rb +50 -0
  57. data/spec/api/rpm_upload_api_spec.rb +48 -0
  58. data/spec/api_client_spec.rb +226 -0
  59. data/spec/configuration_spec.rb +42 -0
  60. data/spec/models/async_operation_response_spec.rb +41 -0
  61. data/spec/models/inline_response2001_spec.rb +59 -0
  62. data/spec/models/inline_response2002_spec.rb +59 -0
  63. data/spec/models/inline_response2003_spec.rb +59 -0
  64. data/spec/models/inline_response2004_spec.rb +59 -0
  65. data/spec/models/inline_response200_spec.rb +59 -0
  66. data/spec/models/package_spec.rb +275 -0
  67. data/spec/models/repository_sync_url_spec.rb +47 -0
  68. data/spec/models/rpm_distribution_spec.rb +77 -0
  69. data/spec/models/rpm_publication_spec.rb +71 -0
  70. data/spec/models/rpm_remote_spec.rb +129 -0
  71. data/spec/models/update_record_spec.rb +155 -0
  72. data/spec/spec_helper.rb +111 -0
  73. metadata +317 -0
@@ -0,0 +1,983 @@
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.0.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpRpmClient
16
+ class Package
17
+ attr_accessor :_href
18
+
19
+ attr_accessor :_type
20
+
21
+ # Timestamp of creation.
22
+ attr_accessor :_created
23
+
24
+ # Artifact file representing the physical content
25
+ attr_accessor :_artifact
26
+
27
+ # Name of the package
28
+ attr_accessor :name
29
+
30
+ # The package's epoch
31
+ attr_accessor :epoch
32
+
33
+ # The version of the package. For example, '2.8.0'
34
+ attr_accessor :version
35
+
36
+ # The release of a particular version of the package. e.g. '1.el7' or '3.f24'
37
+ attr_accessor :release
38
+
39
+ # The target architecture for a package.For example, 'x86_64', 'i686', or 'noarch'
40
+ attr_accessor :arch
41
+
42
+ # Checksum of the package file
43
+ attr_accessor :pkg_id
44
+
45
+ # Type of checksum, e.g. 'sha256', 'md5'
46
+ attr_accessor :checksum_type
47
+
48
+ # Short description of the packaged software
49
+ attr_accessor :summary
50
+
51
+ # In-depth description of the packaged software
52
+ attr_accessor :description
53
+
54
+ # URL with more information about the packaged software
55
+ attr_accessor :url
56
+
57
+ # Changelogs that package contains
58
+ attr_accessor :changelogs
59
+
60
+ # Files that package contains
61
+ attr_accessor :files
62
+
63
+ # Capabilities the package requires
64
+ attr_accessor :requires
65
+
66
+ # Capabilities the package provides
67
+ attr_accessor :provides
68
+
69
+ # Capabilities the package conflicts
70
+ attr_accessor :conflicts
71
+
72
+ # Capabilities the package obsoletes
73
+ attr_accessor :obsoletes
74
+
75
+ # Capabilities the package suggests
76
+ attr_accessor :suggests
77
+
78
+ # Capabilities the package enhances
79
+ attr_accessor :enhances
80
+
81
+ # Capabilities the package recommends
82
+ attr_accessor :recommends
83
+
84
+ # Capabilities the package supplements
85
+ attr_accessor :supplements
86
+
87
+ # Base location of this package
88
+ attr_accessor :location_base
89
+
90
+ # Relative location of package to the repodata
91
+ attr_accessor :location_href
92
+
93
+ # Hostname of the system that built the package
94
+ attr_accessor :rpm_buildhost
95
+
96
+ # RPM group (See: http://fedoraproject.org/wiki/RPMGroups)
97
+ attr_accessor :rpm_group
98
+
99
+ # License term applicable to the package software (GPLv2, etc.)
100
+ attr_accessor :rpm_license
101
+
102
+ # Person or persons responsible for creating the package
103
+ attr_accessor :rpm_packager
104
+
105
+ # Name of the source package (srpm) the package was built from
106
+ attr_accessor :rpm_sourcerpm
107
+
108
+ # Name of the organization that produced the package
109
+ attr_accessor :rpm_vendor
110
+
111
+ # First byte of the header
112
+ attr_accessor :rpm_header_start
113
+
114
+ # Last byte of the header
115
+ attr_accessor :rpm_header_end
116
+
117
+ # Size, in bytes, of the archive portion of the original package file
118
+ attr_accessor :size_archive
119
+
120
+ # Total size, in bytes, of every file installed by this package
121
+ attr_accessor :size_installed
122
+
123
+ # Size, in bytes, of the package
124
+ attr_accessor :size_package
125
+
126
+ # Time the package was built in seconds since the epoch
127
+ attr_accessor :time_build
128
+
129
+ # The 'file' time attribute in the primary XML - file mtime in seconds since the epoch.
130
+ attr_accessor :time_file
131
+
132
+ # File name of the package
133
+ attr_accessor :relative_path
134
+
135
+ # Attribute mapping from ruby-style variable name to JSON key.
136
+ def self.attribute_map
137
+ {
138
+ :'_href' => :'_href',
139
+ :'_type' => :'_type',
140
+ :'_created' => :'_created',
141
+ :'_artifact' => :'_artifact',
142
+ :'name' => :'name',
143
+ :'epoch' => :'epoch',
144
+ :'version' => :'version',
145
+ :'release' => :'release',
146
+ :'arch' => :'arch',
147
+ :'pkg_id' => :'pkgId',
148
+ :'checksum_type' => :'checksum_type',
149
+ :'summary' => :'summary',
150
+ :'description' => :'description',
151
+ :'url' => :'url',
152
+ :'changelogs' => :'changelogs',
153
+ :'files' => :'files',
154
+ :'requires' => :'requires',
155
+ :'provides' => :'provides',
156
+ :'conflicts' => :'conflicts',
157
+ :'obsoletes' => :'obsoletes',
158
+ :'suggests' => :'suggests',
159
+ :'enhances' => :'enhances',
160
+ :'recommends' => :'recommends',
161
+ :'supplements' => :'supplements',
162
+ :'location_base' => :'location_base',
163
+ :'location_href' => :'location_href',
164
+ :'rpm_buildhost' => :'rpm_buildhost',
165
+ :'rpm_group' => :'rpm_group',
166
+ :'rpm_license' => :'rpm_license',
167
+ :'rpm_packager' => :'rpm_packager',
168
+ :'rpm_sourcerpm' => :'rpm_sourcerpm',
169
+ :'rpm_vendor' => :'rpm_vendor',
170
+ :'rpm_header_start' => :'rpm_header_start',
171
+ :'rpm_header_end' => :'rpm_header_end',
172
+ :'size_archive' => :'size_archive',
173
+ :'size_installed' => :'size_installed',
174
+ :'size_package' => :'size_package',
175
+ :'time_build' => :'time_build',
176
+ :'time_file' => :'time_file',
177
+ :'relative_path' => :'relative_path'
178
+ }
179
+ end
180
+
181
+ # Attribute type mapping.
182
+ def self.openapi_types
183
+ {
184
+ :'_href' => :'String',
185
+ :'_type' => :'String',
186
+ :'_created' => :'DateTime',
187
+ :'_artifact' => :'String',
188
+ :'name' => :'String',
189
+ :'epoch' => :'String',
190
+ :'version' => :'String',
191
+ :'release' => :'String',
192
+ :'arch' => :'String',
193
+ :'pkg_id' => :'String',
194
+ :'checksum_type' => :'String',
195
+ :'summary' => :'String',
196
+ :'description' => :'String',
197
+ :'url' => :'String',
198
+ :'changelogs' => :'String',
199
+ :'files' => :'String',
200
+ :'requires' => :'String',
201
+ :'provides' => :'String',
202
+ :'conflicts' => :'String',
203
+ :'obsoletes' => :'String',
204
+ :'suggests' => :'String',
205
+ :'enhances' => :'String',
206
+ :'recommends' => :'String',
207
+ :'supplements' => :'String',
208
+ :'location_base' => :'String',
209
+ :'location_href' => :'String',
210
+ :'rpm_buildhost' => :'String',
211
+ :'rpm_group' => :'String',
212
+ :'rpm_license' => :'String',
213
+ :'rpm_packager' => :'String',
214
+ :'rpm_sourcerpm' => :'String',
215
+ :'rpm_vendor' => :'String',
216
+ :'rpm_header_start' => :'Integer',
217
+ :'rpm_header_end' => :'Integer',
218
+ :'size_archive' => :'Integer',
219
+ :'size_installed' => :'Integer',
220
+ :'size_package' => :'Integer',
221
+ :'time_build' => :'Integer',
222
+ :'time_file' => :'Integer',
223
+ :'relative_path' => :'String'
224
+ }
225
+ end
226
+
227
+ # Initializes the object
228
+ # @param [Hash] attributes Model attributes in the form of hash
229
+ def initialize(attributes = {})
230
+ if (!attributes.is_a?(Hash))
231
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpRpmClient::Package` initialize method"
232
+ end
233
+
234
+ # check to see if the attribute exists and convert string to symbol for hash key
235
+ attributes = attributes.each_with_object({}) { |(k, v), h|
236
+ if (!self.class.attribute_map.key?(k.to_sym))
237
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpRpmClient::Package`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
238
+ end
239
+ h[k.to_sym] = v
240
+ }
241
+
242
+ if attributes.key?(:'_href')
243
+ self._href = attributes[:'_href']
244
+ end
245
+
246
+ if attributes.key?(:'_type')
247
+ self._type = attributes[:'_type']
248
+ end
249
+
250
+ if attributes.key?(:'_created')
251
+ self._created = attributes[:'_created']
252
+ end
253
+
254
+ if attributes.key?(:'_artifact')
255
+ self._artifact = attributes[:'_artifact']
256
+ end
257
+
258
+ if attributes.key?(:'name')
259
+ self.name = attributes[:'name']
260
+ end
261
+
262
+ if attributes.key?(:'epoch')
263
+ self.epoch = attributes[:'epoch']
264
+ end
265
+
266
+ if attributes.key?(:'version')
267
+ self.version = attributes[:'version']
268
+ end
269
+
270
+ if attributes.key?(:'release')
271
+ self.release = attributes[:'release']
272
+ end
273
+
274
+ if attributes.key?(:'arch')
275
+ self.arch = attributes[:'arch']
276
+ end
277
+
278
+ if attributes.key?(:'pkg_id')
279
+ self.pkg_id = attributes[:'pkg_id']
280
+ end
281
+
282
+ if attributes.key?(:'checksum_type')
283
+ self.checksum_type = attributes[:'checksum_type']
284
+ end
285
+
286
+ if attributes.key?(:'summary')
287
+ self.summary = attributes[:'summary']
288
+ end
289
+
290
+ if attributes.key?(:'description')
291
+ self.description = attributes[:'description']
292
+ end
293
+
294
+ if attributes.key?(:'url')
295
+ self.url = attributes[:'url']
296
+ end
297
+
298
+ if attributes.key?(:'changelogs')
299
+ self.changelogs = attributes[:'changelogs']
300
+ else
301
+ self.changelogs = '[]'
302
+ end
303
+
304
+ if attributes.key?(:'files')
305
+ self.files = attributes[:'files']
306
+ else
307
+ self.files = '[]'
308
+ end
309
+
310
+ if attributes.key?(:'requires')
311
+ self.requires = attributes[:'requires']
312
+ else
313
+ self.requires = '[]'
314
+ end
315
+
316
+ if attributes.key?(:'provides')
317
+ self.provides = attributes[:'provides']
318
+ else
319
+ self.provides = '[]'
320
+ end
321
+
322
+ if attributes.key?(:'conflicts')
323
+ self.conflicts = attributes[:'conflicts']
324
+ else
325
+ self.conflicts = '[]'
326
+ end
327
+
328
+ if attributes.key?(:'obsoletes')
329
+ self.obsoletes = attributes[:'obsoletes']
330
+ else
331
+ self.obsoletes = '[]'
332
+ end
333
+
334
+ if attributes.key?(:'suggests')
335
+ self.suggests = attributes[:'suggests']
336
+ else
337
+ self.suggests = '[]'
338
+ end
339
+
340
+ if attributes.key?(:'enhances')
341
+ self.enhances = attributes[:'enhances']
342
+ else
343
+ self.enhances = '[]'
344
+ end
345
+
346
+ if attributes.key?(:'recommends')
347
+ self.recommends = attributes[:'recommends']
348
+ else
349
+ self.recommends = '[]'
350
+ end
351
+
352
+ if attributes.key?(:'supplements')
353
+ self.supplements = attributes[:'supplements']
354
+ else
355
+ self.supplements = '[]'
356
+ end
357
+
358
+ if attributes.key?(:'location_base')
359
+ self.location_base = attributes[:'location_base']
360
+ end
361
+
362
+ if attributes.key?(:'location_href')
363
+ self.location_href = attributes[:'location_href']
364
+ end
365
+
366
+ if attributes.key?(:'rpm_buildhost')
367
+ self.rpm_buildhost = attributes[:'rpm_buildhost']
368
+ end
369
+
370
+ if attributes.key?(:'rpm_group')
371
+ self.rpm_group = attributes[:'rpm_group']
372
+ end
373
+
374
+ if attributes.key?(:'rpm_license')
375
+ self.rpm_license = attributes[:'rpm_license']
376
+ end
377
+
378
+ if attributes.key?(:'rpm_packager')
379
+ self.rpm_packager = attributes[:'rpm_packager']
380
+ end
381
+
382
+ if attributes.key?(:'rpm_sourcerpm')
383
+ self.rpm_sourcerpm = attributes[:'rpm_sourcerpm']
384
+ end
385
+
386
+ if attributes.key?(:'rpm_vendor')
387
+ self.rpm_vendor = attributes[:'rpm_vendor']
388
+ end
389
+
390
+ if attributes.key?(:'rpm_header_start')
391
+ self.rpm_header_start = attributes[:'rpm_header_start']
392
+ end
393
+
394
+ if attributes.key?(:'rpm_header_end')
395
+ self.rpm_header_end = attributes[:'rpm_header_end']
396
+ end
397
+
398
+ if attributes.key?(:'size_archive')
399
+ self.size_archive = attributes[:'size_archive']
400
+ end
401
+
402
+ if attributes.key?(:'size_installed')
403
+ self.size_installed = attributes[:'size_installed']
404
+ end
405
+
406
+ if attributes.key?(:'size_package')
407
+ self.size_package = attributes[:'size_package']
408
+ end
409
+
410
+ if attributes.key?(:'time_build')
411
+ self.time_build = attributes[:'time_build']
412
+ end
413
+
414
+ if attributes.key?(:'time_file')
415
+ self.time_file = attributes[:'time_file']
416
+ end
417
+
418
+ if attributes.key?(:'relative_path')
419
+ self.relative_path = attributes[:'relative_path']
420
+ end
421
+ end
422
+
423
+ # Show invalid properties with the reasons. Usually used together with valid?
424
+ # @return Array for valid properties with the reasons
425
+ def list_invalid_properties
426
+ invalid_properties = Array.new
427
+ if !@_type.nil? && @_type.to_s.length < 1
428
+ invalid_properties.push('invalid value for "_type", the character length must be great than or equal to 1.')
429
+ end
430
+
431
+ if @_artifact.nil?
432
+ invalid_properties.push('invalid value for "_artifact", _artifact cannot be nil.')
433
+ end
434
+
435
+ if @name.nil?
436
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
437
+ end
438
+
439
+ if @name.to_s.length < 1
440
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
441
+ end
442
+
443
+ if @version.nil?
444
+ invalid_properties.push('invalid value for "version", version cannot be nil.')
445
+ end
446
+
447
+ if @version.to_s.length < 1
448
+ invalid_properties.push('invalid value for "version", the character length must be great than or equal to 1.')
449
+ end
450
+
451
+ if @release.nil?
452
+ invalid_properties.push('invalid value for "release", release cannot be nil.')
453
+ end
454
+
455
+ if @release.to_s.length < 1
456
+ invalid_properties.push('invalid value for "release", the character length must be great than or equal to 1.')
457
+ end
458
+
459
+ if @arch.nil?
460
+ invalid_properties.push('invalid value for "arch", arch cannot be nil.')
461
+ end
462
+
463
+ if @arch.to_s.length < 1
464
+ invalid_properties.push('invalid value for "arch", the character length must be great than or equal to 1.')
465
+ end
466
+
467
+ if @pkg_id.nil?
468
+ invalid_properties.push('invalid value for "pkg_id", pkg_id cannot be nil.')
469
+ end
470
+
471
+ if @pkg_id.to_s.length < 1
472
+ invalid_properties.push('invalid value for "pkg_id", the character length must be great than or equal to 1.')
473
+ end
474
+
475
+ if @checksum_type.nil?
476
+ invalid_properties.push('invalid value for "checksum_type", checksum_type cannot be nil.')
477
+ end
478
+
479
+ if @checksum_type.to_s.length < 1
480
+ invalid_properties.push('invalid value for "checksum_type", the character length must be great than or equal to 1.')
481
+ end
482
+
483
+ if !@changelogs.nil? && @changelogs.to_s.length < 1
484
+ invalid_properties.push('invalid value for "changelogs", the character length must be great than or equal to 1.')
485
+ end
486
+
487
+ if !@files.nil? && @files.to_s.length < 1
488
+ invalid_properties.push('invalid value for "files", the character length must be great than or equal to 1.')
489
+ end
490
+
491
+ if !@requires.nil? && @requires.to_s.length < 1
492
+ invalid_properties.push('invalid value for "requires", the character length must be great than or equal to 1.')
493
+ end
494
+
495
+ if !@provides.nil? && @provides.to_s.length < 1
496
+ invalid_properties.push('invalid value for "provides", the character length must be great than or equal to 1.')
497
+ end
498
+
499
+ if !@conflicts.nil? && @conflicts.to_s.length < 1
500
+ invalid_properties.push('invalid value for "conflicts", the character length must be great than or equal to 1.')
501
+ end
502
+
503
+ if !@obsoletes.nil? && @obsoletes.to_s.length < 1
504
+ invalid_properties.push('invalid value for "obsoletes", the character length must be great than or equal to 1.')
505
+ end
506
+
507
+ if !@suggests.nil? && @suggests.to_s.length < 1
508
+ invalid_properties.push('invalid value for "suggests", the character length must be great than or equal to 1.')
509
+ end
510
+
511
+ if !@enhances.nil? && @enhances.to_s.length < 1
512
+ invalid_properties.push('invalid value for "enhances", the character length must be great than or equal to 1.')
513
+ end
514
+
515
+ if !@recommends.nil? && @recommends.to_s.length < 1
516
+ invalid_properties.push('invalid value for "recommends", the character length must be great than or equal to 1.')
517
+ end
518
+
519
+ if !@supplements.nil? && @supplements.to_s.length < 1
520
+ invalid_properties.push('invalid value for "supplements", the character length must be great than or equal to 1.')
521
+ end
522
+
523
+ if @location_href.nil?
524
+ invalid_properties.push('invalid value for "location_href", location_href cannot be nil.')
525
+ end
526
+
527
+ if @location_href.to_s.length < 1
528
+ invalid_properties.push('invalid value for "location_href", the character length must be great than or equal to 1.')
529
+ end
530
+
531
+ if @rpm_header_start.nil?
532
+ invalid_properties.push('invalid value for "rpm_header_start", rpm_header_start cannot be nil.')
533
+ end
534
+
535
+ if @rpm_header_end.nil?
536
+ invalid_properties.push('invalid value for "rpm_header_end", rpm_header_end cannot be nil.')
537
+ end
538
+
539
+ if @size_archive.nil?
540
+ invalid_properties.push('invalid value for "size_archive", size_archive cannot be nil.')
541
+ end
542
+
543
+ if @size_installed.nil?
544
+ invalid_properties.push('invalid value for "size_installed", size_installed cannot be nil.')
545
+ end
546
+
547
+ if @size_package.nil?
548
+ invalid_properties.push('invalid value for "size_package", size_package cannot be nil.')
549
+ end
550
+
551
+ if @time_build.nil?
552
+ invalid_properties.push('invalid value for "time_build", time_build cannot be nil.')
553
+ end
554
+
555
+ if @time_file.nil?
556
+ invalid_properties.push('invalid value for "time_file", time_file cannot be nil.')
557
+ end
558
+
559
+ if @relative_path.nil?
560
+ invalid_properties.push('invalid value for "relative_path", relative_path cannot be nil.')
561
+ end
562
+
563
+ invalid_properties
564
+ end
565
+
566
+ # Check to see if the all the properties in the model are valid
567
+ # @return true if the model is valid
568
+ def valid?
569
+ return false if !@_type.nil? && @_type.to_s.length < 1
570
+ return false if @_artifact.nil?
571
+ return false if @name.nil?
572
+ return false if @name.to_s.length < 1
573
+ return false if @version.nil?
574
+ return false if @version.to_s.length < 1
575
+ return false if @release.nil?
576
+ return false if @release.to_s.length < 1
577
+ return false if @arch.nil?
578
+ return false if @arch.to_s.length < 1
579
+ return false if @pkg_id.nil?
580
+ return false if @pkg_id.to_s.length < 1
581
+ return false if @checksum_type.nil?
582
+ return false if @checksum_type.to_s.length < 1
583
+ return false if !@changelogs.nil? && @changelogs.to_s.length < 1
584
+ return false if !@files.nil? && @files.to_s.length < 1
585
+ return false if !@requires.nil? && @requires.to_s.length < 1
586
+ return false if !@provides.nil? && @provides.to_s.length < 1
587
+ return false if !@conflicts.nil? && @conflicts.to_s.length < 1
588
+ return false if !@obsoletes.nil? && @obsoletes.to_s.length < 1
589
+ return false if !@suggests.nil? && @suggests.to_s.length < 1
590
+ return false if !@enhances.nil? && @enhances.to_s.length < 1
591
+ return false if !@recommends.nil? && @recommends.to_s.length < 1
592
+ return false if !@supplements.nil? && @supplements.to_s.length < 1
593
+ return false if @location_href.nil?
594
+ return false if @location_href.to_s.length < 1
595
+ return false if @rpm_header_start.nil?
596
+ return false if @rpm_header_end.nil?
597
+ return false if @size_archive.nil?
598
+ return false if @size_installed.nil?
599
+ return false if @size_package.nil?
600
+ return false if @time_build.nil?
601
+ return false if @time_file.nil?
602
+ return false if @relative_path.nil?
603
+ true
604
+ end
605
+
606
+ # Custom attribute writer method with validation
607
+ # @param [Object] _type Value to be assigned
608
+ def _type=(_type)
609
+ if !_type.nil? && _type.to_s.length < 1
610
+ fail ArgumentError, 'invalid value for "_type", the character length must be great than or equal to 1.'
611
+ end
612
+
613
+ @_type = _type
614
+ end
615
+
616
+ # Custom attribute writer method with validation
617
+ # @param [Object] name Value to be assigned
618
+ def name=(name)
619
+ if name.nil?
620
+ fail ArgumentError, 'name cannot be nil'
621
+ end
622
+
623
+ if name.to_s.length < 1
624
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
625
+ end
626
+
627
+ @name = name
628
+ end
629
+
630
+ # Custom attribute writer method with validation
631
+ # @param [Object] version Value to be assigned
632
+ def version=(version)
633
+ if version.nil?
634
+ fail ArgumentError, 'version cannot be nil'
635
+ end
636
+
637
+ if version.to_s.length < 1
638
+ fail ArgumentError, 'invalid value for "version", the character length must be great than or equal to 1.'
639
+ end
640
+
641
+ @version = version
642
+ end
643
+
644
+ # Custom attribute writer method with validation
645
+ # @param [Object] release Value to be assigned
646
+ def release=(release)
647
+ if release.nil?
648
+ fail ArgumentError, 'release cannot be nil'
649
+ end
650
+
651
+ if release.to_s.length < 1
652
+ fail ArgumentError, 'invalid value for "release", the character length must be great than or equal to 1.'
653
+ end
654
+
655
+ @release = release
656
+ end
657
+
658
+ # Custom attribute writer method with validation
659
+ # @param [Object] arch Value to be assigned
660
+ def arch=(arch)
661
+ if arch.nil?
662
+ fail ArgumentError, 'arch cannot be nil'
663
+ end
664
+
665
+ if arch.to_s.length < 1
666
+ fail ArgumentError, 'invalid value for "arch", the character length must be great than or equal to 1.'
667
+ end
668
+
669
+ @arch = arch
670
+ end
671
+
672
+ # Custom attribute writer method with validation
673
+ # @param [Object] pkg_id Value to be assigned
674
+ def pkg_id=(pkg_id)
675
+ if pkg_id.nil?
676
+ fail ArgumentError, 'pkg_id cannot be nil'
677
+ end
678
+
679
+ if pkg_id.to_s.length < 1
680
+ fail ArgumentError, 'invalid value for "pkg_id", the character length must be great than or equal to 1.'
681
+ end
682
+
683
+ @pkg_id = pkg_id
684
+ end
685
+
686
+ # Custom attribute writer method with validation
687
+ # @param [Object] checksum_type Value to be assigned
688
+ def checksum_type=(checksum_type)
689
+ if checksum_type.nil?
690
+ fail ArgumentError, 'checksum_type cannot be nil'
691
+ end
692
+
693
+ if checksum_type.to_s.length < 1
694
+ fail ArgumentError, 'invalid value for "checksum_type", the character length must be great than or equal to 1.'
695
+ end
696
+
697
+ @checksum_type = checksum_type
698
+ end
699
+
700
+ # Custom attribute writer method with validation
701
+ # @param [Object] changelogs Value to be assigned
702
+ def changelogs=(changelogs)
703
+ if !changelogs.nil? && changelogs.to_s.length < 1
704
+ fail ArgumentError, 'invalid value for "changelogs", the character length must be great than or equal to 1.'
705
+ end
706
+
707
+ @changelogs = changelogs
708
+ end
709
+
710
+ # Custom attribute writer method with validation
711
+ # @param [Object] files Value to be assigned
712
+ def files=(files)
713
+ if !files.nil? && files.to_s.length < 1
714
+ fail ArgumentError, 'invalid value for "files", the character length must be great than or equal to 1.'
715
+ end
716
+
717
+ @files = files
718
+ end
719
+
720
+ # Custom attribute writer method with validation
721
+ # @param [Object] requires Value to be assigned
722
+ def requires=(requires)
723
+ if !requires.nil? && requires.to_s.length < 1
724
+ fail ArgumentError, 'invalid value for "requires", the character length must be great than or equal to 1.'
725
+ end
726
+
727
+ @requires = requires
728
+ end
729
+
730
+ # Custom attribute writer method with validation
731
+ # @param [Object] provides Value to be assigned
732
+ def provides=(provides)
733
+ if !provides.nil? && provides.to_s.length < 1
734
+ fail ArgumentError, 'invalid value for "provides", the character length must be great than or equal to 1.'
735
+ end
736
+
737
+ @provides = provides
738
+ end
739
+
740
+ # Custom attribute writer method with validation
741
+ # @param [Object] conflicts Value to be assigned
742
+ def conflicts=(conflicts)
743
+ if !conflicts.nil? && conflicts.to_s.length < 1
744
+ fail ArgumentError, 'invalid value for "conflicts", the character length must be great than or equal to 1.'
745
+ end
746
+
747
+ @conflicts = conflicts
748
+ end
749
+
750
+ # Custom attribute writer method with validation
751
+ # @param [Object] obsoletes Value to be assigned
752
+ def obsoletes=(obsoletes)
753
+ if !obsoletes.nil? && obsoletes.to_s.length < 1
754
+ fail ArgumentError, 'invalid value for "obsoletes", the character length must be great than or equal to 1.'
755
+ end
756
+
757
+ @obsoletes = obsoletes
758
+ end
759
+
760
+ # Custom attribute writer method with validation
761
+ # @param [Object] suggests Value to be assigned
762
+ def suggests=(suggests)
763
+ if !suggests.nil? && suggests.to_s.length < 1
764
+ fail ArgumentError, 'invalid value for "suggests", the character length must be great than or equal to 1.'
765
+ end
766
+
767
+ @suggests = suggests
768
+ end
769
+
770
+ # Custom attribute writer method with validation
771
+ # @param [Object] enhances Value to be assigned
772
+ def enhances=(enhances)
773
+ if !enhances.nil? && enhances.to_s.length < 1
774
+ fail ArgumentError, 'invalid value for "enhances", the character length must be great than or equal to 1.'
775
+ end
776
+
777
+ @enhances = enhances
778
+ end
779
+
780
+ # Custom attribute writer method with validation
781
+ # @param [Object] recommends Value to be assigned
782
+ def recommends=(recommends)
783
+ if !recommends.nil? && recommends.to_s.length < 1
784
+ fail ArgumentError, 'invalid value for "recommends", the character length must be great than or equal to 1.'
785
+ end
786
+
787
+ @recommends = recommends
788
+ end
789
+
790
+ # Custom attribute writer method with validation
791
+ # @param [Object] supplements Value to be assigned
792
+ def supplements=(supplements)
793
+ if !supplements.nil? && supplements.to_s.length < 1
794
+ fail ArgumentError, 'invalid value for "supplements", the character length must be great than or equal to 1.'
795
+ end
796
+
797
+ @supplements = supplements
798
+ end
799
+
800
+ # Custom attribute writer method with validation
801
+ # @param [Object] location_href Value to be assigned
802
+ def location_href=(location_href)
803
+ if location_href.nil?
804
+ fail ArgumentError, 'location_href cannot be nil'
805
+ end
806
+
807
+ if location_href.to_s.length < 1
808
+ fail ArgumentError, 'invalid value for "location_href", the character length must be great than or equal to 1.'
809
+ end
810
+
811
+ @location_href = location_href
812
+ end
813
+
814
+ # Checks equality by comparing each attribute.
815
+ # @param [Object] Object to be compared
816
+ def ==(o)
817
+ return true if self.equal?(o)
818
+ self.class == o.class &&
819
+ _href == o._href &&
820
+ _type == o._type &&
821
+ _created == o._created &&
822
+ _artifact == o._artifact &&
823
+ name == o.name &&
824
+ epoch == o.epoch &&
825
+ version == o.version &&
826
+ release == o.release &&
827
+ arch == o.arch &&
828
+ pkg_id == o.pkg_id &&
829
+ checksum_type == o.checksum_type &&
830
+ summary == o.summary &&
831
+ description == o.description &&
832
+ url == o.url &&
833
+ changelogs == o.changelogs &&
834
+ files == o.files &&
835
+ requires == o.requires &&
836
+ provides == o.provides &&
837
+ conflicts == o.conflicts &&
838
+ obsoletes == o.obsoletes &&
839
+ suggests == o.suggests &&
840
+ enhances == o.enhances &&
841
+ recommends == o.recommends &&
842
+ supplements == o.supplements &&
843
+ location_base == o.location_base &&
844
+ location_href == o.location_href &&
845
+ rpm_buildhost == o.rpm_buildhost &&
846
+ rpm_group == o.rpm_group &&
847
+ rpm_license == o.rpm_license &&
848
+ rpm_packager == o.rpm_packager &&
849
+ rpm_sourcerpm == o.rpm_sourcerpm &&
850
+ rpm_vendor == o.rpm_vendor &&
851
+ rpm_header_start == o.rpm_header_start &&
852
+ rpm_header_end == o.rpm_header_end &&
853
+ size_archive == o.size_archive &&
854
+ size_installed == o.size_installed &&
855
+ size_package == o.size_package &&
856
+ time_build == o.time_build &&
857
+ time_file == o.time_file &&
858
+ relative_path == o.relative_path
859
+ end
860
+
861
+ # @see the `==` method
862
+ # @param [Object] Object to be compared
863
+ def eql?(o)
864
+ self == o
865
+ end
866
+
867
+ # Calculates hash code according to all attributes.
868
+ # @return [Integer] Hash code
869
+ def hash
870
+ [_href, _type, _created, _artifact, name, epoch, version, release, arch, pkg_id, checksum_type, summary, description, url, changelogs, files, requires, provides, conflicts, obsoletes, suggests, enhances, recommends, supplements, location_base, location_href, rpm_buildhost, rpm_group, rpm_license, rpm_packager, rpm_sourcerpm, rpm_vendor, rpm_header_start, rpm_header_end, size_archive, size_installed, size_package, time_build, time_file, relative_path].hash
871
+ end
872
+
873
+ # Builds the object from hash
874
+ # @param [Hash] attributes Model attributes in the form of hash
875
+ # @return [Object] Returns the model itself
876
+ def self.build_from_hash(attributes)
877
+ new.build_from_hash(attributes)
878
+ end
879
+
880
+ # Builds the object from hash
881
+ # @param [Hash] attributes Model attributes in the form of hash
882
+ # @return [Object] Returns the model itself
883
+ def build_from_hash(attributes)
884
+ return nil unless attributes.is_a?(Hash)
885
+ self.class.openapi_types.each_pair do |key, type|
886
+ if type =~ /\AArray<(.*)>/i
887
+ # check to ensure the input is an array given that the attribute
888
+ # is documented as an array but the input is not
889
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
890
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
891
+ end
892
+ elsif !attributes[self.class.attribute_map[key]].nil?
893
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
894
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
895
+ end
896
+
897
+ self
898
+ end
899
+
900
+ # Deserializes the data based on type
901
+ # @param string type Data type
902
+ # @param string value Value to be deserialized
903
+ # @return [Object] Deserialized data
904
+ def _deserialize(type, value)
905
+ case type.to_sym
906
+ when :DateTime
907
+ DateTime.parse(value)
908
+ when :Date
909
+ Date.parse(value)
910
+ when :String
911
+ value.to_s
912
+ when :Integer
913
+ value.to_i
914
+ when :Float
915
+ value.to_f
916
+ when :Boolean
917
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
918
+ true
919
+ else
920
+ false
921
+ end
922
+ when :Object
923
+ # generic object (usually a Hash), return directly
924
+ value
925
+ when /\AArray<(?<inner_type>.+)>\z/
926
+ inner_type = Regexp.last_match[:inner_type]
927
+ value.map { |v| _deserialize(inner_type, v) }
928
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
929
+ k_type = Regexp.last_match[:k_type]
930
+ v_type = Regexp.last_match[:v_type]
931
+ {}.tap do |hash|
932
+ value.each do |k, v|
933
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
934
+ end
935
+ end
936
+ else # model
937
+ PulpRpmClient.const_get(type).build_from_hash(value)
938
+ end
939
+ end
940
+
941
+ # Returns the string representation of the object
942
+ # @return [String] String presentation of the object
943
+ def to_s
944
+ to_hash.to_s
945
+ end
946
+
947
+ # to_body is an alias to to_hash (backward compatibility)
948
+ # @return [Hash] Returns the object in the form of hash
949
+ def to_body
950
+ to_hash
951
+ end
952
+
953
+ # Returns the object in the form of hash
954
+ # @return [Hash] Returns the object in the form of hash
955
+ def to_hash
956
+ hash = {}
957
+ self.class.attribute_map.each_pair do |attr, param|
958
+ value = self.send(attr)
959
+ next if value.nil?
960
+ hash[param] = _to_hash(value)
961
+ end
962
+ hash
963
+ end
964
+
965
+ # Outputs non-array value in the form of hash
966
+ # For object, use to_hash. Otherwise, just return the value
967
+ # @param [Object] value Any valid value
968
+ # @return [Hash] Returns the value in the form of hash
969
+ def _to_hash(value)
970
+ if value.is_a?(Array)
971
+ value.compact.map { |v| _to_hash(v) }
972
+ elsif value.is_a?(Hash)
973
+ {}.tap do |hash|
974
+ value.each { |k, v| hash[k] = _to_hash(v) }
975
+ end
976
+ elsif value.respond_to? :to_hash
977
+ value.to_hash
978
+ else
979
+ value
980
+ end
981
+ end
982
+ end
983
+ end