pulp_deb_client 3.0.2 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +24 -6
  3. data/docs/ContentGenericContentsApi.md +4 -4
  4. data/docs/ContentInstallerPackagesApi.md +4 -4
  5. data/docs/ContentPackagesApi.md +20 -4
  6. data/docs/ContentSourceIndicesApi.md +204 -0
  7. data/docs/ContentSourcePackagesApi.md +258 -0
  8. data/docs/ContentSourceReleaseComponentsApi.md +202 -0
  9. data/docs/DebGenericContent.md +2 -2
  10. data/docs/DebInstallerPackage.md +2 -2
  11. data/docs/DebPackage.md +2 -2
  12. data/docs/DebSourceIndex.md +25 -0
  13. data/docs/DebSourceIndexResponse.md +27 -0
  14. data/docs/DebSourcePackage.md +21 -0
  15. data/docs/DebSourcePackageReleaseComponent.md +21 -0
  16. data/docs/DebSourcePackageReleaseComponentResponse.md +23 -0
  17. data/docs/DebSourcePackageResponse.md +77 -0
  18. data/docs/PaginateddebSourceIndexResponseList.md +23 -0
  19. data/docs/PaginateddebSourcePackageReleaseComponentResponseList.md +23 -0
  20. data/docs/PaginateddebSourcePackageResponseList.md +23 -0
  21. data/lib/pulp_deb_client/api/content_generic_contents_api.rb +4 -4
  22. data/lib/pulp_deb_client/api/content_installer_packages_api.rb +4 -4
  23. data/lib/pulp_deb_client/api/content_packages_api.rb +28 -4
  24. data/lib/pulp_deb_client/api/content_source_indices_api.rb +256 -0
  25. data/lib/pulp_deb_client/api/content_source_packages_api.rb +337 -0
  26. data/lib/pulp_deb_client/api/content_source_release_components_api.rb +253 -0
  27. data/lib/pulp_deb_client/models/deb_generic_content.rb +2 -2
  28. data/lib/pulp_deb_client/models/deb_installer_package.rb +2 -2
  29. data/lib/pulp_deb_client/models/deb_package.rb +2 -2
  30. data/lib/pulp_deb_client/models/deb_source_index.rb +297 -0
  31. data/lib/pulp_deb_client/models/deb_source_index_response.rb +272 -0
  32. data/lib/pulp_deb_client/models/deb_source_package.rb +248 -0
  33. data/lib/pulp_deb_client/models/deb_source_package_release_component.rb +238 -0
  34. data/lib/pulp_deb_client/models/deb_source_package_release_component_response.rb +247 -0
  35. data/lib/pulp_deb_client/models/deb_source_package_response.rb +485 -0
  36. data/lib/pulp_deb_client/models/paginateddeb_source_index_response_list.rb +237 -0
  37. data/lib/pulp_deb_client/models/paginateddeb_source_package_release_component_response_list.rb +237 -0
  38. data/lib/pulp_deb_client/models/paginateddeb_source_package_response_list.rb +237 -0
  39. data/lib/pulp_deb_client/version.rb +1 -1
  40. data/lib/pulp_deb_client.rb +12 -0
  41. data/spec/api/content_generic_contents_api_spec.rb +2 -2
  42. data/spec/api/content_installer_packages_api_spec.rb +2 -2
  43. data/spec/api/content_packages_api_spec.rb +10 -2
  44. data/spec/api/content_source_indices_api_spec.rb +86 -0
  45. data/spec/api/content_source_packages_api_spec.rb +113 -0
  46. data/spec/api/content_source_release_components_api_spec.rb +85 -0
  47. data/spec/models/deb_source_index_response_spec.rb +71 -0
  48. data/spec/models/deb_source_index_spec.rb +65 -0
  49. data/spec/models/deb_source_package_release_component_response_spec.rb +59 -0
  50. data/spec/models/deb_source_package_release_component_spec.rb +53 -0
  51. data/spec/models/deb_source_package_response_spec.rb +221 -0
  52. data/spec/models/deb_source_package_spec.rb +53 -0
  53. data/spec/models/paginateddeb_source_index_response_list_spec.rb +59 -0
  54. data/spec/models/paginateddeb_source_package_release_component_response_list_spec.rb +59 -0
  55. data/spec/models/paginateddeb_source_package_response_list_spec.rb +59 -0
  56. metadata +110 -62
