pulp_deb_client 2.21.2 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +35 -7
  3. data/docs/ContentGenericContentsApi.md +7 -5
  4. data/docs/ContentInstallerFileIndicesApi.md +3 -1
  5. data/docs/ContentInstallerPackagesApi.md +7 -5
  6. data/docs/ContentPackageIndicesApi.md +3 -1
  7. data/docs/ContentPackageReleaseComponentsApi.md +3 -1
  8. data/docs/ContentPackagesApi.md +27 -5
  9. data/docs/ContentReleaseArchitecturesApi.md +5 -7
  10. data/docs/ContentReleaseComponentsApi.md +7 -7
  11. data/docs/ContentReleaseFilesApi.md +3 -1
  12. data/docs/ContentReleasesApi.md +13 -3
  13. data/docs/ContentSourceIndicesApi.md +204 -0
  14. data/docs/ContentSourcePackagesApi.md +258 -0
  15. data/docs/ContentSourceReleaseComponentsApi.md +202 -0
  16. data/docs/DebAptPublication.md +4 -2
  17. data/docs/DebAptPublicationResponse.md +4 -2
  18. data/docs/DebAptRepository.md +7 -1
  19. data/docs/DebAptRepositoryResponse.md +7 -1
  20. data/docs/DebCopyApi.md +1 -1
  21. data/docs/DebGenericContent.md +2 -2
  22. data/docs/DebInstallerPackage.md +2 -2
  23. data/docs/DebPackage.md +2 -2
  24. data/docs/DebRelease.md +9 -1
  25. data/docs/DebReleaseArchitecture.md +1 -5
  26. data/docs/DebReleaseArchitectureResponse.md +1 -5
  27. data/docs/DebReleaseComponent.md +1 -5
  28. data/docs/DebReleaseComponentResponse.md +1 -5
  29. data/docs/DebReleaseFile.md +3 -3
  30. data/docs/DebReleaseFileResponse.md +3 -3
  31. data/docs/DebReleaseResponse.md +9 -1
  32. data/docs/DebSourceIndex.md +25 -0
  33. data/docs/DebSourceIndexResponse.md +27 -0
  34. data/docs/DebSourcePackage.md +21 -0
  35. data/docs/DebSourcePackageReleaseComponent.md +21 -0
  36. data/docs/DebSourcePackageReleaseComponentResponse.md +23 -0
  37. data/docs/DebSourcePackageResponse.md +77 -0
  38. data/docs/DistributionsAptApi.md +123 -1
  39. data/docs/PaginateddebSourceIndexResponseList.md +23 -0
  40. data/docs/PaginateddebSourcePackageReleaseComponentResponseList.md +23 -0
  41. data/docs/PaginateddebSourcePackageResponseList.md +23 -0
  42. data/docs/PatcheddebAptRepository.md +7 -1
  43. data/docs/PublicationsAptApi.md +3 -1
  44. data/docs/PublicationsVerbatimApi.md +3 -1
  45. data/docs/RemotesAptApi.md +123 -1
  46. data/docs/RepositoriesAptApi.md +123 -1
  47. data/docs/RepositoriesAptVersionsApi.md +3 -1
  48. data/docs/SetLabel.md +19 -0
  49. data/docs/SetLabelResponse.md +19 -0
  50. data/docs/UnsetLabel.md +17 -0
  51. data/docs/UnsetLabelResponse.md +19 -0
  52. data/lib/pulp_deb_client/api/content_generic_contents_api.rb +7 -4
  53. data/lib/pulp_deb_client/api/content_installer_file_indices_api.rb +3 -0
  54. data/lib/pulp_deb_client/api/content_installer_packages_api.rb +7 -4
  55. data/lib/pulp_deb_client/api/content_package_indices_api.rb +3 -0
  56. data/lib/pulp_deb_client/api/content_package_release_components_api.rb +3 -0
  57. data/lib/pulp_deb_client/api/content_packages_api.rb +37 -4
  58. data/lib/pulp_deb_client/api/content_release_architectures_api.rb +6 -9
  59. data/lib/pulp_deb_client/api/content_release_components_api.rb +9 -9
  60. data/lib/pulp_deb_client/api/content_release_files_api.rb +3 -0
  61. data/lib/pulp_deb_client/api/content_releases_api.rb +18 -3
  62. data/lib/pulp_deb_client/api/content_source_indices_api.rb +256 -0
  63. data/lib/pulp_deb_client/api/content_source_packages_api.rb +337 -0
  64. data/lib/pulp_deb_client/api/content_source_release_components_api.rb +253 -0
  65. data/lib/pulp_deb_client/api/distributions_apt_api.rb +155 -0
  66. data/lib/pulp_deb_client/api/publications_apt_api.rb +3 -0
  67. data/lib/pulp_deb_client/api/publications_verbatim_api.rb +3 -0
  68. data/lib/pulp_deb_client/api/remotes_apt_api.rb +155 -0
  69. data/lib/pulp_deb_client/api/repositories_apt_api.rb +155 -0
  70. data/lib/pulp_deb_client/api/repositories_apt_versions_api.rb +3 -0
  71. data/lib/pulp_deb_client/configuration.rb +2 -2
  72. data/lib/pulp_deb_client/models/deb_apt_publication.rb +14 -5
  73. data/lib/pulp_deb_client/models/deb_apt_publication_response.rb +14 -5
  74. data/lib/pulp_deb_client/models/deb_apt_repository.rb +38 -5
  75. data/lib/pulp_deb_client/models/deb_apt_repository_response.rb +38 -5
  76. data/lib/pulp_deb_client/models/deb_generic_content.rb +2 -2
  77. data/lib/pulp_deb_client/models/deb_installer_package.rb +2 -2
  78. data/lib/pulp_deb_client/models/deb_package.rb +2 -2
  79. data/lib/pulp_deb_client/models/deb_release.rb +104 -4
  80. data/lib/pulp_deb_client/models/deb_release_architecture.rb +4 -70
  81. data/lib/pulp_deb_client/models/deb_release_architecture_response.rb +4 -32
  82. data/lib/pulp_deb_client/models/deb_release_component.rb +4 -70
  83. data/lib/pulp_deb_client/models/deb_release_component_response.rb +4 -32
  84. data/lib/pulp_deb_client/models/deb_release_file.rb +3 -3
  85. data/lib/pulp_deb_client/models/deb_release_file_response.rb +3 -3
  86. data/lib/pulp_deb_client/models/deb_release_response.rb +44 -4
  87. data/lib/pulp_deb_client/models/deb_source_index.rb +297 -0
  88. data/lib/pulp_deb_client/models/deb_source_index_response.rb +272 -0
  89. data/lib/pulp_deb_client/models/deb_source_package.rb +248 -0
  90. data/lib/pulp_deb_client/models/deb_source_package_release_component.rb +238 -0
  91. data/lib/pulp_deb_client/models/deb_source_package_release_component_response.rb +247 -0
  92. data/lib/pulp_deb_client/models/deb_source_package_response.rb +485 -0
  93. data/lib/pulp_deb_client/models/paginateddeb_source_index_response_list.rb +237 -0
  94. data/lib/pulp_deb_client/models/paginateddeb_source_package_release_component_response_list.rb +237 -0
  95. data/lib/pulp_deb_client/models/paginateddeb_source_package_response_list.rb +237 -0
  96. data/lib/pulp_deb_client/models/patcheddeb_apt_repository.rb +38 -5
  97. data/lib/pulp_deb_client/models/set_label.rb +252 -0
  98. data/lib/pulp_deb_client/models/set_label_response.rb +243 -0
  99. data/lib/pulp_deb_client/models/unset_label.rb +242 -0
  100. data/lib/pulp_deb_client/models/unset_label_response.rb +242 -0
  101. data/lib/pulp_deb_client/version.rb +1 -1
  102. data/lib/pulp_deb_client.rb +16 -0
  103. data/spec/api/content_generic_contents_api_spec.rb +3 -2
  104. data/spec/api/content_installer_file_indices_api_spec.rb +1 -0
  105. data/spec/api/content_installer_packages_api_spec.rb +3 -2
  106. data/spec/api/content_package_indices_api_spec.rb +1 -0
  107. data/spec/api/content_package_release_components_api_spec.rb +1 -0
  108. data/spec/api/content_packages_api_spec.rb +13 -2
  109. data/spec/api/content_release_architectures_api_spec.rb +2 -3
  110. data/spec/api/content_release_components_api_spec.rb +3 -3
  111. data/spec/api/content_release_files_api_spec.rb +1 -0
  112. data/spec/api/content_releases_api_spec.rb +6 -1
  113. data/spec/api/content_source_indices_api_spec.rb +86 -0
  114. data/spec/api/content_source_packages_api_spec.rb +113 -0
  115. data/spec/api/content_source_release_components_api_spec.rb +85 -0
  116. data/spec/api/distributions_apt_api_spec.rb +31 -0
  117. data/spec/api/publications_apt_api_spec.rb +1 -0
  118. data/spec/api/publications_verbatim_api_spec.rb +1 -0
  119. data/spec/api/remotes_apt_api_spec.rb +31 -0
  120. data/spec/api/repositories_apt_api_spec.rb +31 -0
  121. data/spec/api/repositories_apt_versions_api_spec.rb +1 -0
  122. data/spec/configuration_spec.rb +3 -3
  123. data/spec/models/deb_apt_publication_response_spec.rb +6 -0
  124. data/spec/models/deb_apt_publication_spec.rb +6 -0
  125. data/spec/models/deb_apt_repository_response_spec.rb +18 -0
  126. data/spec/models/deb_apt_repository_spec.rb +18 -0
  127. data/spec/models/deb_release_architecture_response_spec.rb +0 -12
  128. data/spec/models/deb_release_architecture_spec.rb +0 -12
  129. data/spec/models/deb_release_component_response_spec.rb +0 -12
  130. data/spec/models/deb_release_component_spec.rb +0 -12
  131. data/spec/models/deb_release_response_spec.rb +24 -0
  132. data/spec/models/deb_release_spec.rb +24 -0
  133. data/spec/models/deb_source_index_response_spec.rb +71 -0
  134. data/spec/models/deb_source_index_spec.rb +65 -0
  135. data/spec/models/deb_source_package_release_component_response_spec.rb +59 -0
  136. data/spec/models/deb_source_package_release_component_spec.rb +53 -0
  137. data/spec/models/deb_source_package_response_spec.rb +221 -0
  138. data/spec/models/deb_source_package_spec.rb +53 -0
  139. data/spec/models/paginateddeb_source_index_response_list_spec.rb +59 -0
  140. data/spec/models/paginateddeb_source_package_release_component_response_list_spec.rb +59 -0
  141. data/spec/models/paginateddeb_source_package_response_list_spec.rb +59 -0
  142. data/spec/models/patcheddeb_apt_repository_spec.rb +18 -0
  143. data/spec/models/set_label_response_spec.rb +47 -0
  144. data/spec/models/set_label_spec.rb +47 -0
  145. data/spec/models/unset_label_response_spec.rb +47 -0
  146. data/spec/models/unset_label_spec.rb +41 -0
  147. metadata +122 -58
