pulp_rpm_client 3.0.0b71572533171 → 3.0.0rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (174) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +63 -22
  3. data/docs/ContentAdvisoriesApi.md +15 -7
  4. data/docs/ContentDistributionTreesApi.md +2 -2
  5. data/docs/ContentModulemdDefaultsApi.md +6 -6
  6. data/docs/{ContentModulemdApi.md → ContentModulemdsApi.md} +14 -14
  7. data/docs/ContentPackagecategoriesApi.md +189 -0
  8. data/docs/ContentPackageenvironmentsApi.md +189 -0
  9. data/docs/ContentPackagegroupsApi.md +189 -0
  10. data/docs/ContentPackagelangpacksApi.md +189 -0
  11. data/docs/ContentPackagesApi.md +4 -4
  12. data/docs/ContentRepoMetadataFilesApi.md +4 -4
  13. data/docs/ContentSummary.md +21 -0
  14. data/docs/DistributionsRpmApi.md +10 -10
  15. data/docs/InlineResponse200.md +1 -1
  16. data/docs/InlineResponse2001.md +1 -1
  17. data/docs/InlineResponse20010.md +23 -0
  18. data/docs/InlineResponse20011.md +23 -0
  19. data/docs/InlineResponse20012.md +23 -0
  20. data/docs/InlineResponse20013.md +23 -0
  21. data/docs/InlineResponse20014.md +23 -0
  22. data/docs/InlineResponse2002.md +1 -1
  23. data/docs/InlineResponse2003.md +1 -1
  24. data/docs/InlineResponse2004.md +1 -1
  25. data/docs/InlineResponse2005.md +1 -1
  26. data/docs/InlineResponse2006.md +1 -1
  27. data/docs/InlineResponse2007.md +1 -1
  28. data/docs/InlineResponse2008.md +1 -1
  29. data/docs/InlineResponse2009.md +23 -0
  30. data/docs/PublicationsRpmApi.md +6 -6
  31. data/docs/RemotesRpmApi.md +12 -68
  32. data/docs/RepositoriesRpmApi.md +465 -0
  33. data/docs/RepositoriesRpmVersionsApi.md +214 -0
  34. data/docs/RepositoryAddRemoveContent.md +21 -0
  35. data/docs/RepositorySyncURL.md +2 -2
  36. data/docs/RepositoryVersion.md +25 -0
  37. data/docs/{DistributionTree.md → RpmDistributionTree.md} +2 -2
  38. data/docs/{Modulemd.md → RpmModulemd.md} +2 -8
  39. data/docs/{ModulemdDefaults.md → RpmModulemdDefaults.md} +2 -8
  40. data/docs/{Package.md → RpmPackage.md} +2 -8
  41. data/docs/RpmPackageCategory.md +33 -0
  42. data/docs/RpmPackageEnvironment.md +37 -0
  43. data/docs/RpmPackageGroup.md +39 -0
  44. data/docs/RpmPackageLangpacks.md +19 -0
  45. data/docs/{RepoMetadataFile.md → RpmRepoMetadataFile.md} +2 -8
  46. data/docs/{RpmDistribution.md → RpmRpmDistribution.md} +2 -2
  47. data/docs/{RpmPublication.md → RpmRpmPublication.md} +2 -2
  48. data/docs/{RpmRemote.md → RpmRpmRemote.md} +10 -14
  49. data/docs/RpmRpmRepository.md +27 -0
  50. data/docs/RpmUpdateCollection.md +21 -0
  51. data/docs/{UpdateRecord.md → RpmUpdateRecord.md} +24 -20
  52. data/lib/pulp_rpm_client/api/content_advisories_api.rb +28 -14
  53. data/lib/pulp_rpm_client/api/content_distribution_trees_api.rb +4 -4
  54. data/lib/pulp_rpm_client/api/content_modulemd_defaults_api.rb +8 -8
  55. data/lib/pulp_rpm_client/api/{content_modulemd_api.rb → content_modulemds_api.rb} +30 -30
  56. data/lib/pulp_rpm_client/api/content_packagecategories_api.rb +227 -0
  57. data/lib/pulp_rpm_client/api/content_packageenvironments_api.rb +227 -0
  58. data/lib/pulp_rpm_client/api/content_packagegroups_api.rb +227 -0
  59. data/lib/pulp_rpm_client/api/content_packagelangpacks_api.rb +227 -0
  60. data/lib/pulp_rpm_client/api/content_packages_api.rb +7 -7
  61. data/lib/pulp_rpm_client/api/content_repo_metadata_files_api.rb +7 -7
  62. data/lib/pulp_rpm_client/api/distributions_rpm_api.rb +13 -13
  63. data/lib/pulp_rpm_client/api/publications_rpm_api.rb +9 -9
  64. data/lib/pulp_rpm_client/api/remotes_rpm_api.rb +16 -86
  65. data/lib/pulp_rpm_client/api/repositories_rpm_api.rb +568 -0
  66. data/lib/pulp_rpm_client/api/repositories_rpm_versions_api.rb +268 -0
  67. data/lib/pulp_rpm_client/api_client.rb +1 -1
  68. data/lib/pulp_rpm_client/api_error.rb +1 -1
  69. data/lib/pulp_rpm_client/configuration.rb +1 -1
  70. data/lib/pulp_rpm_client/models/addon.rb +12 -2
  71. data/lib/pulp_rpm_client/models/artifact.rb +18 -2
  72. data/lib/pulp_rpm_client/models/async_operation_response.rb +12 -2
  73. data/lib/pulp_rpm_client/models/checksum.rb +12 -2
  74. data/lib/pulp_rpm_client/models/content_summary.rb +246 -0
  75. data/lib/pulp_rpm_client/models/image.rb +12 -2
  76. data/lib/pulp_rpm_client/models/inline_response200.rb +15 -3
  77. data/lib/pulp_rpm_client/models/inline_response2001.rb +15 -3
  78. data/lib/pulp_rpm_client/models/inline_response20010.rb +247 -0
  79. data/lib/pulp_rpm_client/models/inline_response20011.rb +247 -0
  80. data/lib/pulp_rpm_client/models/inline_response20012.rb +247 -0
  81. data/lib/pulp_rpm_client/models/inline_response20013.rb +247 -0
  82. data/lib/pulp_rpm_client/models/inline_response20014.rb +247 -0
  83. data/lib/pulp_rpm_client/models/inline_response2002.rb +15 -3
  84. data/lib/pulp_rpm_client/models/inline_response2003.rb +15 -3
  85. data/lib/pulp_rpm_client/models/inline_response2004.rb +15 -3
  86. data/lib/pulp_rpm_client/models/inline_response2005.rb +15 -3
  87. data/lib/pulp_rpm_client/models/inline_response2006.rb +15 -3
  88. data/lib/pulp_rpm_client/models/inline_response2007.rb +15 -3
  89. data/lib/pulp_rpm_client/models/inline_response2008.rb +15 -3
  90. data/lib/pulp_rpm_client/models/inline_response2009.rb +247 -0
  91. data/lib/pulp_rpm_client/models/repository_add_remove_content.rb +231 -0
  92. data/lib/pulp_rpm_client/models/repository_sync_url.rb +22 -12
  93. data/lib/pulp_rpm_client/models/repository_version.rb +244 -0
  94. data/lib/pulp_rpm_client/models/{distribution_tree.rb → rpm_distribution_tree.rb} +15 -5
  95. data/lib/pulp_rpm_client/models/{modulemd.rb → rpm_modulemd.rb} +16 -60
  96. data/lib/pulp_rpm_client/models/{modulemd_defaults.rb → rpm_modulemd_defaults.rb} +16 -60
  97. data/lib/pulp_rpm_client/models/{package.rb → rpm_package.rb} +16 -60
  98. data/lib/pulp_rpm_client/models/rpm_package_category.rb +405 -0
  99. data/lib/pulp_rpm_client/models/rpm_package_environment.rb +432 -0
  100. data/lib/pulp_rpm_client/models/rpm_package_group.rb +435 -0
  101. data/lib/pulp_rpm_client/models/rpm_package_langpacks.rb +246 -0
  102. data/lib/pulp_rpm_client/models/{repo_metadata_file.rb → rpm_repo_metadata_file.rb} +16 -60
  103. data/lib/pulp_rpm_client/models/{rpm_distribution.rb → rpm_rpm_distribution.rb} +17 -23
  104. data/lib/pulp_rpm_client/models/{rpm_publication.rb → rpm_rpm_publication.rb} +16 -5
  105. data/lib/pulp_rpm_client/models/{rpm_remote.rb → rpm_rpm_remote.rb} +69 -105
  106. data/lib/pulp_rpm_client/models/rpm_rpm_repository.rb +294 -0
  107. data/lib/pulp_rpm_client/models/rpm_update_collection.rb +240 -0
  108. data/lib/pulp_rpm_client/models/{update_record.rb → rpm_update_record.rb} +49 -239
  109. data/lib/pulp_rpm_client/models/variant.rb +12 -2
  110. data/lib/pulp_rpm_client/version.rb +2 -2
  111. data/lib/pulp_rpm_client.rb +32 -12
  112. data/pulp_rpm_client.gemspec +1 -1
  113. data/spec/api/content_advisories_api_spec.rb +6 -3
  114. data/spec/api/content_distribution_trees_api_spec.rb +2 -2
  115. data/spec/api/content_modulemd_defaults_api_spec.rb +3 -3
  116. data/spec/api/{content_modulemd_api_spec.rb → content_modulemds_api_spec.rb} +9 -9
  117. data/spec/api/content_packagecategories_api_spec.rb +79 -0
  118. data/spec/api/content_packageenvironments_api_spec.rb +79 -0
  119. data/spec/api/content_packagegroups_api_spec.rb +79 -0
  120. data/spec/api/content_packagelangpacks_api_spec.rb +79 -0
  121. data/spec/api/content_packages_api_spec.rb +3 -3
  122. data/spec/api/content_repo_metadata_files_api_spec.rb +3 -3
  123. data/spec/api/distributions_rpm_api_spec.rb +3 -3
  124. data/spec/api/publications_rpm_api_spec.rb +3 -3
  125. data/spec/api/remotes_rpm_api_spec.rb +4 -17
  126. data/spec/api/repositories_rpm_api_spec.rb +141 -0
  127. data/spec/api/repositories_rpm_versions_api_spec.rb +91 -0
  128. data/spec/api_client_spec.rb +1 -1
  129. data/spec/configuration_spec.rb +1 -1
  130. data/spec/models/addon_spec.rb +1 -1
  131. data/spec/models/artifact_spec.rb +1 -1
  132. data/spec/models/async_operation_response_spec.rb +1 -1
  133. data/spec/models/checksum_spec.rb +1 -1
  134. data/spec/models/content_summary_spec.rb +53 -0
  135. data/spec/models/image_spec.rb +1 -1
  136. data/spec/models/inline_response20010_spec.rb +59 -0
  137. data/spec/models/inline_response20011_spec.rb +59 -0
  138. data/spec/models/inline_response20012_spec.rb +59 -0
  139. data/spec/models/inline_response20013_spec.rb +59 -0
  140. data/spec/models/inline_response20014_spec.rb +59 -0
  141. data/spec/models/inline_response2001_spec.rb +1 -1
  142. data/spec/models/inline_response2002_spec.rb +1 -1
  143. data/spec/models/inline_response2003_spec.rb +1 -1
  144. data/spec/models/inline_response2004_spec.rb +1 -1
  145. data/spec/models/inline_response2005_spec.rb +1 -1
  146. data/spec/models/inline_response2006_spec.rb +1 -1
  147. data/spec/models/inline_response2007_spec.rb +1 -1
  148. data/spec/models/inline_response2008_spec.rb +1 -1
  149. data/spec/models/inline_response2009_spec.rb +59 -0
  150. data/spec/models/inline_response200_spec.rb +1 -1
  151. data/spec/models/repository_add_remove_content_spec.rb +53 -0
  152. data/spec/models/repository_sync_url_spec.rb +2 -2
  153. data/spec/models/repository_version_spec.rb +65 -0
  154. data/spec/models/{distribution_tree_spec.rb → rpm_distribution_tree_spec.rb} +7 -7
  155. data/spec/models/{modulemd_defaults_spec.rb → rpm_modulemd_defaults_spec.rb} +7 -25
  156. data/spec/models/{modulemd_spec.rb → rpm_modulemd_spec.rb} +7 -25
  157. data/spec/models/{repo_metadata_file_spec.rb → rpm_package_category_spec.rb} +16 -16
  158. data/spec/models/rpm_package_environment_spec.rb +101 -0
  159. data/spec/models/rpm_package_group_spec.rb +107 -0
  160. data/spec/models/rpm_package_langpacks_spec.rb +47 -0
  161. data/spec/models/{package_spec.rb → rpm_package_spec.rb} +7 -25
  162. data/spec/models/rpm_repo_metadata_file_spec.rb +71 -0
  163. data/spec/models/{rpm_distribution_spec.rb → rpm_rpm_distribution_spec.rb} +7 -7
  164. data/spec/models/{rpm_publication_spec.rb → rpm_rpm_publication_spec.rb} +7 -7
  165. data/spec/models/{rpm_remote_spec.rb → rpm_rpm_remote_spec.rb} +11 -23
  166. data/spec/models/rpm_rpm_repository_spec.rb +71 -0
  167. data/spec/models/rpm_update_collection_spec.rb +53 -0
  168. data/spec/models/{update_record_spec.rb → rpm_update_record_spec.rb} +19 -7
  169. data/spec/models/variant_spec.rb +1 -1
  170. data/spec/spec_helper.rb +1 -1
  171. metadata +126 -46
  172. data/docs/RpmCopyApi.md +0 -70
  173. data/lib/pulp_rpm_client/api/rpm_copy_api.rb +0 -96
  174. data/spec/api/rpm_copy_api_spec.rb +0 -50
