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
@@ -0,0 +1,435 @@
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 RpmPackageGroup
17
+ # PackageGroup id.
18
+ attr_accessor :id
19
+
20
+ # PackageGroup default.
21
+ attr_accessor :default
22
+
23
+ # PackageGroup user visibility.
24
+ attr_accessor :user_visible
25
+
26
+ # PackageGroup display order.
27
+ attr_accessor :display_order
28
+
29
+ # PackageGroup name.
30
+ attr_accessor :name
31
+
32
+ # PackageGroup description.
33
+ attr_accessor :description
34
+
35
+ # PackageGroup package list.
36
+ attr_accessor :packages
37
+
38
+ # PackageGroup biarch only.
39
+ attr_accessor :biarch_only
40
+
41
+ # PackageGroup description by language.
42
+ attr_accessor :desc_by_lang
43
+
44
+ # PackageGroup name by language.
45
+ attr_accessor :name_by_lang
46
+
47
+ # PackageGroup digest.
48
+ attr_accessor :digest
49
+
50
+ # Packages related to this PackageGroup.
51
+ attr_accessor :related_packages
52
+
53
+ # Attribute mapping from ruby-style variable name to JSON key.
54
+ def self.attribute_map
55
+ {
56
+ :'id' => :'id',
57
+ :'default' => :'default',
58
+ :'user_visible' => :'user_visible',
59
+ :'display_order' => :'display_order',
60
+ :'name' => :'name',
61
+ :'description' => :'description',
62
+ :'packages' => :'packages',
63
+ :'biarch_only' => :'biarch_only',
64
+ :'desc_by_lang' => :'desc_by_lang',
65
+ :'name_by_lang' => :'name_by_lang',
66
+ :'digest' => :'digest',
67
+ :'related_packages' => :'related_packages'
68
+ }
69
+ end
70
+
71
+ # Attribute type mapping.
72
+ def self.openapi_types
73
+ {
74
+ :'id' => :'String',
75
+ :'default' => :'Boolean',
76
+ :'user_visible' => :'Boolean',
77
+ :'display_order' => :'Integer',
78
+ :'name' => :'String',
79
+ :'description' => :'String',
80
+ :'packages' => :'Object',
81
+ :'biarch_only' => :'Boolean',
82
+ :'desc_by_lang' => :'Object',
83
+ :'name_by_lang' => :'Object',
84
+ :'digest' => :'String',
85
+ :'related_packages' => :'Array<String>'
86
+ }
87
+ end
88
+
89
+ # List of attributes with nullable: true
90
+ def self.openapi_nullable
91
+ Set.new([
92
+ ])
93
+ end
94
+
95
+ # Initializes the object
96
+ # @param [Hash] attributes Model attributes in the form of hash
97
+ def initialize(attributes = {})
98
+ if (!attributes.is_a?(Hash))
99
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpRpmClient::RpmPackageGroup` initialize method"
100
+ end
101
+
102
+ # check to see if the attribute exists and convert string to symbol for hash key
103
+ attributes = attributes.each_with_object({}) { |(k, v), h|
104
+ if (!self.class.attribute_map.key?(k.to_sym))
105
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpRpmClient::RpmPackageGroup`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
106
+ end
107
+ h[k.to_sym] = v
108
+ }
109
+
110
+ if attributes.key?(:'id')
111
+ self.id = attributes[:'id']
112
+ end
113
+
114
+ if attributes.key?(:'default')
115
+ self.default = attributes[:'default']
116
+ end
117
+
118
+ if attributes.key?(:'user_visible')
119
+ self.user_visible = attributes[:'user_visible']
120
+ end
121
+
122
+ if attributes.key?(:'display_order')
123
+ self.display_order = attributes[:'display_order']
124
+ end
125
+
126
+ if attributes.key?(:'name')
127
+ self.name = attributes[:'name']
128
+ end
129
+
130
+ if attributes.key?(:'description')
131
+ self.description = attributes[:'description']
132
+ end
133
+
134
+ if attributes.key?(:'packages')
135
+ self.packages = attributes[:'packages']
136
+ end
137
+
138
+ if attributes.key?(:'biarch_only')
139
+ self.biarch_only = attributes[:'biarch_only']
140
+ end
141
+
142
+ if attributes.key?(:'desc_by_lang')
143
+ self.desc_by_lang = attributes[:'desc_by_lang']
144
+ end
145
+
146
+ if attributes.key?(:'name_by_lang')
147
+ self.name_by_lang = attributes[:'name_by_lang']
148
+ end
149
+
150
+ if attributes.key?(:'digest')
151
+ self.digest = attributes[:'digest']
152
+ end
153
+
154
+ if attributes.key?(:'related_packages')
155
+ if (value = attributes[:'related_packages']).is_a?(Array)
156
+ self.related_packages = value
157
+ end
158
+ end
159
+ end
160
+
161
+ # Show invalid properties with the reasons. Usually used together with valid?
162
+ # @return Array for valid properties with the reasons
163
+ def list_invalid_properties
164
+ invalid_properties = Array.new
165
+ if @id.nil?
166
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
167
+ end
168
+
169
+ if @id.to_s.length < 1
170
+ invalid_properties.push('invalid value for "id", the character length must be great than or equal to 1.')
171
+ end
172
+
173
+ if @display_order.nil?
174
+ invalid_properties.push('invalid value for "display_order", display_order cannot be nil.')
175
+ end
176
+
177
+ if @name.nil?
178
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
179
+ end
180
+
181
+ if @name.to_s.length < 1
182
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
183
+ end
184
+
185
+ if @description.nil?
186
+ invalid_properties.push('invalid value for "description", description cannot be nil.')
187
+ end
188
+
189
+ if @description.to_s.length < 1
190
+ invalid_properties.push('invalid value for "description", the character length must be great than or equal to 1.')
191
+ end
192
+
193
+ if @packages.nil?
194
+ invalid_properties.push('invalid value for "packages", packages cannot be nil.')
195
+ end
196
+
197
+ if @desc_by_lang.nil?
198
+ invalid_properties.push('invalid value for "desc_by_lang", desc_by_lang cannot be nil.')
199
+ end
200
+
201
+ if @name_by_lang.nil?
202
+ invalid_properties.push('invalid value for "name_by_lang", name_by_lang cannot be nil.')
203
+ end
204
+
205
+ if @digest.nil?
206
+ invalid_properties.push('invalid value for "digest", digest cannot be nil.')
207
+ end
208
+
209
+ if @digest.to_s.length < 1
210
+ invalid_properties.push('invalid value for "digest", the character length must be great than or equal to 1.')
211
+ end
212
+
213
+ invalid_properties
214
+ end
215
+
216
+ # Check to see if the all the properties in the model are valid
217
+ # @return true if the model is valid
218
+ def valid?
219
+ return false if @id.nil?
220
+ return false if @id.to_s.length < 1
221
+ return false if @display_order.nil?
222
+ return false if @name.nil?
223
+ return false if @name.to_s.length < 1
224
+ return false if @description.nil?
225
+ return false if @description.to_s.length < 1
226
+ return false if @packages.nil?
227
+ return false if @desc_by_lang.nil?
228
+ return false if @name_by_lang.nil?
229
+ return false if @digest.nil?
230
+ return false if @digest.to_s.length < 1
231
+ true
232
+ end
233
+
234
+ # Custom attribute writer method with validation
235
+ # @param [Object] id Value to be assigned
236
+ def id=(id)
237
+ if id.nil?
238
+ fail ArgumentError, 'id cannot be nil'
239
+ end
240
+
241
+ if id.to_s.length < 1
242
+ fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 1.'
243
+ end
244
+
245
+ @id = id
246
+ end
247
+
248
+ # Custom attribute writer method with validation
249
+ # @param [Object] name Value to be assigned
250
+ def name=(name)
251
+ if name.nil?
252
+ fail ArgumentError, 'name cannot be nil'
253
+ end
254
+
255
+ if name.to_s.length < 1
256
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
257
+ end
258
+
259
+ @name = name
260
+ end
261
+
262
+ # Custom attribute writer method with validation
263
+ # @param [Object] description Value to be assigned
264
+ def description=(description)
265
+ if description.nil?
266
+ fail ArgumentError, 'description cannot be nil'
267
+ end
268
+
269
+ if description.to_s.length < 1
270
+ fail ArgumentError, 'invalid value for "description", the character length must be great than or equal to 1.'
271
+ end
272
+
273
+ @description = description
274
+ end
275
+
276
+ # Custom attribute writer method with validation
277
+ # @param [Object] digest Value to be assigned
278
+ def digest=(digest)
279
+ if digest.nil?
280
+ fail ArgumentError, 'digest cannot be nil'
281
+ end
282
+
283
+ if digest.to_s.length < 1
284
+ fail ArgumentError, 'invalid value for "digest", the character length must be great than or equal to 1.'
285
+ end
286
+
287
+ @digest = digest
288
+ end
289
+
290
+ # Checks equality by comparing each attribute.
291
+ # @param [Object] Object to be compared
292
+ def ==(o)
293
+ return true if self.equal?(o)
294
+ self.class == o.class &&
295
+ id == o.id &&
296
+ default == o.default &&
297
+ user_visible == o.user_visible &&
298
+ display_order == o.display_order &&
299
+ name == o.name &&
300
+ description == o.description &&
301
+ packages == o.packages &&
302
+ biarch_only == o.biarch_only &&
303
+ desc_by_lang == o.desc_by_lang &&
304
+ name_by_lang == o.name_by_lang &&
305
+ digest == o.digest &&
306
+ related_packages == o.related_packages
307
+ end
308
+
309
+ # @see the `==` method
310
+ # @param [Object] Object to be compared
311
+ def eql?(o)
312
+ self == o
313
+ end
314
+
315
+ # Calculates hash code according to all attributes.
316
+ # @return [Integer] Hash code
317
+ def hash
318
+ [id, default, user_visible, display_order, name, description, packages, biarch_only, desc_by_lang, name_by_lang, digest, related_packages].hash
319
+ end
320
+
321
+ # Builds the object from hash
322
+ # @param [Hash] attributes Model attributes in the form of hash
323
+ # @return [Object] Returns the model itself
324
+ def self.build_from_hash(attributes)
325
+ new.build_from_hash(attributes)
326
+ end
327
+
328
+ # Builds the object from hash
329
+ # @param [Hash] attributes Model attributes in the form of hash
330
+ # @return [Object] Returns the model itself
331
+ def build_from_hash(attributes)
332
+ return nil unless attributes.is_a?(Hash)
333
+ self.class.openapi_types.each_pair do |key, type|
334
+ if type =~ /\AArray<(.*)>/i
335
+ # check to ensure the input is an array given that the attribute
336
+ # is documented as an array but the input is not
337
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
338
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
339
+ end
340
+ elsif !attributes[self.class.attribute_map[key]].nil?
341
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
342
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
343
+ end
344
+
345
+ self
346
+ end
347
+
348
+ # Deserializes the data based on type
349
+ # @param string type Data type
350
+ # @param string value Value to be deserialized
351
+ # @return [Object] Deserialized data
352
+ def _deserialize(type, value)
353
+ case type.to_sym
354
+ when :DateTime
355
+ DateTime.parse(value)
356
+ when :Date
357
+ Date.parse(value)
358
+ when :String
359
+ value.to_s
360
+ when :Integer
361
+ value.to_i
362
+ when :Float
363
+ value.to_f
364
+ when :Boolean
365
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
366
+ true
367
+ else
368
+ false
369
+ end
370
+ when :Object
371
+ # generic object (usually a Hash), return directly
372
+ value
373
+ when /\AArray<(?<inner_type>.+)>\z/
374
+ inner_type = Regexp.last_match[:inner_type]
375
+ value.map { |v| _deserialize(inner_type, v) }
376
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
377
+ k_type = Regexp.last_match[:k_type]
378
+ v_type = Regexp.last_match[:v_type]
379
+ {}.tap do |hash|
380
+ value.each do |k, v|
381
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
382
+ end
383
+ end
384
+ else # model
385
+ PulpRpmClient.const_get(type).build_from_hash(value)
386
+ end
387
+ end
388
+
389
+ # Returns the string representation of the object
390
+ # @return [String] String presentation of the object
391
+ def to_s
392
+ to_hash.to_s
393
+ end
394
+
395
+ # to_body is an alias to to_hash (backward compatibility)
396
+ # @return [Hash] Returns the object in the form of hash
397
+ def to_body
398
+ to_hash
399
+ end
400
+
401
+ # Returns the object in the form of hash
402
+ # @return [Hash] Returns the object in the form of hash
403
+ def to_hash
404
+ hash = {}
405
+ self.class.attribute_map.each_pair do |attr, param|
406
+ value = self.send(attr)
407
+ if value.nil?
408
+ is_nullable = self.class.openapi_nullable.include?(attr)
409
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
410
+ end
411
+
412
+ hash[param] = _to_hash(value)
413
+ end
414
+ hash
415
+ end
416
+
417
+ # Outputs non-array value in the form of hash
418
+ # For object, use to_hash. Otherwise, just return the value
419
+ # @param [Object] value Any valid value
420
+ # @return [Hash] Returns the value in the form of hash
421
+ def _to_hash(value)
422
+ if value.is_a?(Array)
423
+ value.compact.map { |v| _to_hash(v) }
424
+ elsif value.is_a?(Hash)
425
+ {}.tap do |hash|
426
+ value.each { |k, v| hash[k] = _to_hash(v) }
427
+ end
428
+ elsif value.respond_to? :to_hash
429
+ value.to_hash
430
+ else
431
+ value
432
+ end
433
+ end
434
+ end
435
+ end
@@ -0,0 +1,246 @@
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 RpmPackageLangpacks
17
+ # Langpacks matches.
18
+ attr_accessor :matches
19
+
20
+ # Langpacks digest.
21
+ attr_accessor :digest
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'matches' => :'matches',
27
+ :'digest' => :'digest'
28
+ }
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.openapi_types
33
+ {
34
+ :'matches' => :'Object',
35
+ :'digest' => :'String'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpRpmClient::RpmPackageLangpacks` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpRpmClient::RpmPackageLangpacks`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'matches')
61
+ self.matches = attributes[:'matches']
62
+ end
63
+
64
+ if attributes.key?(:'digest')
65
+ self.digest = attributes[:'digest']
66
+ end
67
+ end
68
+
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properties with the reasons
71
+ def list_invalid_properties
72
+ invalid_properties = Array.new
73
+ if @matches.nil?
74
+ invalid_properties.push('invalid value for "matches", matches cannot be nil.')
75
+ end
76
+
77
+ if @digest.nil?
78
+ invalid_properties.push('invalid value for "digest", digest cannot be nil.')
79
+ end
80
+
81
+ if @digest.to_s.length < 1
82
+ invalid_properties.push('invalid value for "digest", the character length must be great than or equal to 1.')
83
+ end
84
+
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ return false if @matches.nil?
92
+ return false if @digest.nil?
93
+ return false if @digest.to_s.length < 1
94
+ true
95
+ end
96
+
97
+ # Custom attribute writer method with validation
98
+ # @param [Object] digest Value to be assigned
99
+ def digest=(digest)
100
+ if digest.nil?
101
+ fail ArgumentError, 'digest cannot be nil'
102
+ end
103
+
104
+ if digest.to_s.length < 1
105
+ fail ArgumentError, 'invalid value for "digest", the character length must be great than or equal to 1.'
106
+ end
107
+
108
+ @digest = digest
109
+ end
110
+
111
+ # Checks equality by comparing each attribute.
112
+ # @param [Object] Object to be compared
113
+ def ==(o)
114
+ return true if self.equal?(o)
115
+ self.class == o.class &&
116
+ matches == o.matches &&
117
+ digest == o.digest
118
+ end
119
+
120
+ # @see the `==` method
121
+ # @param [Object] Object to be compared
122
+ def eql?(o)
123
+ self == o
124
+ end
125
+
126
+ # Calculates hash code according to all attributes.
127
+ # @return [Integer] Hash code
128
+ def hash
129
+ [matches, digest].hash
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def self.build_from_hash(attributes)
136
+ new.build_from_hash(attributes)
137
+ end
138
+
139
+ # Builds the object from hash
140
+ # @param [Hash] attributes Model attributes in the form of hash
141
+ # @return [Object] Returns the model itself
142
+ def build_from_hash(attributes)
143
+ return nil unless attributes.is_a?(Hash)
144
+ self.class.openapi_types.each_pair do |key, type|
145
+ if type =~ /\AArray<(.*)>/i
146
+ # check to ensure the input is an array given that the attribute
147
+ # is documented as an array but the input is not
148
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
149
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
150
+ end
151
+ elsif !attributes[self.class.attribute_map[key]].nil?
152
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
153
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
154
+ end
155
+
156
+ self
157
+ end
158
+
159
+ # Deserializes the data based on type
160
+ # @param string type Data type
161
+ # @param string value Value to be deserialized
162
+ # @return [Object] Deserialized data
163
+ def _deserialize(type, value)
164
+ case type.to_sym
165
+ when :DateTime
166
+ DateTime.parse(value)
167
+ when :Date
168
+ Date.parse(value)
169
+ when :String
170
+ value.to_s
171
+ when :Integer
172
+ value.to_i
173
+ when :Float
174
+ value.to_f
175
+ when :Boolean
176
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
177
+ true
178
+ else
179
+ false
180
+ end
181
+ when :Object
182
+ # generic object (usually a Hash), return directly
183
+ value
184
+ when /\AArray<(?<inner_type>.+)>\z/
185
+ inner_type = Regexp.last_match[:inner_type]
186
+ value.map { |v| _deserialize(inner_type, v) }
187
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
188
+ k_type = Regexp.last_match[:k_type]
189
+ v_type = Regexp.last_match[:v_type]
190
+ {}.tap do |hash|
191
+ value.each do |k, v|
192
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
193
+ end
194
+ end
195
+ else # model
196
+ PulpRpmClient.const_get(type).build_from_hash(value)
197
+ end
198
+ end
199
+
200
+ # Returns the string representation of the object
201
+ # @return [String] String presentation of the object
202
+ def to_s
203
+ to_hash.to_s
204
+ end
205
+
206
+ # to_body is an alias to to_hash (backward compatibility)
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_body
209
+ to_hash
210
+ end
211
+
212
+ # Returns the object in the form of hash
213
+ # @return [Hash] Returns the object in the form of hash
214
+ def to_hash
215
+ hash = {}
216
+ self.class.attribute_map.each_pair do |attr, param|
217
+ value = self.send(attr)
218
+ if value.nil?
219
+ is_nullable = self.class.openapi_nullable.include?(attr)
220
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
221
+ end
222
+
223
+ hash[param] = _to_hash(value)
224
+ end
225
+ hash
226
+ end
227
+
228
+ # Outputs non-array value in the form of hash
229
+ # For object, use to_hash. Otherwise, just return the value
230
+ # @param [Object] value Any valid value
231
+ # @return [Hash] Returns the value in the form of hash
232
+ def _to_hash(value)
233
+ if value.is_a?(Array)
234
+ value.compact.map { |v| _to_hash(v) }
235
+ elsif value.is_a?(Hash)
236
+ {}.tap do |hash|
237
+ value.each { |k, v| hash[k] = _to_hash(v) }
238
+ end
239
+ elsif value.respond_to? :to_hash
240
+ value.to_hash
241
+ else
242
+ value
243
+ end
244
+ end
245
+ end
246
+ end