@@ -26,6 +26,14 @@ module PulpDebClient
26
26
 
27
27
  attr_accessor :distribution
28
28
 
29
+ attr_accessor :version
30
+
31
+ attr_accessor :origin
32
+
33
+ attr_accessor :label
34
+
35
+ attr_accessor :description
36
+
29
37
  # Attribute mapping from ruby-style variable name to JSON key.
30
38
  def self.attribute_map
31
39
  {
@@ -33,7 +41,11 @@ module PulpDebClient
33
41
  :'pulp_created' => :'pulp_created',
34
42
  :'codename' => :'codename',
35
43
  :'suite' => :'suite',
36
- :'distribution' => :'distribution'
44
+ :'distribution' => :'distribution',
45
+ :'version' => :'version',
46
+ :'origin' => :'origin',
47
+ :'label' => :'label',
48
+ :'description' => :'description'
37
49
  }
38
50
  end
39
51
 
@@ -44,13 +56,21 @@ module PulpDebClient
44
56
  :'pulp_created' => :'DateTime',
45
57
  :'codename' => :'String',
46
58
  :'suite' => :'String',
47
- :'distribution' => :'String'
59
+ :'distribution' => :'String',
60
+ :'version' => :'String',
61
+ :'origin' => :'String',
62
+ :'label' => :'String',
63
+ :'description' => :'String'
48
64
  }
