pulp_deb_client 2.20.4 → 2.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -7
  3. data/docs/ContentInstallerPackagesApi.md +4 -4
  4. data/docs/ContentPackagesApi.md +9 -5
  5. data/docs/ContentReleaseArchitecturesApi.md +8 -4
  6. data/docs/ContentReleaseComponentsApi.md +11 -7
  7. data/docs/ContentReleasesApi.md +3 -3
  8. data/docs/{DebBasePackage.md → DebInstallerPackage.md} +2 -2
  9. data/docs/{DebBasePackageResponse.md → DebInstallerPackageResponse.md} +2 -2
  10. data/docs/DebPackage.md +29 -0
  11. data/docs/DebPackageResponse.md +97 -0
  12. data/docs/DebReleaseArchitecture.md +6 -2
  13. data/docs/DebReleaseArchitectureResponse.md +6 -2
  14. data/docs/DebReleaseComponent.md +6 -2
  15. data/docs/DebReleaseComponentResponse.md +6 -2
  16. data/docs/PaginateddebInstallerPackageResponseList.md +23 -0
  17. data/docs/{PaginateddebBasePackageResponseList.md → PaginateddebPackageResponseList.md} +3 -3
  18. data/docs/RepositoriesAptApi.md +4 -0
  19. data/lib/pulp_deb_client/api/content_installer_packages_api.rb +6 -6
  20. data/lib/pulp_deb_client/api/content_packages_api.rb +20 -6
  21. data/lib/pulp_deb_client/api/content_release_architectures_api.rb +12 -6
  22. data/lib/pulp_deb_client/api/content_release_components_api.rb +18 -12
  23. data/lib/pulp_deb_client/api/content_releases_api.rb +6 -6
  24. data/lib/pulp_deb_client/api/repositories_apt_api.rb +6 -0
  25. data/lib/pulp_deb_client/models/{deb_base_package.rb → deb_installer_package.rb} +3 -3
  26. data/lib/pulp_deb_client/models/{deb_base_package_response.rb → deb_installer_package_response.rb} +3 -3
  27. data/lib/pulp_deb_client/models/deb_package.rb +313 -0
  28. data/lib/pulp_deb_client/models/deb_package_response.rb +578 -0
  29. data/lib/pulp_deb_client/models/deb_release_architecture.rb +96 -11
  30. data/lib/pulp_deb_client/models/deb_release_architecture_response.rb +39 -11
  31. data/lib/pulp_deb_client/models/deb_release_component.rb +96 -11
  32. data/lib/pulp_deb_client/models/deb_release_component_response.rb +39 -11
  33. data/lib/pulp_deb_client/models/paginateddeb_installer_package_response_list.rb +237 -0
  34. data/lib/pulp_deb_client/models/{paginateddeb_base_package_response_list.rb → paginateddeb_package_response_list.rb} +4 -4
  35. data/lib/pulp_deb_client/version.rb +1 -1
  36. data/lib/pulp_deb_client.rb +6 -3
  37. data/spec/api/content_installer_packages_api_spec.rb +2 -2
  38. data/spec/api/content_packages_api_spec.rb +4 -2
  39. data/spec/api/content_release_architectures_api_spec.rb +4 -2
  40. data/spec/api/content_release_components_api_spec.rb +7 -5
  41. data/spec/api/content_releases_api_spec.rb +3 -3
  42. data/spec/api/repositories_apt_api_spec.rb +2 -0
  43. data/spec/models/{deb_base_package_response_spec.rb → deb_installer_package_response_spec.rb} +6 -6
  44. data/spec/models/{deb_base_package_spec.rb → deb_installer_package_spec.rb} +6 -6
  45. data/spec/models/deb_package_response_spec.rb +281 -0
  46. data/spec/models/deb_package_spec.rb +77 -0
  47. data/spec/models/deb_release_architecture_response_spec.rb +13 -1
  48. data/spec/models/deb_release_architecture_spec.rb +13 -1
  49. data/spec/models/deb_release_component_response_spec.rb +13 -1
  50. data/spec/models/deb_release_component_spec.rb +13 -1
  51. data/spec/models/paginateddeb_installer_package_response_list_spec.rb +59 -0
  52. data/spec/models/{paginateddeb_base_package_response_list_spec.rb → paginateddeb_package_response_list_spec.rb} +6 -6
  53. metadata +80 -68