@@ -6,14 +6,14 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.1-SNAPSHOT
9
+ OpenAPI Generator version: 4.2.2-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
14
 
15
15
  module PulpRpmClient
16
- class Package
16
+ class RpmPackage
17
17
  attr_accessor :pulp_href
18
18
 
19
19
  # Timestamp of creation.
@@ -22,15 +22,6 @@ module PulpRpmClient
22
22
  # Artifact file representing the physical content
23
23
  attr_accessor :artifact
24
24
 
25
- # Path where the artifact is located relative to distributions base_path
26
- attr_accessor :relative_path
27
-
28
- # An uploaded file that should be turned into the artifact of the content unit.
29
- attr_accessor :file
30
-
31
- # A URI of a repository the new content unit should be associated with.
32
- attr_accessor :repository
33
-
34
25
  # Name of the package
35
26
  attr_accessor :name
36
27
 
@@ -145,9 +136,6 @@ module PulpRpmClient
145
136
  :'pulp_href' => :'pulp_href',
146
137
  :'pulp_created' => :'pulp_created',
147
138
  :'artifact' => :'artifact',
148
- :'relative_path' => :'relative_path',
149
- :'file' => :'file',
150
- :'repository' => :'repository',
151
139
  :'name' => :'name',
152
140
  :'epoch' => :'epoch',
