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,660 @@
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 DistributionTree
17
+ attr_accessor :_href
18
+
19
+ # Header Version.
20
+ attr_accessor :header_version
21
+
22
+ # Release name.
23
+ attr_accessor :release_name
24
+
25
+ # Release short name.
26
+ attr_accessor :release_short
27
+
28
+ # Release version.
29
+ attr_accessor :release_version
30
+
31
+ # Typically False for an operating system, True otherwise.
32
+ attr_accessor :release_is_layered
33
+
34
+ # Base Product name.
35
+ attr_accessor :base_product_name
36
+
37
+ # Base Product short name.
38
+ attr_accessor :base_product_short
39
+
40
+ # Base Product version.
41
+ attr_accessor :base_product_version
42
+
43
+ # Tree architecturerch.
44
+ attr_accessor :arch
45
+
46
+ # Tree build time timestamp.
47
+ attr_accessor :build_timestamp
48
+
49
+ # Relative path to Anaconda instimage.
50
+ attr_accessor :instimage
51
+
52
+ # Relative path to Anaconda stage2 image.
53
+ attr_accessor :mainimage
54
+
55
+ # Disc number.
56
+ attr_accessor :discnum
57
+
58
+ # Number of discs in media set.
59
+ attr_accessor :totaldiscs
60
+
61
+ attr_accessor :addons
62
+
63
+ attr_accessor :checksums
64
+
65
+ attr_accessor :images
66
+
67
+ attr_accessor :variants
68
+
69
+ # Attribute mapping from ruby-style variable name to JSON key.
70
+ def self.attribute_map
71
+ {
72
+ :'_href' => :'_href',
73
+ :'header_version' => :'header_version',
74
+ :'release_name' => :'release_name',
75
+ :'release_short' => :'release_short',
76
+ :'release_version' => :'release_version',
77
+ :'release_is_layered' => :'release_is_layered',
78
+ :'base_product_name' => :'base_product_name',
79
+ :'base_product_short' => :'base_product_short',
80
+ :'base_product_version' => :'base_product_version',
81
+ :'arch' => :'arch',
82
+ :'build_timestamp' => :'build_timestamp',
83
+ :'instimage' => :'instimage',
84
+ :'mainimage' => :'mainimage',
85
+ :'discnum' => :'discnum',
86
+ :'totaldiscs' => :'totaldiscs',
87
+ :'addons' => :'addons',
88
+ :'checksums' => :'checksums',
89
+ :'images' => :'images',
90
+ :'variants' => :'variants'
91
+ }
92
+ end
93
+
94
+ # Attribute type mapping.
95
+ def self.openapi_types
96
+ {
97
+ :'_href' => :'String',
98
+ :'header_version' => :'String',
99
+ :'release_name' => :'String',
100
+ :'release_short' => :'String',
101
+ :'release_version' => :'String',
102
+ :'release_is_layered' => :'Boolean',
103
+ :'base_product_name' => :'String',
104
+ :'base_product_short' => :'String',
105
+ :'base_product_version' => :'String',
106
+ :'arch' => :'String',
107
+ :'build_timestamp' => :'Float',
108
+ :'instimage' => :'String',
109
+ :'mainimage' => :'String',
110
+ :'discnum' => :'Integer',
111
+ :'totaldiscs' => :'Integer',
112
+ :'addons' => :'Array<Addon>',
113
+ :'checksums' => :'Array<Checksum>',
114
+ :'images' => :'Array<Image>',
115
+ :'variants' => :'Array<Variant>'
116
+ }
117
+ end
118
+
119
+ # Initializes the object
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ def initialize(attributes = {})
122
+ if (!attributes.is_a?(Hash))
123
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpRpmClient::DistributionTree` initialize method"
124
+ end
125
+
126
+ # check to see if the attribute exists and convert string to symbol for hash key
127
+ attributes = attributes.each_with_object({}) { |(k, v), h|
128
+ if (!self.class.attribute_map.key?(k.to_sym))
129
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpRpmClient::DistributionTree`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
130
+ end
131
+ h[k.to_sym] = v
132
+ }
133
+
134
+ if attributes.key?(:'_href')
135
+ self._href = attributes[:'_href']
136
+ end
137
+
138
+ if attributes.key?(:'header_version')
139
+ self.header_version = attributes[:'header_version']
140
+ end
141
+
142
+ if attributes.key?(:'release_name')
143
+ self.release_name = attributes[:'release_name']
144
+ end
145
+
146
+ if attributes.key?(:'release_short')
147
+ self.release_short = attributes[:'release_short']
148
+ end
149
+
150
+ if attributes.key?(:'release_version')
151
+ self.release_version = attributes[:'release_version']
152
+ end
153
+
154
+ if attributes.key?(:'release_is_layered')
155
+ self.release_is_layered = attributes[:'release_is_layered']
156
+ end
157
+
158
+ if attributes.key?(:'base_product_name')
159
+ self.base_product_name = attributes[:'base_product_name']
160
+ end
161
+
162
+ if attributes.key?(:'base_product_short')
163
+ self.base_product_short = attributes[:'base_product_short']
164
+ end
165
+
166
+ if attributes.key?(:'base_product_version')
167
+ self.base_product_version = attributes[:'base_product_version']
168
+ end
169
+
170
+ if attributes.key?(:'arch')
171
+ self.arch = attributes[:'arch']
172
+ end
173
+
174
+ if attributes.key?(:'build_timestamp')
175
+ self.build_timestamp = attributes[:'build_timestamp']
176
+ end
177
+
178
+ if attributes.key?(:'instimage')
179
+ self.instimage = attributes[:'instimage']
180
+ end
181
+
182
+ if attributes.key?(:'mainimage')
183
+ self.mainimage = attributes[:'mainimage']
184
+ end
185
+
186
+ if attributes.key?(:'discnum')
187
+ self.discnum = attributes[:'discnum']
188
+ end
189
+
190
+ if attributes.key?(:'totaldiscs')
191
+ self.totaldiscs = attributes[:'totaldiscs']
192
+ end
193
+
194
+ if attributes.key?(:'addons')
195
+ if (value = attributes[:'addons']).is_a?(Array)
196
+ self.addons = value
197
+ end
198
+ end
199
+
200
+ if attributes.key?(:'checksums')
201
+ if (value = attributes[:'checksums']).is_a?(Array)
202
+ self.checksums = value
203
+ end
204
+ end
205
+
206
+ if attributes.key?(:'images')
207
+ if (value = attributes[:'images']).is_a?(Array)
208
+ self.images = value
209
+ end
210
+ end
211
+
212
+ if attributes.key?(:'variants')
213
+ if (value = attributes[:'variants']).is_a?(Array)
214
+ self.variants = value
215
+ end
216
+ end
217
+ end
218
+
219
+ # Show invalid properties with the reasons. Usually used together with valid?
220
+ # @return Array for valid properties with the reasons
221
+ def list_invalid_properties
222
+ invalid_properties = Array.new
223
+ if @header_version.nil?
224
+ invalid_properties.push('invalid value for "header_version", header_version cannot be nil.')
225
+ end
226
+
227
+ if @header_version.to_s.length < 1
228
+ invalid_properties.push('invalid value for "header_version", the character length must be great than or equal to 1.')
229
+ end
230
+
231
+ if @release_name.nil?
232
+ invalid_properties.push('invalid value for "release_name", release_name cannot be nil.')
233
+ end
234
+
235
+ if @release_name.to_s.length < 1
236
+ invalid_properties.push('invalid value for "release_name", the character length must be great than or equal to 1.')
237
+ end
238
+
239
+ if @release_short.nil?
240
+ invalid_properties.push('invalid value for "release_short", release_short cannot be nil.')
241
+ end
242
+
243
+ if @release_short.to_s.length < 1
244
+ invalid_properties.push('invalid value for "release_short", the character length must be great than or equal to 1.')
245
+ end
246
+
247
+ if @release_version.nil?
248
+ invalid_properties.push('invalid value for "release_version", release_version cannot be nil.')
249
+ end
250
+
251
+ if @release_version.to_s.length < 1
252
+ invalid_properties.push('invalid value for "release_version", the character length must be great than or equal to 1.')
253
+ end
254
+
255
+ if @release_is_layered.nil?
256
+ invalid_properties.push('invalid value for "release_is_layered", release_is_layered cannot be nil.')
257
+ end
258
+
259
+ if @base_product_name.nil?
260
+ invalid_properties.push('invalid value for "base_product_name", base_product_name cannot be nil.')
261
+ end
262
+
263
+ if @base_product_name.to_s.length < 1
264
+ invalid_properties.push('invalid value for "base_product_name", the character length must be great than or equal to 1.')
265
+ end
266
+
267
+ if @base_product_short.nil?
268
+ invalid_properties.push('invalid value for "base_product_short", base_product_short cannot be nil.')
269
+ end
270
+
271
+ if @base_product_short.to_s.length < 1
272
+ invalid_properties.push('invalid value for "base_product_short", the character length must be great than or equal to 1.')
273
+ end
274
+
275
+ if @base_product_version.nil?
276
+ invalid_properties.push('invalid value for "base_product_version", base_product_version cannot be nil.')
277
+ end
278
+
279
+ if @base_product_version.to_s.length < 1
280
+ invalid_properties.push('invalid value for "base_product_version", the character length must be great than or equal to 1.')
281
+ end
282
+
283
+ if @arch.nil?
284
+ invalid_properties.push('invalid value for "arch", arch cannot be nil.')
285
+ end
286
+
287
+ if @arch.to_s.length < 1
288
+ invalid_properties.push('invalid value for "arch", the character length must be great than or equal to 1.')
289
+ end
290
+
291
+ if @build_timestamp.nil?
292
+ invalid_properties.push('invalid value for "build_timestamp", build_timestamp cannot be nil.')
293
+ end
294
+
295
+ if @instimage.nil?
296
+ invalid_properties.push('invalid value for "instimage", instimage cannot be nil.')
297
+ end
298
+
299
+ if @instimage.to_s.length < 1
300
+ invalid_properties.push('invalid value for "instimage", the character length must be great than or equal to 1.')
301
+ end
302
+
303
+ if @mainimage.nil?
304
+ invalid_properties.push('invalid value for "mainimage", mainimage cannot be nil.')
305
+ end
306
+
307
+ if @mainimage.to_s.length < 1
308
+ invalid_properties.push('invalid value for "mainimage", the character length must be great than or equal to 1.')
309
+ end
310
+
311
+ if @discnum.nil?
312
+ invalid_properties.push('invalid value for "discnum", discnum cannot be nil.')
313
+ end
314
+
315
+ if @totaldiscs.nil?
316
+ invalid_properties.push('invalid value for "totaldiscs", totaldiscs cannot be nil.')
317
+ end
318
+
319
+ if @addons.nil?
320
+ invalid_properties.push('invalid value for "addons", addons cannot be nil.')
321
+ end
322
+
323
+ if @checksums.nil?
324
+ invalid_properties.push('invalid value for "checksums", checksums cannot be nil.')
325
+ end
326
+
327
+ if @images.nil?
328
+ invalid_properties.push('invalid value for "images", images cannot be nil.')
329
+ end
330
+
331
+ if @variants.nil?
332
+ invalid_properties.push('invalid value for "variants", variants cannot be nil.')
333
+ end
334
+
335
+ invalid_properties
336
+ end
337
+
338
+ # Check to see if the all the properties in the model are valid
339
+ # @return true if the model is valid
340
+ def valid?
341
+ return false if @header_version.nil?
342
+ return false if @header_version.to_s.length < 1
343
+ return false if @release_name.nil?
344
+ return false if @release_name.to_s.length < 1
345
+ return false if @release_short.nil?
346
+ return false if @release_short.to_s.length < 1
347
+ return false if @release_version.nil?
348
+ return false if @release_version.to_s.length < 1
349
+ return false if @release_is_layered.nil?
350
+ return false if @base_product_name.nil?
351
+ return false if @base_product_name.to_s.length < 1
352
+ return false if @base_product_short.nil?
353
+ return false if @base_product_short.to_s.length < 1
354
+ return false if @base_product_version.nil?
355
+ return false if @base_product_version.to_s.length < 1
356
+ return false if @arch.nil?
357
+ return false if @arch.to_s.length < 1
358
+ return false if @build_timestamp.nil?
359
+ return false if @instimage.nil?
360
+ return false if @instimage.to_s.length < 1
361
+ return false if @mainimage.nil?
362
+ return false if @mainimage.to_s.length < 1
363
+ return false if @discnum.nil?
364
+ return false if @totaldiscs.nil?
365
+ return false if @addons.nil?
366
+ return false if @checksums.nil?
367
+ return false if @images.nil?
368
+ return false if @variants.nil?
369
+ true
370
+ end
371
+
372
+ # Custom attribute writer method with validation
373
+ # @param [Object] header_version Value to be assigned
374
+ def header_version=(header_version)
375
+ if header_version.nil?
376
+ fail ArgumentError, 'header_version cannot be nil'
377
+ end
378
+
379
+ if header_version.to_s.length < 1
380
+ fail ArgumentError, 'invalid value for "header_version", the character length must be great than or equal to 1.'
381
+ end
382
+
383
+ @header_version = header_version
384
+ end
385
+
386
+ # Custom attribute writer method with validation
387
+ # @param [Object] release_name Value to be assigned
388
+ def release_name=(release_name)
389
+ if release_name.nil?
390
+ fail ArgumentError, 'release_name cannot be nil'
391
+ end
392
+
393
+ if release_name.to_s.length < 1
394
+ fail ArgumentError, 'invalid value for "release_name", the character length must be great than or equal to 1.'
395
+ end
396
+
397
+ @release_name = release_name
398
+ end
399
+
400
+ # Custom attribute writer method with validation
401
+ # @param [Object] release_short Value to be assigned
402
+ def release_short=(release_short)
403
+ if release_short.nil?
404
+ fail ArgumentError, 'release_short cannot be nil'
405
+ end
406
+
407
+ if release_short.to_s.length < 1
408
+ fail ArgumentError, 'invalid value for "release_short", the character length must be great than or equal to 1.'
409
+ end
410
+
411
+ @release_short = release_short
412
+ end
413
+
414
+ # Custom attribute writer method with validation
415
+ # @param [Object] release_version Value to be assigned
416
+ def release_version=(release_version)
417
+ if release_version.nil?
418
+ fail ArgumentError, 'release_version cannot be nil'
419
+ end
420
+
421
+ if release_version.to_s.length < 1
422
+ fail ArgumentError, 'invalid value for "release_version", the character length must be great than or equal to 1.'
423
+ end
424
+
425
+ @release_version = release_version
426
+ end
427
+
428
+ # Custom attribute writer method with validation
429
+ # @param [Object] base_product_name Value to be assigned
430
+ def base_product_name=(base_product_name)
431
+ if base_product_name.nil?
432
+ fail ArgumentError, 'base_product_name cannot be nil'
433
+ end
434
+
435
+ if base_product_name.to_s.length < 1
436
+ fail ArgumentError, 'invalid value for "base_product_name", the character length must be great than or equal to 1.'
437
+ end
438
+
439
+ @base_product_name = base_product_name
440
+ end
441
+
442
+ # Custom attribute writer method with validation
443
+ # @param [Object] base_product_short Value to be assigned
444
+ def base_product_short=(base_product_short)
445
+ if base_product_short.nil?
446
+ fail ArgumentError, 'base_product_short cannot be nil'
447
+ end
448
+
449
+ if base_product_short.to_s.length < 1
450
+ fail ArgumentError, 'invalid value for "base_product_short", the character length must be great than or equal to 1.'
451
+ end
452
+
453
+ @base_product_short = base_product_short
454
+ end
455
+
456
+ # Custom attribute writer method with validation
457
+ # @param [Object] base_product_version Value to be assigned
458
+ def base_product_version=(base_product_version)
459
+ if base_product_version.nil?
460
+ fail ArgumentError, 'base_product_version cannot be nil'
461
+ end
462
+
463
+ if base_product_version.to_s.length < 1
464
+ fail ArgumentError, 'invalid value for "base_product_version", the character length must be great than or equal to 1.'
465
+ end
466
+
467
+ @base_product_version = base_product_version
468
+ end
469
+
470
+ # Custom attribute writer method with validation
471
+ # @param [Object] arch Value to be assigned
472
+ def arch=(arch)
473
+ if arch.nil?
474
+ fail ArgumentError, 'arch cannot be nil'
475
+ end
476
+
477
+ if arch.to_s.length < 1
478
+ fail ArgumentError, 'invalid value for "arch", the character length must be great than or equal to 1.'
479
+ end
480
+
481
+ @arch = arch
482
+ end
483
+
484
+ # Custom attribute writer method with validation
485
+ # @param [Object] instimage Value to be assigned
486
+ def instimage=(instimage)
487
+ if instimage.nil?
488
+ fail ArgumentError, 'instimage cannot be nil'
489
+ end
490
+
491
+ if instimage.to_s.length < 1
492
+ fail ArgumentError, 'invalid value for "instimage", the character length must be great than or equal to 1.'
493
+ end
494
+
495
+ @instimage = instimage
496
+ end
497
+
498
+ # Custom attribute writer method with validation
499
+ # @param [Object] mainimage Value to be assigned
500
+ def mainimage=(mainimage)
501
+ if mainimage.nil?
502
+ fail ArgumentError, 'mainimage cannot be nil'
503
+ end
504
+
505
+ if mainimage.to_s.length < 1
506
+ fail ArgumentError, 'invalid value for "mainimage", the character length must be great than or equal to 1.'
507
+ end
508
+
509
+ @mainimage = mainimage
510
+ end
511
+
512
+ # Checks equality by comparing each attribute.
513
+ # @param [Object] Object to be compared
514
+ def ==(o)
515
+ return true if self.equal?(o)
516
+ self.class == o.class &&
517
+ _href == o._href &&
518
+ header_version == o.header_version &&
519
+ release_name == o.release_name &&
520
+ release_short == o.release_short &&
521
+ release_version == o.release_version &&
522
+ release_is_layered == o.release_is_layered &&
523
+ base_product_name == o.base_product_name &&
524
+ base_product_short == o.base_product_short &&
525
+ base_product_version == o.base_product_version &&
526
+ arch == o.arch &&
527
+ build_timestamp == o.build_timestamp &&
528
+ instimage == o.instimage &&
529
+ mainimage == o.mainimage &&
530
+ discnum == o.discnum &&
531
+ totaldiscs == o.totaldiscs &&
532
+ addons == o.addons &&
533
+ checksums == o.checksums &&
534
+ images == o.images &&
535
+ variants == o.variants
536
+ end
537
+
538
+ # @see the `==` method
539
+ # @param [Object] Object to be compared
540
+ def eql?(o)
541
+ self == o
542
+ end
543
+
544
+ # Calculates hash code according to all attributes.
545
+ # @return [Integer] Hash code
546
+ def hash
547
+ [_href, header_version, release_name, release_short, release_version, release_is_layered, base_product_name, base_product_short, base_product_version, arch, build_timestamp, instimage, mainimage, discnum, totaldiscs, addons, checksums, images, variants].hash
548
+ end
549
+
550
+ # Builds the object from hash
551
+ # @param [Hash] attributes Model attributes in the form of hash
552
+ # @return [Object] Returns the model itself
553
+ def self.build_from_hash(attributes)
554
+ new.build_from_hash(attributes)
555
+ end
556
+
557
+ # Builds the object from hash
558
+ # @param [Hash] attributes Model attributes in the form of hash
559
+ # @return [Object] Returns the model itself
560
+ def build_from_hash(attributes)
561
+ return nil unless attributes.is_a?(Hash)
562
+ self.class.openapi_types.each_pair do |key, type|
563
+ if type =~ /\AArray<(.*)>/i
564
+ # check to ensure the input is an array given that the attribute
565
+ # is documented as an array but the input is not
566
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
567
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
568
+ end
569
+ elsif !attributes[self.class.attribute_map[key]].nil?
570
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
571
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
572
+ end
573
+
574
+ self
575
+ end
576
+
577
+ # Deserializes the data based on type
578
+ # @param string type Data type
579
+ # @param string value Value to be deserialized
580
+ # @return [Object] Deserialized data
581
+ def _deserialize(type, value)
582
+ case type.to_sym
583
+ when :DateTime
584
+ DateTime.parse(value)
585
+ when :Date
586
+ Date.parse(value)
587
+ when :String
588
+ value.to_s
589
+ when :Integer
590
+ value.to_i
591
+ when :Float
592
+ value.to_f
593
+ when :Boolean
594
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
595
+ true
596
+ else
597
+ false
598
+ end
599
+ when :Object
600
+ # generic object (usually a Hash), return directly
601
+ value
602
+ when /\AArray<(?<inner_type>.+)>\z/
603
+ inner_type = Regexp.last_match[:inner_type]
604
+ value.map { |v| _deserialize(inner_type, v) }
605
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
606
+ k_type = Regexp.last_match[:k_type]
607
+ v_type = Regexp.last_match[:v_type]
608
+ {}.tap do |hash|
609
+ value.each do |k, v|
610
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
611
+ end
612
+ end
613
+ else # model
614
+ PulpRpmClient.const_get(type).build_from_hash(value)
615
+ end
616
+ end
617
+
618
+ # Returns the string representation of the object
619
+ # @return [String] String presentation of the object
620
+ def to_s
621
+ to_hash.to_s
622
+ end
623
+
624
+ # to_body is an alias to to_hash (backward compatibility)
625
+ # @return [Hash] Returns the object in the form of hash
626
+ def to_body
627
+ to_hash
628
+ end
629
+
630
+ # Returns the object in the form of hash
631
+ # @return [Hash] Returns the object in the form of hash
632
+ def to_hash
633
+ hash = {}
634
+ self.class.attribute_map.each_pair do |attr, param|
635
+ value = self.send(attr)
636
+ next if value.nil?
637
+ hash[param] = _to_hash(value)
638
+ end
639
+ hash
640
+ end
641
+
642
+ # Outputs non-array value in the form of hash
643
+ # For object, use to_hash. Otherwise, just return the value
644
+ # @param [Object] value Any valid value
645
+ # @return [Hash] Returns the value in the form of hash
646
+ def _to_hash(value)
647
+ if value.is_a?(Array)
648
+ value.compact.map { |v| _to_hash(v) }
649
+ elsif value.is_a?(Hash)
650
+ {}.tap do |hash|
651
+ value.each { |k, v| hash[k] = _to_hash(v) }
652
+ end
653
+ elsif value.respond_to? :to_hash
654
+ value.to_hash
655
+ else
656
+ value
657
+ end
658
+ end
659
+ end
660
+ end