49
65
  end
50
66
 
51
67
  # List of attributes with nullable: true
52
68
  def self.openapi_nullable
53
69
  Set.new([
70
+ :'version',
71
+ :'origin',
72
+ :'label',
73
+ :'description'
54
74
  ])
55
75
  end
56
76
 
@@ -88,6 +108,22 @@ module PulpDebClient
88
108
  if attributes.key?(:'distribution')
89
109
  self.distribution = attributes[:'distribution']
90
110
  end
111
+
112
+ if attributes.key?(:'version')
113
+ self.version = attributes[:'version']
114
+ end
115
+
116
+ if attributes.key?(:'origin')
117
+ self.origin = attributes[:'origin']
118
+ end
119
+
120
+ if attributes.key?(:'label')
121
+ self.label = attributes[:'label']
122
+ end
123
+
124
+ if attributes.key?(:'description')
125
+ self.description = attributes[:'description']
126
+ end
91
127
  end
92
128
 
93
129
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -127,7 +163,11 @@ module PulpDebClient
127
163
  pulp_created == o.pulp_created &&
128
164
  codename == o.codename &&
129
165
  suite == o.suite &&
130
- distribution == o.distribution
166
+ distribution == o.distribution &&
167
+ version == o.version &&
168
+ origin == o.origin &&
169
+ label == o.label &&
170
+ description == o.description
131
171
  end