@@ -0,0 +1,247 @@
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 SourcePackageReleaseComponent.
17
+ class DebSourcePackageReleaseComponentResponse
18
+ attr_accessor :pulp_href
19
+
20
+ # Timestamp of creation.
21
+ attr_accessor :pulp_created
22
+
23
+ # Source package that is contained in release_component.
24
+ attr_accessor :source_package
25
+
26
+ # ReleaseComponent this source package is contained in.
27
+ attr_accessor :release_component
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'pulp_href' => :'pulp_href',
33
+ :'pulp_created' => :'pulp_created',
34
+ :'source_package' => :'source_package',
35
+ :'release_component' => :'release_component'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.openapi_types
41
+ {
42
+ :'pulp_href' => :'String',
43
+ :'pulp_created' => :'DateTime',
44
+ :'source_package' => :'String',
45
+ :'release_component' => :'String'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpDebClient::DebSourcePackageReleaseComponentResponse` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!self.class.attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpDebClient::DebSourcePackageReleaseComponentResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'pulp_href')
71
+ self.pulp_href = attributes[:'pulp_href']
72
+ end
73
+
74
+ if attributes.key?(:'pulp_created')
75
+ self.pulp_created = attributes[:'pulp_created']
76
+ end
77
+
78
+ if attributes.key?(:'source_package')
79
+ self.source_package = attributes[:'source_package']
80
+ end
81
+
82
+ if attributes.key?(:'release_component')
83
+ self.release_component = attributes[:'release_component']
84
+ end
85
+ end
86
+
87
+ # Show invalid properties with the reasons. Usually used together with valid?
88
+ # @return Array for valid properties with the reasons
89
+ def list_invalid_properties
90
+ invalid_properties = Array.new
91
+ if @source_package.nil?
92
+ invalid_properties.push('invalid value for "source_package", source_package cannot be nil.')
93
+ end
94
+
95
+ if @release_component.nil?
96
+ invalid_properties.push('invalid value for "release_component", release_component cannot be nil.')
97
+ end
98
+
99
+ invalid_properties
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
105
+ return false if @source_package.nil?
106
+ return false if @release_component.nil?
107
+ true
108
+ end
109
+
110
+ # Checks equality by comparing each attribute.
111
+ # @param [Object] Object to be compared
112
+ def ==(o)
113
+ return true if self.equal?(o)
114
+ self.class == o.class &&
115
+ pulp_href == o.pulp_href &&
116
+ pulp_created == o.pulp_created &&
117
+ source_package == o.source_package &&
118
+ release_component == o.release_component
119
+ end
120
+
121
+ # @see the `==` method
122
+ # @param [Object] Object to be compared
123
+ def eql?(o)
124
+ self == o
125
+ end
126
+
127
+ # Calculates hash code according to all attributes.
128
+ # @return [Integer] Hash code
129
+ def hash
130
+ [pulp_href, pulp_created, source_package, release_component].hash
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def self.build_from_hash(attributes)
137
+ new.build_from_hash(attributes)
138
+ end
139
+
140
+ # Builds the object from hash
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ # @return [Object] Returns the model itself
143
+ def build_from_hash(attributes)
144
+ return nil unless attributes.is_a?(Hash)
145
+ self.class.openapi_types.each_pair do |key, type|
146
+ if type =~ /\AArray<(.*)>/i
147
+ # check to ensure the input is an array given that the attribute
148
+ # is documented as an array but the input is not
149
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
150
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
151
+ end
152
+ elsif !attributes[self.class.attribute_map[key]].nil?
153
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
154
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
155
+ end
156
+
157
+ self
158
+ end
159
+
160
+ # Deserializes the data based on type
161
+ # @param string type Data type
162
+ # @param string value Value to be deserialized
163
+ # @return [Object] Deserialized data
164
+ def _deserialize(type, value)
165
+ case type.to_sym
166
+ when :DateTime
167
+ DateTime.parse(value)
168
+ when :Date
169
+ Date.parse(value)
170
+ when :String
171
+ value.to_s
172
+ when :Integer
173
+ value.to_i
174
+ when :Float
175
+ value.to_f
176
+ when :Boolean
177
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
178
+ true
179
+ else
180
+ false
181
+ end
182
+ when :Object
183
+ # generic object (usually a Hash), return directly
184
+ value
185
+ when /\AArray<(?<inner_type>.+)>\z/
186
+ inner_type = Regexp.last_match[:inner_type]
187
+ value.map { |v| _deserialize(inner_type, v) }
188
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
189
+ k_type = Regexp.last_match[:k_type]
190
+ v_type = Regexp.last_match[:v_type]
191
+ {}.tap do |hash|
192
+ value.each do |k, v|
193
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
194
+ end
195
+ end
196
+ else # model
197
+ PulpDebClient.const_get(type).build_from_hash(value)
198
+ end
199
+ end
200
+
201
+ # Returns the string representation of the object
202
+ # @return [String] String presentation of the object
203
+ def to_s
204
+ to_hash.to_s
205
+ end
206
+
207
+ # to_body is an alias to to_hash (backward compatibility)
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_body
210
+ to_hash
211
+ end
212
+
213
+ # Returns the object in the form of hash
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_hash
216
+ hash = {}
217
+ self.class.attribute_map.each_pair do |attr, param|
218
+ value = self.send(attr)
219
+ if value.nil?
220
+ is_nullable = self.class.openapi_nullable.include?(attr)
221
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
222
+ end
223
+
224
+ hash[param] = _to_hash(value)
225
+ end
226
+ hash
227
+ end
228
+
229
+ # Outputs non-array value in the form of hash
230
+ # For object, use to_hash. Otherwise, just return the value
231
+ # @param [Object] value Any valid value
232
+ # @return [Hash] Returns the value in the form of hash
233
+ def _to_hash(value)
234
+ if value.is_a?(Array)
235
+ value.compact.map { |v| _to_hash(v) }
236
+ elsif value.is_a?(Hash)
237
+ {}.tap do |hash|
238
+ value.each { |k, v| hash[k] = _to_hash(v) }
239
+ end
240
+ elsif value.respond_to? :to_hash
241
+ value.to_hash
242
+ else
243
+ value
244
+ end
245
+ end
246
+ end
247
+ end