pulp_deb_client 3.0.0 → 3.1.1

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