pulp_deb_client 2.0.0b4 → 2.2.0b1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +31 -11
  3. data/docs/{ContentInstallerFileIndexApi.md → ContentInstallerFileIndicesApi.md} +12 -12
  4. data/docs/{ContentPackageIndexApi.md → ContentPackageIndicesApi.md} +12 -12
  5. data/docs/ContentPackageReleaseComponentsApi.md +194 -0
  6. data/docs/ContentReleaseArchitecturesApi.md +194 -0
  7. data/docs/ContentReleaseComponentsApi.md +194 -0
  8. data/docs/ContentReleaseFilesApi.md +2 -2
  9. data/docs/ContentReleasesApi.md +196 -0
  10. data/docs/DebDebRemote.md +6 -4
  11. data/docs/DebPackageReleaseComponent.md +23 -0
  12. data/docs/DebRelease.md +25 -0
  13. data/docs/DebReleaseArchitecture.md +23 -0
  14. data/docs/DebReleaseComponent.md +23 -0
  15. data/docs/DistributionsAptApi.md +2 -2
  16. data/docs/InlineResponse20010.md +1 -1
  17. data/docs/InlineResponse20011.md +23 -0
  18. data/docs/InlineResponse20012.md +23 -0
  19. data/docs/InlineResponse20013.md +23 -0
  20. data/docs/InlineResponse20014.md +23 -0
  21. data/docs/InlineResponse2004.md +1 -1
  22. data/docs/InlineResponse2005.md +1 -1
  23. data/docs/InlineResponse2006.md +1 -1
  24. data/docs/InlineResponse2007.md +1 -1
  25. data/docs/InlineResponse2008.md +1 -1
  26. data/docs/InlineResponse2009.md +1 -1
  27. data/docs/PublicationsAptApi.md +16 -2
  28. data/docs/PublicationsVerbatimApi.md +16 -2
  29. data/docs/RemotesAptApi.md +2 -2
  30. data/docs/RepositoriesAptApi.md +5 -4
  31. data/docs/RepositoriesDebVersionsApi.md +2 -2
  32. data/lib/pulp_deb_client/api/content_generic_contents_api.rb +1 -1
  33. data/lib/pulp_deb_client/api/{content_installer_file_index_api.rb → content_installer_file_indices_api.rb} +14 -14
  34. data/lib/pulp_deb_client/api/content_installer_packages_api.rb +1 -1
  35. data/lib/pulp_deb_client/api/{content_package_index_api.rb → content_package_indices_api.rb} +14 -14
  36. data/lib/pulp_deb_client/api/content_package_release_components_api.rb +237 -0
  37. data/lib/pulp_deb_client/api/content_packages_api.rb +1 -1
  38. data/lib/pulp_deb_client/api/content_release_architectures_api.rb +237 -0
  39. data/lib/pulp_deb_client/api/content_release_components_api.rb +237 -0
  40. data/lib/pulp_deb_client/api/content_release_files_api.rb +4 -4
  41. data/lib/pulp_deb_client/api/content_releases_api.rb +240 -0
  42. data/lib/pulp_deb_client/api/distributions_apt_api.rb +4 -4
  43. data/lib/pulp_deb_client/api/publications_apt_api.rb +25 -4
  44. data/lib/pulp_deb_client/api/publications_verbatim_api.rb +25 -4
  45. data/lib/pulp_deb_client/api/remotes_apt_api.rb +4 -4
  46. data/lib/pulp_deb_client/api/repositories_apt_api.rb +6 -4
  47. data/lib/pulp_deb_client/api/repositories_deb_versions_api.rb +4 -4
  48. data/lib/pulp_deb_client/api_client.rb +1 -1
  49. data/lib/pulp_deb_client/api_error.rb +1 -1
  50. data/lib/pulp_deb_client/configuration.rb +1 -1
  51. data/lib/pulp_deb_client/models/async_operation_response.rb +1 -1
  52. data/lib/pulp_deb_client/models/content_summary.rb +1 -1
  53. data/lib/pulp_deb_client/models/deb_base_package.rb +1 -1
  54. data/lib/pulp_deb_client/models/deb_deb_distribution.rb +1 -1
  55. data/lib/pulp_deb_client/models/deb_deb_publication.rb +1 -1
  56. data/lib/pulp_deb_client/models/deb_deb_remote.rb +33 -8
  57. data/lib/pulp_deb_client/models/deb_deb_repository.rb +1 -1
  58. data/lib/pulp_deb_client/models/deb_generic_content.rb +1 -1
  59. data/lib/pulp_deb_client/models/deb_installer_file_index.rb +1 -1
  60. data/lib/pulp_deb_client/models/deb_package_index.rb +1 -1
  61. data/lib/pulp_deb_client/models/deb_package_release_component.rb +246 -0
  62. data/lib/pulp_deb_client/models/deb_release.rb +315 -0
  63. data/lib/pulp_deb_client/models/deb_release_architecture.rb +265 -0
  64. data/lib/pulp_deb_client/models/deb_release_component.rb +265 -0
  65. data/lib/pulp_deb_client/models/deb_release_file.rb +1 -1
  66. data/lib/pulp_deb_client/models/deb_verbatim_publication.rb +1 -1
  67. data/lib/pulp_deb_client/models/inline_response200.rb +1 -1
  68. data/lib/pulp_deb_client/models/inline_response2001.rb +1 -1
  69. data/lib/pulp_deb_client/models/inline_response20010.rb +2 -2
  70. data/lib/pulp_deb_client/models/inline_response20011.rb +247 -0
  71. data/lib/pulp_deb_client/models/inline_response20012.rb +247 -0
  72. data/lib/pulp_deb_client/models/inline_response20013.rb +247 -0
  73. data/lib/pulp_deb_client/models/inline_response20014.rb +247 -0
  74. data/lib/pulp_deb_client/models/inline_response2002.rb +1 -1
  75. data/lib/pulp_deb_client/models/inline_response2003.rb +1 -1
  76. data/lib/pulp_deb_client/models/inline_response2004.rb +2 -2
  77. data/lib/pulp_deb_client/models/inline_response2005.rb +2 -2
  78. data/lib/pulp_deb_client/models/inline_response2006.rb +2 -2
  79. data/lib/pulp_deb_client/models/inline_response2007.rb +2 -2
  80. data/lib/pulp_deb_client/models/inline_response2008.rb +2 -2
  81. data/lib/pulp_deb_client/models/inline_response2009.rb +2 -2
  82. data/lib/pulp_deb_client/models/repository_add_remove_content.rb +1 -1
  83. data/lib/pulp_deb_client/models/repository_sync_url.rb +1 -1
  84. data/lib/pulp_deb_client/models/repository_version.rb +1 -1
  85. data/lib/pulp_deb_client/version.rb +2 -2
  86. data/lib/pulp_deb_client.rb +15 -3
  87. data/pulp_deb_client.gemspec +1 -1
  88. data/spec/api/content_generic_contents_api_spec.rb +1 -1
  89. data/spec/api/{content_installer_file_index_api_spec.rb → content_installer_file_indices_api_spec.rb} +8 -8
  90. data/spec/api/content_installer_packages_api_spec.rb +1 -1
  91. data/spec/api/{content_package_index_api_spec.rb → content_package_indices_api_spec.rb} +8 -8
  92. data/spec/api/content_package_release_components_api_spec.rb +81 -0
  93. data/spec/api/content_packages_api_spec.rb +1 -1
  94. data/spec/api/content_release_architectures_api_spec.rb +81 -0
  95. data/spec/api/content_release_components_api_spec.rb +81 -0
  96. data/spec/api/content_release_files_api_spec.rb +2 -2
  97. data/spec/api/content_releases_api_spec.rb +82 -0
  98. data/spec/api/distributions_apt_api_spec.rb +2 -2
  99. data/spec/api/publications_apt_api_spec.rb +9 -2
  100. data/spec/api/publications_verbatim_api_spec.rb +9 -2
  101. data/spec/api/remotes_apt_api_spec.rb +2 -2
  102. data/spec/api/repositories_apt_api_spec.rb +3 -2
  103. data/spec/api/repositories_deb_versions_api_spec.rb +2 -2
  104. data/spec/api_client_spec.rb +1 -1
  105. data/spec/configuration_spec.rb +1 -1
  106. data/spec/models/async_operation_response_spec.rb +1 -1
  107. data/spec/models/content_summary_spec.rb +1 -1
  108. data/spec/models/deb_base_package_spec.rb +1 -1
  109. data/spec/models/deb_deb_distribution_spec.rb +1 -1
  110. data/spec/models/deb_deb_publication_spec.rb +1 -1
  111. data/spec/models/deb_deb_remote_spec.rb +7 -1
  112. data/spec/models/deb_deb_repository_spec.rb +1 -1
  113. data/spec/models/deb_generic_content_spec.rb +1 -1
  114. data/spec/models/deb_installer_file_index_spec.rb +1 -1
  115. data/spec/models/deb_package_index_spec.rb +1 -1
  116. data/spec/models/deb_package_release_component_spec.rb +59 -0
  117. data/spec/models/deb_release_architecture_spec.rb +59 -0
  118. data/spec/models/deb_release_component_spec.rb +59 -0
  119. data/spec/models/deb_release_file_spec.rb +1 -1
  120. data/spec/models/deb_release_spec.rb +65 -0
  121. data/spec/models/deb_verbatim_publication_spec.rb +1 -1
  122. data/spec/models/inline_response20010_spec.rb +1 -1
  123. data/spec/models/inline_response20011_spec.rb +59 -0
  124. data/spec/models/inline_response20012_spec.rb +59 -0
  125. data/spec/models/inline_response20013_spec.rb +59 -0
  126. data/spec/models/inline_response20014_spec.rb +59 -0
  127. data/spec/models/inline_response2001_spec.rb +1 -1
  128. data/spec/models/inline_response2002_spec.rb +1 -1
  129. data/spec/models/inline_response2003_spec.rb +1 -1
  130. data/spec/models/inline_response2004_spec.rb +1 -1
  131. data/spec/models/inline_response2005_spec.rb +1 -1
  132. data/spec/models/inline_response2006_spec.rb +1 -1
  133. data/spec/models/inline_response2007_spec.rb +1 -1
  134. data/spec/models/inline_response2008_spec.rb +1 -1
  135. data/spec/models/inline_response2009_spec.rb +1 -1
  136. data/spec/models/inline_response200_spec.rb +1 -1
  137. data/spec/models/repository_add_remove_content_spec.rb +1 -1
  138. data/spec/models/repository_sync_url_spec.rb +1 -1
  139. data/spec/models/repository_version_spec.rb +1 -1
  140. data/spec/spec_helper.rb +1 -1
  141. metadata +79 -31
@@ -0,0 +1,246 @@
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.2
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpDebClient
16
+ class DebPackageReleaseComponent
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::DebPackageReleaseComponent` 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::DebPackageReleaseComponent`. 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
@@ -0,0 +1,315 @@
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.2
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpDebClient
16
+ class DebRelease
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::DebRelease` 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::DebRelease`. 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