153
141
  :'version' => :'version',
@@ -193,9 +181,6 @@ module PulpRpmClient
193
181
  :'pulp_href' => :'String',
194
182
  :'pulp_created' => :'DateTime',
195
183
  :'artifact' => :'String',
196
- :'relative_path' => :'String',
197
- :'file' => :'String',
198
- :'repository' => :'String',
199
184
  :'name' => :'String',
200
185
  :'epoch' => :'String',
201
186
  :'version' => :'String',
@@ -235,17 +220,23 @@ module PulpRpmClient
235
220
  }
236
221
  end
237
222
 
223
+ # List of attributes with nullable: true
224
+ def self.openapi_nullable
225
+ Set.new([
226
+ ])
227
+ end
228
+
238
229
  # Initializes the object
239
230
  # @param [Hash] attributes Model attributes in the form of hash
240
231
  def initialize(attributes = {})
241
232
  if (!attributes.is_a?(Hash))
242
- fail ArgumentError, "The input argument (attributes) must be a hash in `PulpRpmClient::Package` initialize method"
233
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpRpmClient::RpmPackage` initialize method"
243
234
  end
244
235
 
245
236
  # check to see if the attribute exists and convert string to symbol for hash key
246
237
  attributes = attributes.each_with_object({}) { |(k, v), h|
247
238
  if (!self.class.attribute_map.key?(k.to_sym))
248
- 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
239
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpRpmClient::RpmPackage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
249
240
  end
250
241
  h[k.to_sym] = v
251
242
  }
@@ -262,18 +253,6 @@ module PulpRpmClient
262
253
  self.artifact = attributes[:'artifact']
263
254
  end
264
255
 
265
- if attributes.key?(:'relative_path')
266
- self.relative_path = attributes[:'relative_path']
267
- end
268
-
269
- if attributes.key?(:'file')
270
- self.file = attributes[:'file']
271
- end
272
-
273
- if attributes.key?(:'repository')
274
- self.repository = attributes[:'repository']
275
- end
276
-
277
256
  if attributes.key?(:'name')
278
257
  self.name = attributes[:'name']
279
258
  end
@@ -423,14 +402,6 @@ module PulpRpmClient
423
402
  # @return Array for valid properties with the reasons
424
403
  def list_invalid_properties
425
404
  invalid_properties = Array.new
426
- if @relative_path.nil?
427
- invalid_properties.push('invalid value for "relative_path", relative_path cannot be nil.')
428
- end
429
-
430
- if @relative_path.to_s.length < 1
431
- invalid_properties.push('invalid value for "relative_path", the character length must be great than or equal to 1.')
432
- end
433
-
434
405
  if !@name.nil? && @name.to_s.length < 1
435
406
  invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
436
407
  end
@@ -465,8 +436,6 @@ module PulpRpmClient
465
436
  # Check to see if the all the properties in the model are valid
466
437
  # @return true if the model is valid
467
438
  def valid?
468
- return false if @relative_path.nil?
469
- return false if @relative_path.to_s.length < 1
470
439
  return false if !@name.nil? && @name.to_s.length < 1
471
440
  return false if !@version.nil? && @version.to_s.length < 1
472
441
  return false if !@release.nil? && @release.to_s.length < 1
@@ -477,20 +446,6 @@ module PulpRpmClient
477
446
  true
478
447
  end
479
448
 
480
- # Custom attribute writer method with validation
481
- # @param [Object] relative_path Value to be assigned
482
- def relative_path=(relative_path)
483
- if relative_path.nil?
484
- fail ArgumentError, 'relative_path cannot be nil'
485
- end
486
-
487
- if relative_path.to_s.length < 1
488
- fail ArgumentError, 'invalid value for "relative_path", the character length must be great than or equal to 1.'
489
- end
490
-
491
- @relative_path = relative_path
492
- end
493
-
494
449
  # Custom attribute writer method with validation
495
450
  # @param [Object] name Value to be assigned
496
451
  def name=(name)
@@ -569,9 +524,6 @@ module PulpRpmClient
569
524
  pulp_href == o.pulp_href &&
570
525
  pulp_created == o.pulp_created &&
571
526
  artifact == o.artifact &&
572
- relative_path == o.relative_path &&
573
- file == o.file &&
574
- repository == o.repository &&
575
527
  name == o.name &&
576
528
  epoch == o.epoch &&
577
529
  version == o.version &&
@@ -619,7 +571,7 @@ module PulpRpmClient
619
571
  # Calculates hash code according to all attributes.
620
572
  # @return [Integer] Hash code
621
573
  def hash
622
- [pulp_href, pulp_created, artifact, relative_path, file, repository, 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, is_modular, size_archive, size_installed, size_package, time_build, time_file].hash
574
+ [pulp_href, pulp_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, is_modular, size_archive, size_installed, size_package, time_build, time_file].hash
623
575
  end
624
576
 
625
577
  # Builds the object from hash
@@ -708,7 +660,11 @@ module PulpRpmClient
708
660
  hash = {}
709
661
  self.class.attribute_map.each_pair do |attr, param|
710
662
  value = self.send(attr)
711
- next if value.nil?
663
+ if value.nil?
664
+ is_nullable = self.class.openapi_nullable.include?(attr)
665
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
666
+ end
667
+
712
668
  hash[param] = _to_hash(value)
713
669
  end
714
670
  hash
@@ -0,0 +1,405 @@
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.2.2-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpRpmClient
16
+ class RpmPackageCategory
17
+ # Category id.
18
+ attr_accessor :id
19
+
20
+ # Category name.
21
+ attr_accessor :name
22
+
23
+ # Category description.
24
+ attr_accessor :description
25
+
26
+ # Category display order.
27
+ attr_accessor :display_order
28
+
29
+ # Category group list.
30
+ attr_accessor :group_ids
31
+
32
+ # Category description by language.
33
+ attr_accessor :desc_by_lang
34
+
35
+ # Category name by language.
36
+ attr_accessor :name_by_lang
37
+
38
+ # Category digest.
39
+ attr_accessor :digest
40
+
41
+ # PackageGroups related to this category.
42
+ attr_accessor :packagegroups
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'id' => :'id',
48
+ :'name' => :'name',
49
+ :'description' => :'description',
50
+ :'display_order' => :'display_order',
51
+ :'group_ids' => :'group_ids',
52
+ :'desc_by_lang' => :'desc_by_lang',
53
+ :'name_by_lang' => :'name_by_lang',
54
+ :'digest' => :'digest',
55
+ :'packagegroups' => :'packagegroups'
56
+ }
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+ :'id' => :'String',
63
+ :'name' => :'String',
64
+ :'description' => :'String',
65
+ :'display_order' => :'Integer',
66
+ :'group_ids' => :'Object',
67
+ :'desc_by_lang' => :'Object',
68
+ :'name_by_lang' => :'Object',
69
+ :'digest' => :'String',
70
+ :'packagegroups' => :'Array<String>'
71
+ }
72
+ end
73
+
74
+ # List of attributes with nullable: true
75
+ def self.openapi_nullable
76
+ Set.new([
77
+ ])
78
+ end
79
+
80
+ # Initializes the object
81
+ # @param [Hash] attributes Model attributes in the form of hash
82
+ def initialize(attributes = {})
83
+ if (!attributes.is_a?(Hash))
84
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpRpmClient::RpmPackageCategory` initialize method"
85
+ end
86
+
87
+ # check to see if the attribute exists and convert string to symbol for hash key
88
+ attributes = attributes.each_with_object({}) { |(k, v), h|
89
+ if (!self.class.attribute_map.key?(k.to_sym))
90
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpRpmClient::RpmPackageCategory`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
91
+ end
92
+ h[k.to_sym] = v
93
+ }
94
+
95
+ if attributes.key?(:'id')
96
+ self.id = attributes[:'id']
97
+ end
98
+
99
+ if attributes.key?(:'name')
100
+ self.name = attributes[:'name']
101
+ end
102
+
103
+ if attributes.key?(:'description')
104
+ self.description = attributes[:'description']
105
+ end
106
+
107
+ if attributes.key?(:'display_order')
108
+ self.display_order = attributes[:'display_order']
109
+ end
110
+
111
+ if attributes.key?(:'group_ids')
112
+ self.group_ids = attributes[:'group_ids']
113
+ end
114
+
115
+ if attributes.key?(:'desc_by_lang')
116
+ self.desc_by_lang = attributes[:'desc_by_lang']
117
+ end
118
+
119
+ if attributes.key?(:'name_by_lang')
120
+ self.name_by_lang = attributes[:'name_by_lang']
121
+ end
122
+
123
+ if attributes.key?(:'digest')
124
+ self.digest = attributes[:'digest']
125
+ end
126
+
127
+ if attributes.key?(:'packagegroups')
128
+ if (value = attributes[:'packagegroups']).is_a?(Array)
129
+ self.packagegroups = value
130
+ end
131
+ end
132
+ end
133
+
134
+ # Show invalid properties with the reasons. Usually used together with valid?
135
+ # @return Array for valid properties with the reasons
136
+ def list_invalid_properties
137
+ invalid_properties = Array.new
138
+ if @id.nil?
139
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
140
+ end
141
+
142
+ if @id.to_s.length < 1
143
+ invalid_properties.push('invalid value for "id", the character length must be great than or equal to 1.')
144
+ end
145
+
146
+ if @name.nil?
147
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
148
+ end
149
+
150
+ if @name.to_s.length < 1
151
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
152
+ end
153
+
154
+ if @description.nil?
155
+ invalid_properties.push('invalid value for "description", description cannot be nil.')
156
+ end
157
+
158
+ if @description.to_s.length < 1
159
+ invalid_properties.push('invalid value for "description", the character length must be great than or equal to 1.')
160
+ end
161
+
162
+ if @display_order.nil?
163
+ invalid_properties.push('invalid value for "display_order", display_order cannot be nil.')
164
+ end
165
+
166
+ if @group_ids.nil?
167
+ invalid_properties.push('invalid value for "group_ids", group_ids cannot be nil.')
168
+ end
169
+
170
+ if @desc_by_lang.nil?
171
+ invalid_properties.push('invalid value for "desc_by_lang", desc_by_lang cannot be nil.')
172
+ end
173
+
174
+ if @name_by_lang.nil?
175
+ invalid_properties.push('invalid value for "name_by_lang", name_by_lang cannot be nil.')
176
+ end
177
+
178
+ if @digest.nil?
179
+ invalid_properties.push('invalid value for "digest", digest cannot be nil.')
180
+ end
181
+
182
+ if @digest.to_s.length < 1
183
+ invalid_properties.push('invalid value for "digest", the character length must be great than or equal to 1.')
184
+ end
185
+
186
+ invalid_properties
187
+ end
188
+
189
+ # Check to see if the all the properties in the model are valid
190
+ # @return true if the model is valid
191
+ def valid?
192
+ return false if @id.nil?
193
+ return false if @id.to_s.length < 1
194
+ return false if @name.nil?
195
+ return false if @name.to_s.length < 1
196
+ return false if @description.nil?
197
+ return false if @description.to_s.length < 1
198
+ return false if @display_order.nil?
199
+ return false if @group_ids.nil?
200
+ return false if @desc_by_lang.nil?
201
+ return false if @name_by_lang.nil?
202
+ return false if @digest.nil?
203
+ return false if @digest.to_s.length < 1
204
+ true
205
+ end
206
+
207
+ # Custom attribute writer method with validation
208
+ # @param [Object] id Value to be assigned
209
+ def id=(id)
210
+ if id.nil?
211
+ fail ArgumentError, 'id cannot be nil'
212
+ end
213
+
214
+ if id.to_s.length < 1
215
+ fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 1.'
216
+ end
217
+
218
+ @id = id
219
+ end
220
+
221
+ # Custom attribute writer method with validation
222
+ # @param [Object] name Value to be assigned
223
+ def name=(name)
224
+ if name.nil?
225
+ fail ArgumentError, 'name cannot be nil'
226
+ end
227
+
228
+ if name.to_s.length < 1
229
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
230
+ end
231
+
232
+ @name = name
233
+ end
234
+
235
+ # Custom attribute writer method with validation
236
+ # @param [Object] description Value to be assigned
237
+ def description=(description)
238
+ if description.nil?
239
+ fail ArgumentError, 'description cannot be nil'
240
+ end
241
+
242
+ if description.to_s.length < 1
243
+ fail ArgumentError, 'invalid value for "description", the character length must be great than or equal to 1.'
244
+ end
245
+
246
+ @description = description
247
+ end
248
+
249
+ # Custom attribute writer method with validation
250
+ # @param [Object] digest Value to be assigned
251
+ def digest=(digest)
252
+ if digest.nil?
253
+ fail ArgumentError, 'digest cannot be nil'
254
+ end
255
+
256
+ if digest.to_s.length < 1
257
+ fail ArgumentError, 'invalid value for "digest", the character length must be great than or equal to 1.'
258
+ end
259
+
260
+ @digest = digest
261
+ end
262
+
263
+ # Checks equality by comparing each attribute.
264
+ # @param [Object] Object to be compared
265
+ def ==(o)
266
+ return true if self.equal?(o)
267
+ self.class == o.class &&
268
+ id == o.id &&
269
+ name == o.name &&
270
+ description == o.description &&
271
+ display_order == o.display_order &&
272
+ group_ids == o.group_ids &&
273
+ desc_by_lang == o.desc_by_lang &&
274
+ name_by_lang == o.name_by_lang &&
275
+ digest == o.digest &&
276
+ packagegroups == o.packagegroups
277
+ end
278
+
279
+ # @see the `==` method
280
+ # @param [Object] Object to be compared
281
+ def eql?(o)
282
+ self == o
283
+ end
284
+
285
+ # Calculates hash code according to all attributes.
286
+ # @return [Integer] Hash code
287
+ def hash
288
+ [id, name, description, display_order, group_ids, desc_by_lang, name_by_lang, digest, packagegroups].hash
289
+ end
290
+
291
+ # Builds the object from hash
292
+ # @param [Hash] attributes Model attributes in the form of hash
293
+ # @return [Object] Returns the model itself
294
+ def self.build_from_hash(attributes)
295
+ new.build_from_hash(attributes)
296
+ end
297
+
298
+ # Builds the object from hash
299
+ # @param [Hash] attributes Model attributes in the form of hash
300
+ # @return [Object] Returns the model itself
301
+ def build_from_hash(attributes)
302
+ return nil unless attributes.is_a?(Hash)
303
+ self.class.openapi_types.each_pair do |key, type|
304
+ if type =~ /\AArray<(.*)>/i
305
+ # check to ensure the input is an array given that the attribute
306
+ # is documented as an array but the input is not
307
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
308
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
309
+ end
310
+ elsif !attributes[self.class.attribute_map[key]].nil?
311
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
312
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
313
+ end
314
+
315
+ self
316
+ end
317
+
318
+ # Deserializes the data based on type
319
+ # @param string type Data type
320
+ # @param string value Value to be deserialized
321
+ # @return [Object] Deserialized data
322
+ def _deserialize(type, value)
323
+ case type.to_sym
324
+ when :DateTime
325
+ DateTime.parse(value)
326
+ when :Date
327
+ Date.parse(value)
328
+ when :String
329
+ value.to_s
330
+ when :Integer
331
+ value.to_i
332
+ when :Float
333
+ value.to_f
334
+ when :Boolean
335
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
336
+ true
337
+ else
338
+ false
339
+ end
340
+ when :Object
341
+ # generic object (usually a Hash), return directly
342
+ value
343
+ when /\AArray<(?<inner_type>.+)>\z/
344
+ inner_type = Regexp.last_match[:inner_type]
345
+ value.map { |v| _deserialize(inner_type, v) }
346
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
347
+ k_type = Regexp.last_match[:k_type]
348
+ v_type = Regexp.last_match[:v_type]
349
+ {}.tap do |hash|
350
+ value.each do |k, v|
351
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
352
+ end
353
+ end
354
+ else # model
355
+ PulpRpmClient.const_get(type).build_from_hash(value)
356
+ end
357
+ end
358
+
359
+ # Returns the string representation of the object
360
+ # @return [String] String presentation of the object
361
+ def to_s
362
+ to_hash.to_s
363
+ end
364
+
365
+ # to_body is an alias to to_hash (backward compatibility)
366
+ # @return [Hash] Returns the object in the form of hash
367
+ def to_body
368
+ to_hash
369
+ end
370
+
371
+ # Returns the object in the form of hash
372
+ # @return [Hash] Returns the object in the form of hash
373
+ def to_hash
374
+ hash = {}
375
+ self.class.attribute_map.each_pair do |attr, param|
376
+ value = self.send(attr)
377
+ if value.nil?
378
+ is_nullable = self.class.openapi_nullable.include?(attr)
379
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
380
+ end
381
+
382
+ hash[param] = _to_hash(value)
383
+ end
384
+ hash
385
+ end
386
+
387
+ # Outputs non-array value in the form of hash
388
+ # For object, use to_hash. Otherwise, just return the value
389
+ # @param [Object] value Any valid value
390
+ # @return [Hash] Returns the value in the form of hash
391
+ def _to_hash(value)
392
+ if value.is_a?(Array)
393
+ value.compact.map { |v| _to_hash(v) }
394
+ elsif value.is_a?(Hash)
395
+ {}.tap do |hash|
396
+ value.each { |k, v| hash[k] = _to_hash(v) }
397
+ end
398
+ elsif value.respond_to? :to_hash
399
+ value.to_hash
400
+ else
401
+ value
402
+ end
403
+ end
404
+ end
405
+ end