pulp_deb_client 2.4.0b1 → 2.5.0b1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +35 -48
  3. data/docs/ContentGenericContentsApi.md +2 -2
  4. data/docs/ContentInstallerFileIndicesApi.md +4 -4
  5. data/docs/ContentInstallerPackagesApi.md +2 -2
  6. data/docs/ContentPackageIndicesApi.md +4 -4
  7. data/docs/ContentPackageReleaseComponentsApi.md +4 -4
  8. data/docs/ContentPackagesApi.md +2 -2
  9. data/docs/ContentReleaseArchitecturesApi.md +4 -4
  10. data/docs/ContentReleaseComponentsApi.md +4 -4
  11. data/docs/ContentReleaseFilesApi.md +4 -4
  12. data/docs/ContentReleasesApi.md +4 -4
  13. data/docs/{DebDebDistribution.md → DebAptDistribution.md} +2 -2
  14. data/docs/{DebDebPublication.md → DebAptPublication.md} +2 -2
  15. data/docs/{DebDebRemote.md → DebAptRemote.md} +2 -2
  16. data/docs/{DebDebRepository.md → DebAptRepository.md} +2 -2
  17. data/docs/{DebBasePackageRead.md → DebBasePackage.md} +2 -2
  18. data/docs/{DebGenericContentRead.md → DebGenericContent.md} +2 -2
  19. data/docs/DistributionsAptApi.md +43 -43
  20. data/docs/InlineResponse200.md +1 -1
  21. data/docs/InlineResponse2001.md +1 -1
  22. data/docs/InlineResponse20010.md +1 -1
  23. data/docs/InlineResponse20011.md +1 -1
  24. data/docs/InlineResponse20012.md +1 -1
  25. data/docs/InlineResponse20013.md +1 -1
  26. data/docs/InlineResponse20014.md +1 -1
  27. data/docs/InlineResponse2002.md +1 -1
  28. data/docs/InlineResponse2003.md +1 -1
  29. data/docs/InlineResponse2004.md +1 -1
  30. data/docs/InlineResponse2005.md +1 -1
  31. data/docs/InlineResponse2006.md +1 -1
  32. data/docs/InlineResponse2007.md +1 -1
  33. data/docs/InlineResponse2008.md +1 -1
  34. data/docs/InlineResponse2009.md +1 -1
  35. data/docs/PublicationsAptApi.md +26 -26
  36. data/docs/PublicationsVerbatimApi.md +2 -2
  37. data/docs/RemotesAptApi.md +46 -46
  38. data/docs/RepositoriesAptApi.md +56 -56
  39. data/docs/RepositoriesDebVersionsApi.md +13 -11
  40. data/lib/pulp_deb_client/api/content_generic_contents_api.rb +3 -3
  41. data/lib/pulp_deb_client/api/content_installer_file_indices_api.rb +6 -6
  42. data/lib/pulp_deb_client/api/content_installer_packages_api.rb +3 -3
  43. data/lib/pulp_deb_client/api/content_package_indices_api.rb +6 -6
  44. data/lib/pulp_deb_client/api/content_package_release_components_api.rb +6 -6
  45. data/lib/pulp_deb_client/api/content_packages_api.rb +3 -3
  46. data/lib/pulp_deb_client/api/content_release_architectures_api.rb +6 -6
  47. data/lib/pulp_deb_client/api/content_release_components_api.rb +6 -6
  48. data/lib/pulp_deb_client/api/content_release_files_api.rb +6 -6
  49. data/lib/pulp_deb_client/api/content_releases_api.rb +6 -6
  50. data/lib/pulp_deb_client/api/distributions_apt_api.rb +61 -61
  51. data/lib/pulp_deb_client/api/publications_apt_api.rb +37 -37
  52. data/lib/pulp_deb_client/api/publications_verbatim_api.rb +3 -3
  53. data/lib/pulp_deb_client/api/remotes_apt_api.rb +66 -66
  54. data/lib/pulp_deb_client/api/repositories_apt_api.rb +84 -84
  55. data/lib/pulp_deb_client/api/repositories_deb_versions_api.rb +22 -19
  56. data/lib/pulp_deb_client/models/{deb_deb_distribution.rb → deb_apt_distribution.rb} +3 -3
  57. data/lib/pulp_deb_client/models/{deb_deb_publication.rb → deb_apt_publication.rb} +3 -3
  58. data/lib/pulp_deb_client/models/{deb_deb_remote.rb → deb_apt_remote.rb} +6 -3
  59. data/lib/pulp_deb_client/models/{deb_deb_repository.rb → deb_apt_repository.rb} +3 -3
  60. data/lib/pulp_deb_client/models/{deb_base_package_read.rb → deb_base_package.rb} +3 -3
  61. data/lib/pulp_deb_client/models/{deb_generic_content_read.rb → deb_generic_content.rb} +3 -3
  62. data/lib/pulp_deb_client/models/inline_response200.rb +1 -1
  63. data/lib/pulp_deb_client/models/inline_response2001.rb +1 -1
  64. data/lib/pulp_deb_client/models/inline_response20010.rb +1 -1
  65. data/lib/pulp_deb_client/models/inline_response20011.rb +1 -1
  66. data/lib/pulp_deb_client/models/inline_response20012.rb +1 -1
  67. data/lib/pulp_deb_client/models/inline_response20013.rb +1 -1
  68. data/lib/pulp_deb_client/models/inline_response20014.rb +1 -1
  69. data/lib/pulp_deb_client/models/inline_response2002.rb +1 -1
  70. data/lib/pulp_deb_client/models/inline_response2003.rb +1 -1
  71. data/lib/pulp_deb_client/models/inline_response2004.rb +1 -1
  72. data/lib/pulp_deb_client/models/inline_response2005.rb +1 -1
  73. data/lib/pulp_deb_client/models/inline_response2006.rb +1 -1
  74. data/lib/pulp_deb_client/models/inline_response2007.rb +1 -1
  75. data/lib/pulp_deb_client/models/inline_response2008.rb +1 -1
  76. data/lib/pulp_deb_client/models/inline_response2009.rb +1 -1
  77. data/lib/pulp_deb_client/version.rb +1 -1
  78. data/lib/pulp_deb_client.rb +6 -19
  79. data/spec/api/content_generic_contents_api_spec.rb +1 -1
  80. data/spec/api/content_installer_file_indices_api_spec.rb +2 -2
  81. data/spec/api/content_installer_packages_api_spec.rb +1 -1
  82. data/spec/api/content_package_indices_api_spec.rb +2 -2
  83. data/spec/api/content_package_release_components_api_spec.rb +2 -2
  84. data/spec/api/content_packages_api_spec.rb +1 -1
  85. data/spec/api/content_release_architectures_api_spec.rb +2 -2
  86. data/spec/api/content_release_components_api_spec.rb +2 -2
  87. data/spec/api/content_release_files_api_spec.rb +2 -2
  88. data/spec/api/content_releases_api_spec.rb +2 -2
  89. data/spec/api/distributions_apt_api_spec.rb +13 -13
  90. data/spec/api/publications_apt_api_spec.rb +10 -10
  91. data/spec/api/publications_verbatim_api_spec.rb +1 -1
  92. data/spec/api/remotes_apt_api_spec.rb +15 -15
  93. data/spec/api/repositories_apt_api_spec.rb +17 -17
  94. data/spec/api/repositories_deb_versions_api_spec.rb +6 -5
  95. data/spec/models/{deb_deb_distribution_spec.rb → deb_apt_distribution_spec.rb} +6 -6
  96. data/spec/models/{deb_deb_publication_spec.rb → deb_apt_publication_spec.rb} +6 -6
  97. data/spec/models/{deb_deb_remote_spec.rb → deb_apt_remote_spec.rb} +6 -6
  98. data/spec/models/{deb_deb_repository_spec.rb → deb_apt_repository_spec.rb} +6 -6
  99. data/spec/models/{deb_base_package_read_spec.rb → deb_base_package_spec.rb} +6 -6
  100. data/spec/models/{deb_generic_content_read_spec.rb → deb_generic_content_spec.rb} +6 -6
  101. metadata +26 -78
  102. data/docs/DebDebDistributionRead.md +0 -29
  103. data/docs/DebDebPublicationRead.md +0 -29
  104. data/docs/DebDebRemoteRead.md +0 -57
  105. data/docs/DebDebRepositoryRead.md +0 -27
  106. data/docs/DebInstallerFileIndexRead.md +0 -29
  107. data/docs/DebPackageIndexRead.md +0 -29
  108. data/docs/DebPackageReleaseComponentRead.md +0 -23
  109. data/docs/DebReleaseArchitectureRead.md +0 -23
  110. data/docs/DebReleaseComponentRead.md +0 -23
  111. data/docs/DebReleaseFileRead.md +0 -29
  112. data/docs/DebReleaseRead.md +0 -25
  113. data/docs/DebVerbatimPublicationRead.md +0 -23
  114. data/docs/RepositoryVersionRead.md +0 -25
  115. data/lib/pulp_deb_client/models/deb_deb_distribution_read.rb +0 -331
  116. data/lib/pulp_deb_client/models/deb_deb_publication_read.rb +0 -269
  117. data/lib/pulp_deb_client/models/deb_deb_remote_read.rb +0 -670
  118. data/lib/pulp_deb_client/models/deb_deb_repository_read.rb +0 -294
  119. data/lib/pulp_deb_client/models/deb_installer_file_index_read.rb +0 -341
  120. data/lib/pulp_deb_client/models/deb_package_index_read.rb +0 -341
  121. data/lib/pulp_deb_client/models/deb_package_release_component_read.rb +0 -246
  122. data/lib/pulp_deb_client/models/deb_release_architecture_read.rb +0 -265
  123. data/lib/pulp_deb_client/models/deb_release_component_read.rb +0 -265
  124. data/lib/pulp_deb_client/models/deb_release_file_read.rb +0 -342
  125. data/lib/pulp_deb_client/models/deb_release_read.rb +0 -315
  126. data/lib/pulp_deb_client/models/deb_verbatim_publication_read.rb +0 -235
  127. data/lib/pulp_deb_client/models/repository_version_read.rb +0 -244
  128. data/spec/models/deb_deb_distribution_read_spec.rb +0 -77
  129. data/spec/models/deb_deb_publication_read_spec.rb +0 -77
  130. data/spec/models/deb_deb_remote_read_spec.rb +0 -165
  131. data/spec/models/deb_deb_repository_read_spec.rb +0 -71
  132. data/spec/models/deb_installer_file_index_read_spec.rb +0 -77
  133. data/spec/models/deb_package_index_read_spec.rb +0 -77
  134. data/spec/models/deb_package_release_component_read_spec.rb +0 -59
  135. data/spec/models/deb_release_architecture_read_spec.rb +0 -59
  136. data/spec/models/deb_release_component_read_spec.rb +0 -59
  137. data/spec/models/deb_release_file_read_spec.rb +0 -77
  138. data/spec/models/deb_release_read_spec.rb +0 -65
  139. data/spec/models/deb_verbatim_publication_read_spec.rb +0 -59
  140. data/spec/models/repository_version_read_spec.rb +0 -65