@@ -0,0 +1,313 @@
1
+ =begin
2
+ #Pulp 3 API
3
+
4
+ #Fetch, Upload, Organize, and Distribute Software Packages
5
+
6
+ The version of the OpenAPI document: v3
7
+ Contact: pulp-list@redhat.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpDebClient
16
+ # A Serializer for Package.
17
+ class DebPackage
18
+ # Artifact file representing the physical content
19
+ attr_accessor :artifact
20
+
21
+ # Path where the artifact is located relative to distributions base_path
22
+ attr_accessor :relative_path
23
+
24
+ # An uploaded file that may be turned into the artifact of the content unit.
25
+ attr_accessor :file
26
+
27
+ # A URI of a repository the new content unit should be associated with.
28
+ attr_accessor :repository
29
+
30
+ # An uncommitted upload that may be turned into the artifact of the content unit.
31
+ attr_accessor :upload
32
+
33
+ # Name of the distribution.
34
+ attr_accessor :distribution
35
+
36
+ # Name of the component.
37
+ attr_accessor :component
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'artifact' => :'artifact',
43
+ :'relative_path' => :'relative_path',
44
+ :'file' => :'file',
45
+ :'repository' => :'repository',
46
+ :'upload' => :'upload',
47
+ :'distribution' => :'distribution',
48
+ :'component' => :'component'
49
+ }
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.openapi_types
54
+ {
55
+ :'artifact' => :'String',
56
+ :'relative_path' => :'String',
57
+ :'file' => :'File',
58
+ :'repository' => :'String',
59
+ :'upload' => :'String',
60
+ :'distribution' => :'String',
61
+ :'component' => :'String'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ ])
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpDebClient::DebPackage` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!self.class.attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpDebClient::DebPackage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'artifact')
87
+ self.artifact = attributes[:'artifact']
88
+ end
89
+
90
+ if attributes.key?(:'relative_path')
91
+ self.relative_path = attributes[:'relative_path']
92
+ end
93
+
94
+ if attributes.key?(:'file')
95
+ self.file = attributes[:'file']
96
+ end
97
+
98
+ if attributes.key?(:'repository')
99
+ self.repository = attributes[:'repository']
100
+ end
101
+
102
+ if attributes.key?(:'upload')
103
+ self.upload = attributes[:'upload']
104
+ end
105
+
106
+ if attributes.key?(:'distribution')
107
+ self.distribution = attributes[:'distribution']
108
+ end
109
+
110
+ if attributes.key?(:'component')
111
+ self.component = attributes[:'component']
112
+ end
113
+ end
114
+
115
+ # Show invalid properties with the reasons. Usually used together with valid?
116
+ # @return Array for valid properties with the reasons
117
+ def list_invalid_properties
118
+ invalid_properties = Array.new
119
+ if !@relative_path.nil? && @relative_path.to_s.length < 1
120
+ invalid_properties.push('invalid value for "relative_path", the character length must be great than or equal to 1.')
121
+ end
122
+
123
+ if !@distribution.nil? && @distribution.to_s.length < 1
124
+ invalid_properties.push('invalid value for "distribution", the character length must be great than or equal to 1.')
125
+ end
126
+
127
+ if !@component.nil? && @component.to_s.length < 1
128
+ invalid_properties.push('invalid value for "component", the character length must be great than or equal to 1.')
129
+ end
130
+
131
+ invalid_properties
132
+ end
133
+
134
+ # Check to see if the all the properties in the model are valid
135
+ # @return true if the model is valid
136
+ def valid?
137
+ return false if !@relative_path.nil? && @relative_path.to_s.length < 1
138
+ return false if !@distribution.nil? && @distribution.to_s.length < 1
139
+ return false if !@component.nil? && @component.to_s.length < 1
140
+ true
141
+ end
142
+
143
+ # Custom attribute writer method with validation
144
+ # @param [Object] relative_path Value to be assigned
145
+ def relative_path=(relative_path)
146
+ if !relative_path.nil? && relative_path.to_s.length < 1
147
+ fail ArgumentError, 'invalid value for "relative_path", the character length must be great than or equal to 1.'
148
+ end
149
+
150
+ @relative_path = relative_path
151
+ end
152
+
153
+ # Custom attribute writer method with validation
154
+ # @param [Object] distribution Value to be assigned
155
+ def distribution=(distribution)
156
+ if !distribution.nil? && distribution.to_s.length < 1
157
+ fail ArgumentError, 'invalid value for "distribution", the character length must be great than or equal to 1.'
158
+ end
159
+
160
+ @distribution = distribution
161
+ end
162
+
163
+ # Custom attribute writer method with validation
164
+ # @param [Object] component Value to be assigned
165
+ def component=(component)
166
+ if !component.nil? && component.to_s.length < 1
167
+ fail ArgumentError, 'invalid value for "component", the character length must be great than or equal to 1.'
168
+ end
169
+
170
+ @component = component
171
+ end
172
+
173
+ # Checks equality by comparing each attribute.
174
+ # @param [Object] Object to be compared
175
+ def ==(o)
176
+ return true if self.equal?(o)
177
+ self.class == o.class &&
178
+ artifact == o.artifact &&
179
+ relative_path == o.relative_path &&
180
+ file == o.file &&
181
+ repository == o.repository &&
182
+ upload == o.upload &&
183
+ distribution == o.distribution &&
184
+ component == o.component
185
+ end
186
+
187
+ # @see the `==` method
188
+ # @param [Object] Object to be compared
189
+ def eql?(o)
190
+ self == o
191
+ end
192
+
193
+ # Calculates hash code according to all attributes.
194
+ # @return [Integer] Hash code
195
+ def hash
196
+ [artifact, relative_path, file, repository, upload, distribution, component].hash
197
+ end
198
+
199
+ # Builds the object from hash
200
+ # @param [Hash] attributes Model attributes in the form of hash
201
+ # @return [Object] Returns the model itself
202
+ def self.build_from_hash(attributes)
203
+ new.build_from_hash(attributes)
204
+ end
205
+
206
+ # Builds the object from hash
207
+ # @param [Hash] attributes Model attributes in the form of hash
208
+ # @return [Object] Returns the model itself
209
+ def build_from_hash(attributes)
210
+ return nil unless attributes.is_a?(Hash)
211
+ self.class.openapi_types.each_pair do |key, type|
212
+ if type =~ /\AArray<(.*)>/i
213
+ # check to ensure the input is an array given that the attribute
214
+ # is documented as an array but the input is not
215
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
216
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
217
+ end
218
+ elsif !attributes[self.class.attribute_map[key]].nil?
219
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
220
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
221
+ end
222
+
223
+ self
224
+ end
225
+
226
+ # Deserializes the data based on type
227
+ # @param string type Data type
228
+ # @param string value Value to be deserialized
229
+ # @return [Object] Deserialized data
230
+ def _deserialize(type, value)
231
+ case type.to_sym
232
+ when :DateTime
233
+ DateTime.parse(value)
234
+ when :Date
235
+ Date.parse(value)
236
+ when :String
237
+ value.to_s
238
+ when :Integer
239
+ value.to_i
240
+ when :Float
241
+ value.to_f
242
+ when :Boolean
243
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
244
+ true
245
+ else
246
+ false
247
+ end
248
+ when :Object
249
+ # generic object (usually a Hash), return directly
250
+ value
251
+ when /\AArray<(?<inner_type>.+)>\z/
252
+ inner_type = Regexp.last_match[:inner_type]
253
+ value.map { |v| _deserialize(inner_type, v) }
254
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
255
+ k_type = Regexp.last_match[:k_type]
256
+ v_type = Regexp.last_match[:v_type]
257
+ {}.tap do |hash|
258
+ value.each do |k, v|
259
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
260
+ end
261
+ end
262
+ else # model
263
+ PulpDebClient.const_get(type).build_from_hash(value)
264
+ end
265
+ end
266
+
267
+ # Returns the string representation of the object
268
+ # @return [String] String presentation of the object
269
+ def to_s
270
+ to_hash.to_s
271
+ end
272
+
273
+ # to_body is an alias to to_hash (backward compatibility)
274
+ # @return [Hash] Returns the object in the form of hash
275
+ def to_body
276
+ to_hash
277
+ end
278
+
279
+ # Returns the object in the form of hash
280
+ # @return [Hash] Returns the object in the form of hash
281
+ def to_hash
282
+ hash = {}
283
+ self.class.attribute_map.each_pair do |attr, param|
284
+ value = self.send(attr)
285
+ if value.nil?
286
+ is_nullable = self.class.openapi_nullable.include?(attr)
287
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
288
+ end
289
+
290
+ hash[param] = _to_hash(value)
291
+ end
292
+ hash
293
+ end
294
+
295
+ # Outputs non-array value in the form of hash
296
+ # For object, use to_hash. Otherwise, just return the value
297
+ # @param [Object] value Any valid value
298
+ # @return [Hash] Returns the value in the form of hash
299
+ def _to_hash(value)
300
+ if value.is_a?(Array)
301
+ value.compact.map { |v| _to_hash(v) }
302
+ elsif value.is_a?(Hash)
303
+ {}.tap do |hash|
304
+ value.each { |k, v| hash[k] = _to_hash(v) }
305
+ end
306
+ elsif value.respond_to? :to_hash
307
+ value.to_hash
308
+ else
309
+ value
310
+ end
311
+ end
312
+ end
313
+ end