132
172
 
133
173
  # @see the `==` method
@@ -139,7 +179,7 @@ module PulpDebClient
139
179
  # Calculates hash code according to all attributes.
140
180
  # @return [Integer] Hash code
141
181
  def hash
142
- [pulp_href, pulp_created, codename, suite, distribution].hash
182
+ [pulp_href, pulp_created, codename, suite, distribution, version, origin, label, description].hash
143
183
  end
144
184
 
145
185
  # Builds the object from hash
@@ -0,0 +1,297 @@
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 SourceIndex.
17
+ class DebSourceIndex
18
+ # A URI of a repository the new content unit should be associated with.
19
+ attr_accessor :repository
20
+
21
+ # A dict mapping relative paths inside the Content to the correspondingArtifact URLs. E.g.: {'relative/path': '/artifacts/1/'
22
+ attr_accessor :artifacts
23
+
24
+ # Release this index file belongs to.
25
+ attr_accessor :release
26
+
27
+ # Component this index file belongs to.
28
+ attr_accessor :component
29
+
30
+ # Path of file relative to url.
31
+ attr_accessor :relative_path
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'repository' => :'repository',
37
+ :'artifacts' => :'artifacts',
38
+ :'release' => :'release',
39
+ :'component' => :'component',
40
+ :'relative_path' => :'relative_path'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'repository' => :'String',
48
+ :'artifacts' => :'Object',
49
+ :'release' => :'String',
50
+ :'component' => :'String',
51
+ :'relative_path' => :'String'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpDebClient::DebSourceIndex` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpDebClient::DebSourceIndex`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'repository')
77
+ self.repository = attributes[:'repository']
78
+ end
79
+
80
+ if attributes.key?(:'artifacts')
81
+ self.artifacts = attributes[:'artifacts']
82
+ end
83
+
84
+ if attributes.key?(:'release')
85
+ self.release = attributes[:'release']
86
+ end
87
+
88
+ if attributes.key?(:'component')
89
+ self.component = attributes[:'component']
90
+ end
91
+
92
+ if attributes.key?(:'relative_path')
93
+ self.relative_path = attributes[:'relative_path']
94
+ end
95
+ end
96
+
97
+ # Show invalid properties with the reasons. Usually used together with valid?
98
+ # @return Array for valid properties with the reasons
99
+ def list_invalid_properties
100
+ invalid_properties = Array.new
101
+ if @artifacts.nil?
102
+ invalid_properties.push('invalid value for "artifacts", artifacts cannot be nil.')
103
+ end
104
+
105
+ if @release.nil?
106
+ invalid_properties.push('invalid value for "release", release cannot be nil.')
107
+ end
108
+
109
+ if @component.nil?
110
+ invalid_properties.push('invalid value for "component", component cannot be nil.')
111
+ end
112
+
113
+ if @component.to_s.length < 1
114
+ invalid_properties.push('invalid value for "component", the character length must be great than or equal to 1.')
115
+ end
116
+
117
+ if !@relative_path.nil? && @relative_path.to_s.length < 1
118
+ invalid_properties.push('invalid value for "relative_path", the character length must be great than or equal to 1.')
119
+ end
120
+
121
+ invalid_properties
122
+ end
123
+
124
+ # Check to see if the all the properties in the model are valid
125
+ # @return true if the model is valid
126
+ def valid?
127
+ return false if @artifacts.nil?
128
+ return false if @release.nil?
129
+ return false if @component.nil?
130
+ return false if @component.to_s.length < 1
131
+ return false if !@relative_path.nil? && @relative_path.to_s.length < 1
132
+ true
133
+ end
134
+
135
+ # Custom attribute writer method with validation
136
+ # @param [Object] component Value to be assigned
137
+ def component=(component)
138
+ if component.nil?
139
+ fail ArgumentError, 'component cannot be nil'
140
+ end
141
+
142
+ if component.to_s.length < 1
143
+ fail ArgumentError, 'invalid value for "component", the character length must be great than or equal to 1.'
144
+ end
145
+
146
+ @component = component
147
+ end
148
+
149
+ # Custom attribute writer method with validation
150
+ # @param [Object] relative_path Value to be assigned
151
+ def relative_path=(relative_path)
152
+ if !relative_path.nil? && relative_path.to_s.length < 1
153
+ fail ArgumentError, 'invalid value for "relative_path", the character length must be great than or equal to 1.'
154
+ end
155
+
156
+ @relative_path = relative_path
157
+ end
158
+
159
+ # Checks equality by comparing each attribute.
160
+ # @param [Object] Object to be compared
161
+ def ==(o)
162
+ return true if self.equal?(o)
163
+ self.class == o.class &&
164
+ repository == o.repository &&
165
+ artifacts == o.artifacts &&
166
+ release == o.release &&
167
+ component == o.component &&
168
+ relative_path == o.relative_path
169
+ end
170
+
171
+ # @see the `==` method
172
+ # @param [Object] Object to be compared
173
+ def eql?(o)
174
+ self == o
175
+ end
176
+
177
+ # Calculates hash code according to all attributes.
178
+ # @return [Integer] Hash code
179
+ def hash
180
+ [repository, artifacts, release, component, relative_path].hash
181
+ end
182
+
183
+ # Builds the object from hash
184
+ # @param [Hash] attributes Model attributes in the form of hash
185
+ # @return [Object] Returns the model itself
186
+ def self.build_from_hash(attributes)
187
+ new.build_from_hash(attributes)
188
+ end
189
+
190
+ # Builds the object from hash
191
+ # @param [Hash] attributes Model attributes in the form of hash
192
+ # @return [Object] Returns the model itself
193
+ def build_from_hash(attributes)
194
+ return nil unless attributes.is_a?(Hash)
195
+ self.class.openapi_types.each_pair do |key, type|
196
+ if type =~ /\AArray<(.*)>/i
197
+ # check to ensure the input is an array given that the attribute
198
+ # is documented as an array but the input is not
199
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
200
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
201
+ end
202
+ elsif !attributes[self.class.attribute_map[key]].nil?
203
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
204
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
205
+ end
206
+
207
+ self
208
+ end
209
+
210
+ # Deserializes the data based on type
211
+ # @param string type Data type
212
+ # @param string value Value to be deserialized
213
+ # @return [Object] Deserialized data
214
+ def _deserialize(type, value)
215
+ case type.to_sym
216
+ when :DateTime
217
+ DateTime.parse(value)
218
+ when :Date
219
+ Date.parse(value)
220
+ when :String
221
+ value.to_s
222
+ when :Integer
223
+ value.to_i
224
+ when :Float
225
+ value.to_f
226
+ when :Boolean
227
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
228
+ true
229
+ else
230
+ false
231
+ end
232
+ when :Object
233
+ # generic object (usually a Hash), return directly
234
+ value
235
+ when /\AArray<(?<inner_type>.+)>\z/
236
+ inner_type = Regexp.last_match[:inner_type]
237
+ value.map { |v| _deserialize(inner_type, v) }
238
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
239
+ k_type = Regexp.last_match[:k_type]
240
+ v_type = Regexp.last_match[:v_type]
241
+ {}.tap do |hash|
242
+ value.each do |k, v|
243
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
244
+ end
245
+ end
246
+ else # model
247
+ PulpDebClient.const_get(type).build_from_hash(value)
248
+ end
249
+ end
250
+
251
+ # Returns the string representation of the object
252
+ # @return [String] String presentation of the object
253
+ def to_s
254
+ to_hash.to_s
255
+ end
256
+
257
+ # to_body is an alias to to_hash (backward compatibility)
258
+ # @return [Hash] Returns the object in the form of hash
259
+ def to_body
260
+ to_hash
261
+ end
262
+
263
+ # Returns the object in the form of hash
264
+ # @return [Hash] Returns the object in the form of hash
265
+ def to_hash
266
+ hash = {}
267
+ self.class.attribute_map.each_pair do |attr, param|
268
+ value = self.send(attr)
269
+ if value.nil?
270
+ is_nullable = self.class.openapi_nullable.include?(attr)
271
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
272
+ end
273
+
274
+ hash[param] = _to_hash(value)
275
+ end
276
+ hash
277
+ end
278
+
279
+ # Outputs non-array value in the form of hash
280
+ # For object, use to_hash. Otherwise, just return the value
281
+ # @param [Object] value Any valid value
282
+ # @return [Hash] Returns the value in the form of hash
283
+ def _to_hash(value)
284
+ if value.is_a?(Array)
285
+ value.compact.map { |v| _to_hash(v) }
286
+ elsif value.is_a?(Hash)
287
+ {}.tap do |hash|
288
+ value.each { |k, v| hash[k] = _to_hash(v) }
289
+ end
290
+ elsif value.respond_to? :to_hash
291
+ value.to_hash
292
+ else
293
+ value
294
+ end
295
+ end
296
+ end
297
+ end
@@ -0,0 +1,272 @@
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 SourceIndex.
17
+ class DebSourceIndexResponse
18
+ attr_accessor :pulp_href
19
+
20
+ # Timestamp of creation.
21
+ attr_accessor :pulp_created
22
+
23
+ # A dict mapping relative paths inside the Content to the correspondingArtifact URLs. E.g.: {'relative/path': '/artifacts/1/'
24
+ attr_accessor :artifacts
25
+
26
+ # Release this index file belongs to.
27
+ attr_accessor :release
28
+
29
+ # Component this index file belongs to.
30
+ attr_accessor :component
31
+
32
+ # Path of file relative to url.
33
+ attr_accessor :relative_path
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'pulp_href' => :'pulp_href',
39
+ :'pulp_created' => :'pulp_created',
40
+ :'artifacts' => :'artifacts',
41
+ :'release' => :'release',
42
+ :'component' => :'component',
43
+ :'relative_path' => :'relative_path'
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'pulp_href' => :'String',
51
+ :'pulp_created' => :'DateTime',
52
+ :'artifacts' => :'Object',
53
+ :'release' => :'String',
54
+ :'component' => :'String',
55
+ :'relative_path' => :'String'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ ])
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ if (!attributes.is_a?(Hash))
69
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpDebClient::DebSourceIndexResponse` initialize method"
70
+ end
71
+
72
+ # check to see if the attribute exists and convert string to symbol for hash key
73
+ attributes = attributes.each_with_object({}) { |(k, v), h|
74
+ if (!self.class.attribute_map.key?(k.to_sym))
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpDebClient::DebSourceIndexResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
76
+ end
77
+ h[k.to_sym] = v
78
+ }
79
+
80
+ if attributes.key?(:'pulp_href')
81
+ self.pulp_href = attributes[:'pulp_href']
82
+ end
83
+
84
+ if attributes.key?(:'pulp_created')
85
+ self.pulp_created = attributes[:'pulp_created']
86
+ end
87
+
88
+ if attributes.key?(:'artifacts')
89
+ self.artifacts = attributes[:'artifacts']
90
+ end
91
+
92
+ if attributes.key?(:'release')
93
+ self.release = attributes[:'release']
94
+ end
95
+
96
+ if attributes.key?(:'component')
97
+ self.component = attributes[:'component']
98
+ end
99
+
100
+ if attributes.key?(:'relative_path')
101
+ self.relative_path = attributes[:'relative_path']
102
+ end
103
+ end
104
+
105
+ # Show invalid properties with the reasons. Usually used together with valid?
106
+ # @return Array for valid properties with the reasons
107
+ def list_invalid_properties
108
+ invalid_properties = Array.new
109
+ if @artifacts.nil?
110
+ invalid_properties.push('invalid value for "artifacts", artifacts cannot be nil.')
111
+ end
112
+
113
+ if @release.nil?
114
+ invalid_properties.push('invalid value for "release", release cannot be nil.')
115
+ end
116
+
117
+ if @component.nil?
118
+ invalid_properties.push('invalid value for "component", component cannot be nil.')
119
+ end
120
+
121
+ invalid_properties
122
+ end
123
+
124
+ # Check to see if the all the properties in the model are valid
125
+ # @return true if the model is valid
126
+ def valid?
127
+ return false if @artifacts.nil?
128
+ return false if @release.nil?
129
+ return false if @component.nil?
130
+ true
131
+ end
132
+
133
+ # Checks equality by comparing each attribute.
134
+ # @param [Object] Object to be compared
135
+ def ==(o)
136
+ return true if self.equal?(o)
137
+ self.class == o.class &&
138
+ pulp_href == o.pulp_href &&
139
+ pulp_created == o.pulp_created &&
140
+ artifacts == o.artifacts &&
141
+ release == o.release &&
142
+ component == o.component &&
143
+ relative_path == o.relative_path
144
+ end
145
+
146
+ # @see the `==` method
147
+ # @param [Object] Object to be compared
148
+ def eql?(o)
149
+ self == o
150
+ end
151
+
152
+ # Calculates hash code according to all attributes.
153
+ # @return [Integer] Hash code
154
+ def hash
155
+ [pulp_href, pulp_created, artifacts, release, component, relative_path].hash
156
+ end
157
+
158
+ # Builds the object from hash
159
+ # @param [Hash] attributes Model attributes in the form of hash
160
+ # @return [Object] Returns the model itself
161
+ def self.build_from_hash(attributes)
162
+ new.build_from_hash(attributes)
163
+ end
164
+
165
+ # Builds the object from hash
166
+ # @param [Hash] attributes Model attributes in the form of hash
167
+ # @return [Object] Returns the model itself
168
+ def build_from_hash(attributes)
169
+ return nil unless attributes.is_a?(Hash)
170
+ self.class.openapi_types.each_pair do |key, type|
171
+ if type =~ /\AArray<(.*)>/i
172
+ # check to ensure the input is an array given that the attribute
173
+ # is documented as an array but the input is not
174
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
175
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
176
+ end
177
+ elsif !attributes[self.class.attribute_map[key]].nil?
178
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
179
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
180
+ end
181
+
182
+ self
183
+ end
184
+
185
+ # Deserializes the data based on type
186
+ # @param string type Data type
187
+ # @param string value Value to be deserialized
188
+ # @return [Object] Deserialized data
189
+ def _deserialize(type, value)
190
+ case type.to_sym
191
+ when :DateTime
192
+ DateTime.parse(value)
193
+ when :Date
194
+ Date.parse(value)
195
+ when :String
196
+ value.to_s
197
+ when :Integer
198
+ value.to_i
199
+ when :Float
200
+ value.to_f
201
+ when :Boolean
202
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
203
+ true
204
+ else
205
+ false
206
+ end
207
+ when :Object
208
+ # generic object (usually a Hash), return directly
209
+ value
210
+ when /\AArray<(?<inner_type>.+)>\z/
211
+ inner_type = Regexp.last_match[:inner_type]
212
+ value.map { |v| _deserialize(inner_type, v) }
213
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
214
+ k_type = Regexp.last_match[:k_type]
215
+ v_type = Regexp.last_match[:v_type]
216
+ {}.tap do |hash|
217
+ value.each do |k, v|
218
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
219
+ end
220
+ end
221
+ else # model
222
+ PulpDebClient.const_get(type).build_from_hash(value)
223
+ end
224
+ end
225
+
226
+ # Returns the string representation of the object
227
+ # @return [String] String presentation of the object
228
+ def to_s
229
+ to_hash.to_s
230
+ end
231
+
232
+ # to_body is an alias to to_hash (backward compatibility)
233
+ # @return [Hash] Returns the object in the form of hash
234
+ def to_body
235
+ to_hash
236
+ end
237
+
238
+ # Returns the object in the form of hash
239
+ # @return [Hash] Returns the object in the form of hash
240
+ def to_hash
241
+ hash = {}
242
+ self.class.attribute_map.each_pair do |attr, param|
243
+ value = self.send(attr)
244
+ if value.nil?
245
+ is_nullable = self.class.openapi_nullable.include?(attr)
246
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
247
+ end
248
+
249
+ hash[param] = _to_hash(value)
250
+ end
251
+ hash
252
+ end
253
+
254
+ # Outputs non-array value in the form of hash
255
+ # For object, use to_hash. Otherwise, just return the value
256
+ # @param [Object] value Any valid value
257
+ # @return [Hash] Returns the value in the form of hash
258
+ def _to_hash(value)
259
+ if value.is_a?(Array)
260
+ value.compact.map { |v| _to_hash(v) }
261
+ elsif value.is_a?(Hash)
262
+ {}.tap do |hash|
263
+ value.each { |k, v| hash[k] = _to_hash(v) }
264
+ end
265
+ elsif value.respond_to? :to_hash
266
+ value.to_hash
267
+ else
268
+ value
269
+ end
270
+ end
271
+ end
272
+ end