@@ -1,341 +0,0 @@
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.3
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module PulpDebClient
16
- class DebPackageIndexRead
17
- attr_accessor :pulp_href
18
-
19
- # Timestamp of creation.
20
- attr_accessor :pulp_created
21
-
22
- # A dict mapping relative paths inside the Content to the correspondingArtifact URLs. E.g.: {'relative/path': '/artifacts/1/'
23
- attr_accessor :artifacts
24
-
25
- # Release this index file belongs to.
26
- attr_accessor :release
27
-
28
- # Component of the component - architecture combination.
29
- attr_accessor :component
30
-
31
- # Architecture of the component - architecture combination.
32
- attr_accessor :architecture
33
-
34
- # Path of file relative to url.
35
- attr_accessor :relative_path
36
-
37
- # Attribute mapping from ruby-style variable name to JSON key.
38
- def self.attribute_map
39
- {
40
- :'pulp_href' => :'pulp_href',
41
- :'pulp_created' => :'pulp_created',
42
- :'artifacts' => :'artifacts',
43
- :'release' => :'release',
44
- :'component' => :'component',
45
- :'architecture' => :'architecture',
46
- :'relative_path' => :'relative_path'
47
- }
48
- end
49
-
50
- # Attribute type mapping.
51
- def self.openapi_types
52
- {
53
- :'pulp_href' => :'String',
54
- :'pulp_created' => :'DateTime',
55
- :'artifacts' => :'Hash<String, String>',
56
- :'release' => :'String',
57
- :'component' => :'String',
58
- :'architecture' => :'String',
59
- :'relative_path' => :'String'
60
- }
61
- end
62
-
63
- # List of attributes with nullable: true
64
- def self.openapi_nullable
65
- Set.new([
66
- ])
67
- end
68
-
69
- # Initializes the object
70
- # @param [Hash] attributes Model attributes in the form of hash
71
- def initialize(attributes = {})
72
- if (!attributes.is_a?(Hash))
73
- fail ArgumentError, "The input argument (attributes) must be a hash in `PulpDebClient::DebPackageIndexRead` initialize method"
74
- end
75
-
76
- # check to see if the attribute exists and convert string to symbol for hash key
77
- attributes = attributes.each_with_object({}) { |(k, v), h|
78
- if (!self.class.attribute_map.key?(k.to_sym))
79
- fail ArgumentError, "`#{k}` is not a valid attribute in `PulpDebClient::DebPackageIndexRead`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
80
- end
81
- h[k.to_sym] = v
82
- }
83
-
84
- if attributes.key?(:'pulp_href')
85
- self.pulp_href = attributes[:'pulp_href']
86
- end
87
-
88
- if attributes.key?(:'pulp_created')
89
- self.pulp_created = attributes[:'pulp_created']
90
- end
91
-
92
- if attributes.key?(:'artifacts')
93
- if (value = attributes[:'artifacts']).is_a?(Hash)
94
- self.artifacts = value
95
- end
96
- end
97
-
98
- if attributes.key?(:'release')
99
- self.release = attributes[:'release']
100
- end
101
-
102
- if attributes.key?(:'component')
103
- self.component = attributes[:'component']
104
- end
105
-
106
- if attributes.key?(:'architecture')
107
- self.architecture = attributes[:'architecture']
108
- end
109
-
110
- if attributes.key?(:'relative_path')
111
- self.relative_path = attributes[:'relative_path']
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 @artifacts.nil?
120
- invalid_properties.push('invalid value for "artifacts", artifacts cannot be nil.')
121
- end
122
-
123
- if @release.nil?
124
- invalid_properties.push('invalid value for "release", release cannot be nil.')
125
- end
126
-
127
- if @component.nil?
128
- invalid_properties.push('invalid value for "component", component cannot be nil.')
129
- end
130
-
131
- if @component.to_s.length < 1
132
- invalid_properties.push('invalid value for "component", the character length must be great than or equal to 1.')
133
- end
134
-
135
- if @architecture.nil?
136
- invalid_properties.push('invalid value for "architecture", architecture cannot be nil.')
137
- end
138
-
139
- if @architecture.to_s.length < 1
140
- invalid_properties.push('invalid value for "architecture", the character length must be great than or equal to 1.')
141
- end
142
-
143
- if !@relative_path.nil? && @relative_path.to_s.length < 1
144
- invalid_properties.push('invalid value for "relative_path", the character length must be great than or equal to 1.')
145
- end
146
-
147
- invalid_properties
148
- end
149
-
150
- # Check to see if the all the properties in the model are valid
151
- # @return true if the model is valid
152
- def valid?
153
- return false if @artifacts.nil?
154
- return false if @release.nil?
155
- return false if @component.nil?
156
- return false if @component.to_s.length < 1
157
- return false if @architecture.nil?
158
- return false if @architecture.to_s.length < 1
159
- return false if !@relative_path.nil? && @relative_path.to_s.length < 1
160
- true
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?
167
- fail ArgumentError, 'component cannot be nil'
168
- end
169
-
170
- if component.to_s.length < 1
171
- fail ArgumentError, 'invalid value for "component", the character length must be great than or equal to 1.'
172
- end
173
-
174
- @component = component
175
- end
176
-
177
- # Custom attribute writer method with validation
178
- # @param [Object] architecture Value to be assigned
179
- def architecture=(architecture)
180
- if architecture.nil?
181
- fail ArgumentError, 'architecture cannot be nil'
182
- end
183
-
184
- if architecture.to_s.length < 1
185
- fail ArgumentError, 'invalid value for "architecture", the character length must be great than or equal to 1.'
186
- end
187
-
188
- @architecture = architecture
189
- end
190
-
191
- # Custom attribute writer method with validation
192
- # @param [Object] relative_path Value to be assigned
193
- def relative_path=(relative_path)
194
- if !relative_path.nil? && relative_path.to_s.length < 1
195
- fail ArgumentError, 'invalid value for "relative_path", the character length must be great than or equal to 1.'
196
- end
197
-
198
- @relative_path = relative_path
199
- end
200
-
201
- # Checks equality by comparing each attribute.
202
- # @param [Object] Object to be compared
203
- def ==(o)
204
- return true if self.equal?(o)
205
- self.class == o.class &&
206
- pulp_href == o.pulp_href &&
207
- pulp_created == o.pulp_created &&
208
- artifacts == o.artifacts &&
209
- release == o.release &&
210
- component == o.component &&
211
- architecture == o.architecture &&
212
- relative_path == o.relative_path
213
- end
214
-
215
- # @see the `==` method
216
- # @param [Object] Object to be compared
217
- def eql?(o)
218
- self == o
219
- end
220
-
221
- # Calculates hash code according to all attributes.
222
- # @return [Integer] Hash code
223
- def hash
224
- [pulp_href, pulp_created, artifacts, release, component, architecture, relative_path].hash
225
- end
226
-
227
- # Builds the object from hash
228
- # @param [Hash] attributes Model attributes in the form of hash
229
- # @return [Object] Returns the model itself
230
- def self.build_from_hash(attributes)
231
- new.build_from_hash(attributes)
232
- end
233
-
234
- # Builds the object from hash
235
- # @param [Hash] attributes Model attributes in the form of hash
236
- # @return [Object] Returns the model itself
237
- def build_from_hash(attributes)
238
- return nil unless attributes.is_a?(Hash)
239
- self.class.openapi_types.each_pair do |key, type|
240
- if type =~ /\AArray<(.*)>/i
241
- # check to ensure the input is an array given that the attribute
242
- # is documented as an array but the input is not
243
- if attributes[self.class.attribute_map[key]].is_a?(Array)
244
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
245
- end
246
- elsif !attributes[self.class.attribute_map[key]].nil?
247
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
248
- end # or else data not found in attributes(hash), not an issue as the data can be optional
249
- end
250
-
251
- self
252
- end
253
-
254
- # Deserializes the data based on type
255
- # @param string type Data type
256
- # @param string value Value to be deserialized
257
- # @return [Object] Deserialized data
258
- def _deserialize(type, value)
259
- case type.to_sym
260
- when :DateTime
261
- DateTime.parse(value)
262
- when :Date
263
- Date.parse(value)
264
- when :String
265
- value.to_s
266
- when :Integer
267
- value.to_i
268
- when :Float
269
- value.to_f
270
- when :Boolean
271
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
272
- true
273
- else
274
- false
275
- end
276
- when :Object
277
- # generic object (usually a Hash), return directly
278
- value
279
- when /\AArray<(?<inner_type>.+)>\z/
280
- inner_type = Regexp.last_match[:inner_type]
281
- value.map { |v| _deserialize(inner_type, v) }
282
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
283
- k_type = Regexp.last_match[:k_type]
284
- v_type = Regexp.last_match[:v_type]
285
- {}.tap do |hash|
286
- value.each do |k, v|
287
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
288
- end
289
- end
290
- else # model
291
- PulpDebClient.const_get(type).build_from_hash(value)
292
- end
293
- end
294
-
295
- # Returns the string representation of the object
296
- # @return [String] String presentation of the object
297
- def to_s
298
- to_hash.to_s
299
- end
300
-
301
- # to_body is an alias to to_hash (backward compatibility)
302
- # @return [Hash] Returns the object in the form of hash
303
- def to_body
304
- to_hash
305
- end
306
-
307
- # Returns the object in the form of hash
308
- # @return [Hash] Returns the object in the form of hash
309
- def to_hash
310
- hash = {}
311
- self.class.attribute_map.each_pair do |attr, param|
312
- value = self.send(attr)
313
- if value.nil?
314
- is_nullable = self.class.openapi_nullable.include?(attr)
315
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
316
- end
317
-
318
- hash[param] = _to_hash(value)
319
- end
320
- hash
321
- end
322
-
323
- # Outputs non-array value in the form of hash
324
- # For object, use to_hash. Otherwise, just return the value
325
- # @param [Object] value Any valid value
326
- # @return [Hash] Returns the value in the form of hash
327
- def _to_hash(value)
328
- if value.is_a?(Array)
329
- value.compact.map { |v| _to_hash(v) }
330
- elsif value.is_a?(Hash)
331
- {}.tap do |hash|
332
- value.each { |k, v| hash[k] = _to_hash(v) }
333
- end
334
- elsif value.respond_to? :to_hash
335
- value.to_hash
336
- else
337
- value
338
- end
339
- end
340
- end
341
- end
@@ -1,246 +0,0 @@
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.3
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module PulpDebClient
16
- class DebPackageReleaseComponentRead
17
- attr_accessor :pulp_href
18
-
19
- # Timestamp of creation.
20
- attr_accessor :pulp_created
21
-
22
- # Package that is contained in release_comonent.
23
- attr_accessor :package
24
-
25
- # ReleaseComponent this package is contained in.
26
- attr_accessor :release_component
27
-
28
- # Attribute mapping from ruby-style variable name to JSON key.
29
- def self.attribute_map
30
- {
31
- :'pulp_href' => :'pulp_href',
32
- :'pulp_created' => :'pulp_created',
33
- :'package' => :'package',
34
- :'release_component' => :'release_component'
35
- }
36
- end
37
-
38
- # Attribute type mapping.
39
- def self.openapi_types
40
- {
41
- :'pulp_href' => :'String',
42
- :'pulp_created' => :'DateTime',
43
- :'package' => :'String',
44
- :'release_component' => :'String'
45
- }
46
- end
47
-
48
- # List of attributes with nullable: true
49
- def self.openapi_nullable
50
- Set.new([
51
- ])
52
- end
53
-
54
- # Initializes the object
55
- # @param [Hash] attributes Model attributes in the form of hash
56
- def initialize(attributes = {})
57
- if (!attributes.is_a?(Hash))
58
- fail ArgumentError, "The input argument (attributes) must be a hash in `PulpDebClient::DebPackageReleaseComponentRead` initialize method"
59
- end
60
-
61
- # check to see if the attribute exists and convert string to symbol for hash key
62
- attributes = attributes.each_with_object({}) { |(k, v), h|
63
- if (!self.class.attribute_map.key?(k.to_sym))
64
- fail ArgumentError, "`#{k}` is not a valid attribute in `PulpDebClient::DebPackageReleaseComponentRead`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
65
- end
66
- h[k.to_sym] = v
67
- }
68
-
69
- if attributes.key?(:'pulp_href')
70
- self.pulp_href = attributes[:'pulp_href']
71
- end
72
-
73
- if attributes.key?(:'pulp_created')
74
- self.pulp_created = attributes[:'pulp_created']
75
- end
76
-
77
- if attributes.key?(:'package')
78
- self.package = attributes[:'package']
79
- end
80
-
81
- if attributes.key?(:'release_component')
82
- self.release_component = attributes[:'release_component']
83
- end
84
- end
85
-
86
- # Show invalid properties with the reasons. Usually used together with valid?
87
- # @return Array for valid properties with the reasons
88
- def list_invalid_properties
89
- invalid_properties = Array.new
90
- if @package.nil?
91
- invalid_properties.push('invalid value for "package", package cannot be nil.')
92
- end
93
-
94
- if @release_component.nil?
95
- invalid_properties.push('invalid value for "release_component", release_component cannot be nil.')
96
- end
97
-
98
- invalid_properties
99
- end
100
-
101
- # Check to see if the all the properties in the model are valid
102
- # @return true if the model is valid
103
- def valid?
104
- return false if @package.nil?
105
- return false if @release_component.nil?
106
- true
107
- end
108
-
109
- # Checks equality by comparing each attribute.
110
- # @param [Object] Object to be compared
111
- def ==(o)
112
- return true if self.equal?(o)
113
- self.class == o.class &&
114
- pulp_href == o.pulp_href &&
115
- pulp_created == o.pulp_created &&
116
- package == o.package &&
117
- release_component == o.release_component
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
- [pulp_href, pulp_created, package, release_component].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
- PulpDebClient.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