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,342 +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 DebReleaseFileRead
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
- # Codename of the release, i.e. \"buster\".
26
- attr_accessor :codename
27
-
28
- # Suite of the release, i.e. \"stable\".
29
- attr_accessor :suite
30
-
31
- # Distribution of the release, i.e. \"stable/updates\".
32
- attr_accessor :distribution
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
- :'codename' => :'codename',
44
- :'suite' => :'suite',
45
- :'distribution' => :'distribution',
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
- :'codename' => :'String',
57
- :'suite' => :'String',
58
- :'distribution' => :'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::DebReleaseFileRead` 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::DebReleaseFileRead`. 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?(:'codename')
99
- self.codename = attributes[:'codename']
100
- end
101
-
102
- if attributes.key?(:'suite')
103
- self.suite = attributes[:'suite']
104
- end
105
-
106
- if attributes.key?(:'distribution')
107
- self.distribution = attributes[:'distribution']
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 @codename.nil?
124
- invalid_properties.push('invalid value for "codename", codename cannot be nil.')
125
- end
126
-
127
- if @codename.to_s.length < 1
128
- invalid_properties.push('invalid value for "codename", the character length must be great than or equal to 1.')
129
- end
130
-
131
- if !@suite.nil? && @suite.to_s.length < 1
132
- invalid_properties.push('invalid value for "suite", the character length must be great than or equal to 1.')
133
- end
134
-
135
- if !@distribution.nil? && @distribution.to_s.length < 1
136
- invalid_properties.push('invalid value for "distribution", the character length must be great than or equal to 1.')
137
- end
138
-
139
- if !@relative_path.nil? && @relative_path.to_s.length < 1
140
- invalid_properties.push('invalid value for "relative_path", the character length must be great than or equal to 1.')
141
- end
142
-
143
- invalid_properties
144
- end
145
-
146
- # Check to see if the all the properties in the model are valid
147
- # @return true if the model is valid
148
- def valid?
149
- return false if @artifacts.nil?
150
- return false if @codename.nil?
151
- return false if @codename.to_s.length < 1
152
- return false if !@suite.nil? && @suite.to_s.length < 1
153
- return false if !@distribution.nil? && @distribution.to_s.length < 1
154
- return false if !@relative_path.nil? && @relative_path.to_s.length < 1
155
- true
156
- end
157
-
158
- # Custom attribute writer method with validation
159
- # @param [Object] codename Value to be assigned
160
- def codename=(codename)
161
- if codename.nil?
162
- fail ArgumentError, 'codename cannot be nil'
163
- end
164
-
165
- if codename.to_s.length < 1
166
- fail ArgumentError, 'invalid value for "codename", the character length must be great than or equal to 1.'
167
- end
168
-
169
- @codename = codename
170
- end
171
-
172
- # Custom attribute writer method with validation
173
- # @param [Object] suite Value to be assigned
174
- def suite=(suite)
175
- if !suite.nil? && suite.to_s.length < 1
176
- fail ArgumentError, 'invalid value for "suite", the character length must be great than or equal to 1.'
177
- end
178
-
179
- @suite = suite
180
- end
181
-
182
- # Custom attribute writer method with validation
183
- # @param [Object] distribution Value to be assigned
184
- def distribution=(distribution)
185
- if !distribution.nil? && distribution.to_s.length < 1
186
- fail ArgumentError, 'invalid value for "distribution", the character length must be great than or equal to 1.'
187
- end
188
-
189
- @distribution = distribution
190
- end
191
-
192
- # Custom attribute writer method with validation
193
- # @param [Object] relative_path Value to be assigned
194
- def relative_path=(relative_path)
195
- if !relative_path.nil? && relative_path.to_s.length < 1
196
- fail ArgumentError, 'invalid value for "relative_path", the character length must be great than or equal to 1.'
197
- end
198
-
199
- @relative_path = relative_path
200
- end
201
-
202
- # Checks equality by comparing each attribute.
203
- # @param [Object] Object to be compared
204
- def ==(o)
205
- return true if self.equal?(o)
206
- self.class == o.class &&
207
- pulp_href == o.pulp_href &&
208
- pulp_created == o.pulp_created &&
209
- artifacts == o.artifacts &&
210
- codename == o.codename &&
211
- suite == o.suite &&
212
- distribution == o.distribution &&
213
- relative_path == o.relative_path
214
- end
215
-
216
- # @see the `==` method
217
- # @param [Object] Object to be compared
218
- def eql?(o)
219
- self == o
220
- end
221
-
222
- # Calculates hash code according to all attributes.
223
- # @return [Integer] Hash code
224
- def hash
225
- [pulp_href, pulp_created, artifacts, codename, suite, distribution, relative_path].hash
226
- end
227
-
228
- # Builds the object from hash
229
- # @param [Hash] attributes Model attributes in the form of hash
230
- # @return [Object] Returns the model itself
231
- def self.build_from_hash(attributes)
232
- new.build_from_hash(attributes)
233
- end
234
-
235
- # Builds the object from hash
236
- # @param [Hash] attributes Model attributes in the form of hash
237
- # @return [Object] Returns the model itself
238
- def build_from_hash(attributes)
239
- return nil unless attributes.is_a?(Hash)
240
- self.class.openapi_types.each_pair do |key, type|
241
- if type =~ /\AArray<(.*)>/i
242
- # check to ensure the input is an array given that the attribute
243
- # is documented as an array but the input is not
244
- if attributes[self.class.attribute_map[key]].is_a?(Array)
245
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
246
- end
247
- elsif !attributes[self.class.attribute_map[key]].nil?
248
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
249
- end # or else data not found in attributes(hash), not an issue as the data can be optional
250
- end
251
-
252
- self
253
- end
254
-
255
- # Deserializes the data based on type
256
- # @param string type Data type
257
- # @param string value Value to be deserialized
258
- # @return [Object] Deserialized data
259
- def _deserialize(type, value)
260
- case type.to_sym
261
- when :DateTime
262
- DateTime.parse(value)
263
- when :Date
264
- Date.parse(value)
265
- when :String
266
- value.to_s
267
- when :Integer
268
- value.to_i
269
- when :Float
270
- value.to_f
271
- when :Boolean
272
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
273
- true
274
- else
275
- false
276
- end
277
- when :Object
278
- # generic object (usually a Hash), return directly
279
- value
280
- when /\AArray<(?<inner_type>.+)>\z/
281
- inner_type = Regexp.last_match[:inner_type]
282
- value.map { |v| _deserialize(inner_type, v) }
283
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
284
- k_type = Regexp.last_match[:k_type]
285
- v_type = Regexp.last_match[:v_type]
286
- {}.tap do |hash|
287
- value.each do |k, v|
288
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
289
- end
290
- end
291
- else # model
292
- PulpDebClient.const_get(type).build_from_hash(value)
293
- end
294
- end
295
-
296
- # Returns the string representation of the object
297
- # @return [String] String presentation of the object
298
- def to_s
299
- to_hash.to_s
300
- end
301
-
302
- # to_body is an alias to to_hash (backward compatibility)
303
- # @return [Hash] Returns the object in the form of hash
304
- def to_body
305
- to_hash
306
- end
307
-
308
- # Returns the object in the form of hash
309
- # @return [Hash] Returns the object in the form of hash
310
- def to_hash
311
- hash = {}
312
- self.class.attribute_map.each_pair do |attr, param|
313
- value = self.send(attr)
314
- if value.nil?
315
- is_nullable = self.class.openapi_nullable.include?(attr)
316
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
317
- end
318
-
319
- hash[param] = _to_hash(value)
320
- end
321
- hash
322
- end
323
-
324
- # Outputs non-array value in the form of hash
325
- # For object, use to_hash. Otherwise, just return the value
326
- # @param [Object] value Any valid value
327
- # @return [Hash] Returns the value in the form of hash
328
- def _to_hash(value)
329
- if value.is_a?(Array)
330
- value.compact.map { |v| _to_hash(v) }
331
- elsif value.is_a?(Hash)
332
- {}.tap do |hash|
333
- value.each { |k, v| hash[k] = _to_hash(v) }
334
- end
335
- elsif value.respond_to? :to_hash
336
- value.to_hash
337
- else
338
- value
339
- end
340
- end
341
- end
342
- end
@@ -1,315 +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 DebReleaseRead
17
- attr_accessor :pulp_href
18
-
19
- # Timestamp of creation.
20
- attr_accessor :pulp_created
21
-
22
- attr_accessor :codename
23
-
24
- attr_accessor :suite
25
-
26
- attr_accessor :distribution
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
- :'codename' => :'codename',
34
- :'suite' => :'suite',
35
- :'distribution' => :'distribution'
36
- }
37
- end
38
-
39
- # Attribute type mapping.
40
- def self.openapi_types
41
- {
42
- :'pulp_href' => :'String',
43
- :'pulp_created' => :'DateTime',
44
- :'codename' => :'String',
45
- :'suite' => :'String',
46
- :'distribution' => :'String'
47
- }
48
- end
49
-
50
- # List of attributes with nullable: true
51
- def self.openapi_nullable
52
- Set.new([
53
- ])
54
- end
55
-
56
- # Initializes the object
57
- # @param [Hash] attributes Model attributes in the form of hash
58
- def initialize(attributes = {})
59
- if (!attributes.is_a?(Hash))
60
- fail ArgumentError, "The input argument (attributes) must be a hash in `PulpDebClient::DebReleaseRead` initialize method"
61
- end
62
-
63
- # check to see if the attribute exists and convert string to symbol for hash key
64
- attributes = attributes.each_with_object({}) { |(k, v), h|
65
- if (!self.class.attribute_map.key?(k.to_sym))
66
- fail ArgumentError, "`#{k}` is not a valid attribute in `PulpDebClient::DebReleaseRead`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
- end
68
- h[k.to_sym] = v
69
- }
70
-
71
- if attributes.key?(:'pulp_href')
72
- self.pulp_href = attributes[:'pulp_href']
73
- end
74
-
75
- if attributes.key?(:'pulp_created')
76
- self.pulp_created = attributes[:'pulp_created']
77
- end
78
-
79
- if attributes.key?(:'codename')
80
- self.codename = attributes[:'codename']
81
- end
82
-
83
- if attributes.key?(:'suite')
84
- self.suite = attributes[:'suite']
85
- end
86
-
87
- if attributes.key?(:'distribution')
88
- self.distribution = attributes[:'distribution']
89
- end
90
- end
91
-
92
- # Show invalid properties with the reasons. Usually used together with valid?
93
- # @return Array for valid properties with the reasons
94
- def list_invalid_properties
95
- invalid_properties = Array.new
96
- if @codename.nil?
97
- invalid_properties.push('invalid value for "codename", codename cannot be nil.')
98
- end
99
-
100
- if @codename.to_s.length < 1
101
- invalid_properties.push('invalid value for "codename", the character length must be great than or equal to 1.')
102
- end
103
-
104
- if @suite.nil?
105
- invalid_properties.push('invalid value for "suite", suite cannot be nil.')
106
- end
107
-
108
- if @suite.to_s.length < 1
109
- invalid_properties.push('invalid value for "suite", the character length must be great than or equal to 1.')
110
- end
111
-
112
- if @distribution.nil?
113
- invalid_properties.push('invalid value for "distribution", distribution cannot be nil.')
114
- end
115
-
116
- if @distribution.to_s.length < 1
117
- invalid_properties.push('invalid value for "distribution", the character length must be great than or equal to 1.')
118
- end
119
-
120
- invalid_properties
121
- end
122
-
123
- # Check to see if the all the properties in the model are valid
124
- # @return true if the model is valid
125
- def valid?
126
- return false if @codename.nil?
127
- return false if @codename.to_s.length < 1
128
- return false if @suite.nil?
129
- return false if @suite.to_s.length < 1
130
- return false if @distribution.nil?
131
- return false if @distribution.to_s.length < 1
132
- true
133
- end
134
-
135
- # Custom attribute writer method with validation
136
- # @param [Object] codename Value to be assigned
137
- def codename=(codename)
138
- if codename.nil?
139
- fail ArgumentError, 'codename cannot be nil'
140
- end
141
-
142
- if codename.to_s.length < 1
143
- fail ArgumentError, 'invalid value for "codename", the character length must be great than or equal to 1.'
144
- end
145
-
146
- @codename = codename
147
- end
148
-
149
- # Custom attribute writer method with validation
150
- # @param [Object] suite Value to be assigned
151
- def suite=(suite)
152
- if suite.nil?
153
- fail ArgumentError, 'suite cannot be nil'
154
- end
155
-
156
- if suite.to_s.length < 1
157
- fail ArgumentError, 'invalid value for "suite", the character length must be great than or equal to 1.'
158
- end
159
-
160
- @suite = suite
161
- end
162
-
163
- # Custom attribute writer method with validation
164
- # @param [Object] distribution Value to be assigned
165
- def distribution=(distribution)
166
- if distribution.nil?
167
- fail ArgumentError, 'distribution cannot be nil'
168
- end
169
-
170
- if distribution.to_s.length < 1
171
- fail ArgumentError, 'invalid value for "distribution", the character length must be great than or equal to 1.'
172
- end
173
-
174
- @distribution = distribution
175
- end
176
-
177
- # Checks equality by comparing each attribute.
178
- # @param [Object] Object to be compared
179
- def ==(o)
180
- return true if self.equal?(o)
181
- self.class == o.class &&
182
- pulp_href == o.pulp_href &&
183
- pulp_created == o.pulp_created &&
184
- codename == o.codename &&
185
- suite == o.suite &&
186
- distribution == o.distribution
187
- end
188
-
189
- # @see the `==` method
190
- # @param [Object] Object to be compared
191
- def eql?(o)
192
- self == o
193
- end
194
-
195
- # Calculates hash code according to all attributes.
196
- # @return [Integer] Hash code
197
- def hash
198
- [pulp_href, pulp_created, codename, suite, distribution].hash
199
- end
200
-
201
- # Builds the object from hash
202
- # @param [Hash] attributes Model attributes in the form of hash
203
- # @return [Object] Returns the model itself
204
- def self.build_from_hash(attributes)
205
- new.build_from_hash(attributes)
206
- end
207
-
208
- # Builds the object from hash
209
- # @param [Hash] attributes Model attributes in the form of hash
210
- # @return [Object] Returns the model itself
211
- def build_from_hash(attributes)
212
- return nil unless attributes.is_a?(Hash)
213
- self.class.openapi_types.each_pair do |key, type|
214
- if type =~ /\AArray<(.*)>/i
215
- # check to ensure the input is an array given that the attribute
216
- # is documented as an array but the input is not
217
- if attributes[self.class.attribute_map[key]].is_a?(Array)
218
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
219
- end
220
- elsif !attributes[self.class.attribute_map[key]].nil?
221
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
222
- end # or else data not found in attributes(hash), not an issue as the data can be optional
223
- end
224
-
225
- self
226
- end
227
-
228
- # Deserializes the data based on type
229
- # @param string type Data type
230
- # @param string value Value to be deserialized
231
- # @return [Object] Deserialized data
232
- def _deserialize(type, value)
233
- case type.to_sym
234
- when :DateTime
235
- DateTime.parse(value)
236
- when :Date
237
- Date.parse(value)
238
- when :String
239
- value.to_s
240
- when :Integer
241
- value.to_i
242
- when :Float
243
- value.to_f
244
- when :Boolean
245
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
246
- true
247
- else
248
- false
249
- end
250
- when :Object
251
- # generic object (usually a Hash), return directly
252
- value
253
- when /\AArray<(?<inner_type>.+)>\z/
254
- inner_type = Regexp.last_match[:inner_type]
255
- value.map { |v| _deserialize(inner_type, v) }
256
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
257
- k_type = Regexp.last_match[:k_type]
258
- v_type = Regexp.last_match[:v_type]
259
- {}.tap do |hash|
260
- value.each do |k, v|
261
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
262
- end
263
- end
264
- else # model
265
- PulpDebClient.const_get(type).build_from_hash(value)
266
- end
267
- end
268
-
269
- # Returns the string representation of the object
270
- # @return [String] String presentation of the object
271
- def to_s
272
- to_hash.to_s
273
- end
274
-
275
- # to_body is an alias to to_hash (backward compatibility)
276
- # @return [Hash] Returns the object in the form of hash
277
- def to_body
278
- to_hash
279
- end
280
-
281
- # Returns the object in the form of hash
282
- # @return [Hash] Returns the object in the form of hash
283
- def to_hash
284
- hash = {}
285
- self.class.attribute_map.each_pair do |attr, param|
286
- value = self.send(attr)
287
- if value.nil?
288
- is_nullable = self.class.openapi_nullable.include?(attr)
289
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
290
- end
291
-
292
- hash[param] = _to_hash(value)
293
- end
294
- hash
295
- end
296
-
297
- # Outputs non-array value in the form of hash
298
- # For object, use to_hash. Otherwise, just return the value
299
- # @param [Object] value Any valid value
300
- # @return [Hash] Returns the value in the form of hash
301
- def _to_hash(value)
302
- if value.is_a?(Array)
303
- value.compact.map { |v| _to_hash(v) }
304
- elsif value.is_a?(Hash)
305
- {}.tap do |hash|
306
- value.each { |k, v| hash[k] = _to_hash(v) }
307
- end
308
- elsif value.respond_to? :to_hash
309
- value.to_hash
310
- else
311
- value
312
- end
313
- end
314
- end
315
- end