pulpcore_client 3.4.0.dev01590267840 → 3.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +15 -9
  3. data/docs/{Artifact.md → ArtifactRead.md} +2 -2
  4. data/docs/ArtifactsApi.md +4 -4
  5. data/docs/ExportersCoreExportsApi.md +2 -2
  6. data/docs/ExportersPulpApi.md +8 -8
  7. data/docs/{Import.md → ImportRead.md} +2 -2
  8. data/docs/ImportersCoreImportsApi.md +2 -2
  9. data/docs/ImportersPulpApi.md +8 -8
  10. data/docs/InlineResponse200.md +1 -1
  11. data/docs/InlineResponse2001.md +1 -1
  12. data/docs/InlineResponse2002.md +1 -1
  13. data/docs/InlineResponse2003.md +1 -1
  14. data/docs/InlineResponse2004.md +1 -1
  15. data/docs/InlineResponse2005.md +1 -1
  16. data/docs/InlineResponse2006.md +1 -1
  17. data/docs/InlineResponse2007.md +1 -1
  18. data/docs/InlineResponse2008.md +1 -1
  19. data/docs/InlineResponse2009.md +1 -1
  20. data/docs/PulpExport.md +10 -4
  21. data/docs/PulpExportRead.md +27 -0
  22. data/docs/PulpExporterRead.md +27 -0
  23. data/docs/PulpImporterRead.md +23 -0
  24. data/docs/{SigningService.md → SigningServiceRead.md} +2 -2
  25. data/docs/SigningServicesApi.md +2 -2
  26. data/docs/{TaskGroup.md → TaskGroupRead.md} +2 -2
  27. data/docs/TaskGroupsApi.md +2 -2
  28. data/docs/TaskRead.md +43 -0
  29. data/docs/TasksApi.md +2 -2
  30. data/docs/{UploadDetail.md → UploadDetailRead.md} +2 -2
  31. data/docs/UploadRead.md +23 -0
  32. data/docs/UploadsApi.md +4 -4
  33. data/docs/Worker.md +3 -3
  34. data/docs/WorkerRead.md +23 -0
  35. data/docs/WorkersApi.md +2 -2
  36. data/lib/pulpcore_client.rb +11 -5
  37. data/lib/pulpcore_client/api/artifacts_api.rb +6 -6
  38. data/lib/pulpcore_client/api/exporters_core_exports_api.rb +3 -3
  39. data/lib/pulpcore_client/api/exporters_pulp_api.rb +12 -12
  40. data/lib/pulpcore_client/api/importers_core_imports_api.rb +3 -3
  41. data/lib/pulpcore_client/api/importers_pulp_api.rb +12 -12
  42. data/lib/pulpcore_client/api/signing_services_api.rb +3 -3
  43. data/lib/pulpcore_client/api/task_groups_api.rb +3 -3
  44. data/lib/pulpcore_client/api/tasks_api.rb +3 -3
  45. data/lib/pulpcore_client/api/uploads_api.rb +6 -6
  46. data/lib/pulpcore_client/api/workers_api.rb +3 -3
  47. data/lib/pulpcore_client/models/{artifact.rb → artifact_read.rb} +3 -3
  48. data/lib/pulpcore_client/models/{import.rb → import_read.rb} +3 -3
  49. data/lib/pulpcore_client/models/inline_response200.rb +1 -1
  50. data/lib/pulpcore_client/models/inline_response2001.rb +1 -1
  51. data/lib/pulpcore_client/models/inline_response2002.rb +1 -1
  52. data/lib/pulpcore_client/models/inline_response2003.rb +1 -1
  53. data/lib/pulpcore_client/models/inline_response2004.rb +1 -1
  54. data/lib/pulpcore_client/models/inline_response2005.rb +1 -1
  55. data/lib/pulpcore_client/models/inline_response2006.rb +1 -1
  56. data/lib/pulpcore_client/models/inline_response2007.rb +1 -1
  57. data/lib/pulpcore_client/models/inline_response2008.rb +1 -1
  58. data/lib/pulpcore_client/models/inline_response2009.rb +1 -1
  59. data/lib/pulpcore_client/models/pulp_export.rb +59 -38
  60. data/lib/pulpcore_client/models/pulp_export_read.rb +259 -0
  61. data/lib/pulpcore_client/models/pulp_exporter_read.rb +311 -0
  62. data/lib/pulpcore_client/models/pulp_importer_read.rb +262 -0
  63. data/lib/pulpcore_client/models/{signing_service.rb → signing_service_read.rb} +3 -3
  64. data/lib/pulpcore_client/models/{task_group.rb → task_group_read.rb} +3 -3
  65. data/lib/pulpcore_client/models/task_read.rb +383 -0
  66. data/lib/pulpcore_client/models/{upload_detail.rb → upload_detail_read.rb} +3 -3
  67. data/lib/pulpcore_client/models/upload_read.rb +241 -0
  68. data/lib/pulpcore_client/models/worker.rb +10 -10
  69. data/lib/pulpcore_client/models/worker_read.rb +251 -0
  70. data/lib/pulpcore_client/version.rb +1 -1
  71. data/spec/api/artifacts_api_spec.rb +2 -2
  72. data/spec/api/exporters_core_exports_api_spec.rb +1 -1
  73. data/spec/api/exporters_pulp_api_spec.rb +4 -4
  74. data/spec/api/importers_core_imports_api_spec.rb +1 -1
  75. data/spec/api/importers_pulp_api_spec.rb +4 -4
  76. data/spec/api/signing_services_api_spec.rb +1 -1
  77. data/spec/api/task_groups_api_spec.rb +1 -1
  78. data/spec/api/tasks_api_spec.rb +1 -1
  79. data/spec/api/uploads_api_spec.rb +2 -2
  80. data/spec/api/workers_api_spec.rb +1 -1
  81. data/spec/models/{artifact_spec.rb → artifact_read_spec.rb} +6 -6
  82. data/spec/models/{import_spec.rb → import_read_spec.rb} +6 -6
  83. data/spec/models/pulp_export_read_spec.rb +71 -0
  84. data/spec/models/pulp_export_spec.rb +20 -2
  85. data/spec/models/pulp_exporter_read_spec.rb +71 -0
  86. data/spec/models/pulp_importer_read_spec.rb +59 -0
  87. data/spec/models/{signing_service_spec.rb → signing_service_read_spec.rb} +6 -6
  88. data/spec/models/{task_group_spec.rb → task_group_read_spec.rb} +6 -6
  89. data/spec/models/task_read_spec.rb +119 -0
  90. data/spec/models/{upload_detail_spec.rb → upload_detail_read_spec.rb} +6 -6
  91. data/spec/models/upload_read_spec.rb +59 -0
  92. data/spec/models/worker_read_spec.rb +59 -0
  93. data/spec/models/worker_spec.rb +2 -2
  94. metadata +48 -24
@@ -0,0 +1,311 @@
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 PulpcoreClient
16
+ class PulpExporterRead
17
+ attr_accessor :pulp_href
18
+
19
+ # Timestamp of creation.
20
+ attr_accessor :pulp_created
21
+
22
+ # Unique name of the file system exporter.
23
+ attr_accessor :name
24
+
25
+ # File system directory to store exported tar.gzs.
26
+ attr_accessor :path
27
+
28
+ attr_accessor :repositories
29
+
30
+ # Last attempted export for this PulpExporter
31
+ attr_accessor :last_export
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'pulp_href' => :'pulp_href',
37
+ :'pulp_created' => :'pulp_created',
38
+ :'name' => :'name',
39
+ :'path' => :'path',
40
+ :'repositories' => :'repositories',
41
+ :'last_export' => :'last_export'
42
+ }
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'pulp_href' => :'String',
49
+ :'pulp_created' => :'DateTime',
50
+ :'name' => :'String',
51
+ :'path' => :'String',
52
+ :'repositories' => :'Array<String>',
53
+ :'last_export' => :'String'
54
+ }
55
+ end
56
+
57
+ # List of attributes with nullable: true
58
+ def self.openapi_nullable
59
+ Set.new([
60
+ :'last_export'
61
+ ])
62
+ end
63
+
64
+ # Initializes the object
65
+ # @param [Hash] attributes Model attributes in the form of hash
66
+ def initialize(attributes = {})
67
+ if (!attributes.is_a?(Hash))
68
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpcoreClient::PulpExporterRead` initialize method"
69
+ end
70
+
71
+ # check to see if the attribute exists and convert string to symbol for hash key
72
+ attributes = attributes.each_with_object({}) { |(k, v), h|
73
+ if (!self.class.attribute_map.key?(k.to_sym))
74
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpcoreClient::PulpExporterRead`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
75
+ end
76
+ h[k.to_sym] = v
77
+ }
78
+
79
+ if attributes.key?(:'pulp_href')
80
+ self.pulp_href = attributes[:'pulp_href']
81
+ end
82
+
83
+ if attributes.key?(:'pulp_created')
84
+ self.pulp_created = attributes[:'pulp_created']
85
+ end
86
+
87
+ if attributes.key?(:'name')
88
+ self.name = attributes[:'name']
89
+ end
90
+
91
+ if attributes.key?(:'path')
92
+ self.path = attributes[:'path']
93
+ end
94
+
95
+ if attributes.key?(:'repositories')
96
+ if (value = attributes[:'repositories']).is_a?(Array)
97
+ self.repositories = value
98
+ end
99
+ end
100
+
101
+ if attributes.key?(:'last_export')
102
+ self.last_export = attributes[:'last_export']
103
+ end
104
+ end
105
+
106
+ # Show invalid properties with the reasons. Usually used together with valid?
107
+ # @return Array for valid properties with the reasons
108
+ def list_invalid_properties
109
+ invalid_properties = Array.new
110
+ if @name.nil?
111
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
112
+ end
113
+
114
+ if @name.to_s.length < 1
115
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
116
+ end
117
+
118
+ if @path.nil?
119
+ invalid_properties.push('invalid value for "path", path cannot be nil.')
120
+ end
121
+
122
+ if @path.to_s.length < 1
123
+ invalid_properties.push('invalid value for "path", the character length must be great than or equal to 1.')
124
+ end
125
+
126
+ if @repositories.nil?
127
+ invalid_properties.push('invalid value for "repositories", repositories cannot be nil.')
128
+ end
129
+
130
+ invalid_properties
131
+ end
132
+
133
+ # Check to see if the all the properties in the model are valid
134
+ # @return true if the model is valid
135
+ def valid?
136
+ return false if @name.nil?
137
+ return false if @name.to_s.length < 1
138
+ return false if @path.nil?
139
+ return false if @path.to_s.length < 1
140
+ return false if @repositories.nil?
141
+ true
142
+ end
143
+
144
+ # Custom attribute writer method with validation
145
+ # @param [Object] name Value to be assigned
146
+ def name=(name)
147
+ if name.nil?
148
+ fail ArgumentError, 'name cannot be nil'
149
+ end
150
+
151
+ if name.to_s.length < 1
152
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
153
+ end
154
+
155
+ @name = name
156
+ end
157
+
158
+ # Custom attribute writer method with validation
159
+ # @param [Object] path Value to be assigned
160
+ def path=(path)
161
+ if path.nil?
162
+ fail ArgumentError, 'path cannot be nil'
163
+ end
164
+
165
+ if path.to_s.length < 1
166
+ fail ArgumentError, 'invalid value for "path", the character length must be great than or equal to 1.'
167
+ end
168
+
169
+ @path = path
170
+ end
171
+
172
+ # Checks equality by comparing each attribute.
173
+ # @param [Object] Object to be compared
174
+ def ==(o)
175
+ return true if self.equal?(o)
176
+ self.class == o.class &&
177
+ pulp_href == o.pulp_href &&
178
+ pulp_created == o.pulp_created &&
179
+ name == o.name &&
180
+ path == o.path &&
181
+ repositories == o.repositories &&
182
+ last_export == o.last_export
183
+ end
184
+
185
+ # @see the `==` method
186
+ # @param [Object] Object to be compared
187
+ def eql?(o)
188
+ self == o
189
+ end
190
+
191
+ # Calculates hash code according to all attributes.
192
+ # @return [Integer] Hash code
193
+ def hash
194
+ [pulp_href, pulp_created, name, path, repositories, last_export].hash
195
+ end
196
+
197
+ # Builds the object from hash
198
+ # @param [Hash] attributes Model attributes in the form of hash
199
+ # @return [Object] Returns the model itself
200
+ def self.build_from_hash(attributes)
201
+ new.build_from_hash(attributes)
202
+ end
203
+
204
+ # Builds the object from hash
205
+ # @param [Hash] attributes Model attributes in the form of hash
206
+ # @return [Object] Returns the model itself
207
+ def build_from_hash(attributes)
208
+ return nil unless attributes.is_a?(Hash)
209
+ self.class.openapi_types.each_pair do |key, type|
210
+ if type =~ /\AArray<(.*)>/i
211
+ # check to ensure the input is an array given that the attribute
212
+ # is documented as an array but the input is not
213
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
214
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
215
+ end
216
+ elsif !attributes[self.class.attribute_map[key]].nil?
217
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
218
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
219
+ end
220
+
221
+ self
222
+ end
223
+
224
+ # Deserializes the data based on type
225
+ # @param string type Data type
226
+ # @param string value Value to be deserialized
227
+ # @return [Object] Deserialized data
228
+ def _deserialize(type, value)
229
+ case type.to_sym
230
+ when :DateTime
231
+ DateTime.parse(value)
232
+ when :Date
233
+ Date.parse(value)
234
+ when :String
235
+ value.to_s
236
+ when :Integer
237
+ value.to_i
238
+ when :Float
239
+ value.to_f
240
+ when :Boolean
241
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
242
+ true
243
+ else
244
+ false
245
+ end
246
+ when :Object
247
+ # generic object (usually a Hash), return directly
248
+ value
249
+ when /\AArray<(?<inner_type>.+)>\z/
250
+ inner_type = Regexp.last_match[:inner_type]
251
+ value.map { |v| _deserialize(inner_type, v) }
252
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
253
+ k_type = Regexp.last_match[:k_type]
254
+ v_type = Regexp.last_match[:v_type]
255
+ {}.tap do |hash|
256
+ value.each do |k, v|
257
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
258
+ end
259
+ end
260
+ else # model
261
+ PulpcoreClient.const_get(type).build_from_hash(value)
262
+ end
263
+ end
264
+
265
+ # Returns the string representation of the object
266
+ # @return [String] String presentation of the object
267
+ def to_s
268
+ to_hash.to_s
269
+ end
270
+
271
+ # to_body is an alias to to_hash (backward compatibility)
272
+ # @return [Hash] Returns the object in the form of hash
273
+ def to_body
274
+ to_hash
275
+ end
276
+
277
+ # Returns the object in the form of hash
278
+ # @return [Hash] Returns the object in the form of hash
279
+ def to_hash
280
+ hash = {}
281
+ self.class.attribute_map.each_pair do |attr, param|
282
+ value = self.send(attr)
283
+ if value.nil?
284
+ is_nullable = self.class.openapi_nullable.include?(attr)
285
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
286
+ end
287
+
288
+ hash[param] = _to_hash(value)
289
+ end
290
+ hash
291
+ end
292
+
293
+ # Outputs non-array value in the form of hash
294
+ # For object, use to_hash. Otherwise, just return the value
295
+ # @param [Object] value Any valid value
296
+ # @return [Hash] Returns the value in the form of hash
297
+ def _to_hash(value)
298
+ if value.is_a?(Array)
299
+ value.compact.map { |v| _to_hash(v) }
300
+ elsif value.is_a?(Hash)
301
+ {}.tap do |hash|
302
+ value.each { |k, v| hash[k] = _to_hash(v) }
303
+ end
304
+ elsif value.respond_to? :to_hash
305
+ value.to_hash
306
+ else
307
+ value
308
+ end
309
+ end
310
+ end
311
+ end
@@ -0,0 +1,262 @@
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 PulpcoreClient
16
+ class PulpImporterRead
17
+ attr_accessor :pulp_href
18
+
19
+ # Timestamp of creation.
20
+ attr_accessor :pulp_created
21
+
22
+ # Unique name of the Importer.
23
+ attr_accessor :name
24
+
25
+ # Mapping of repo names in an export file to the repo names in Pulp. For example, if the export has a repo named 'foo' and the repo to import content into was 'bar', the mapping would be \"{'foo': 'bar'}\".
26
+ attr_accessor :repo_mapping
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
+ :'name' => :'name',
34
+ :'repo_mapping' => :'repo_mapping'
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'pulp_href' => :'String',
42
+ :'pulp_created' => :'DateTime',
43
+ :'name' => :'String',
44
+ :'repo_mapping' => :'Hash<String, 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 `PulpcoreClient::PulpImporterRead` 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 `PulpcoreClient::PulpImporterRead`. 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?(:'name')
78
+ self.name = attributes[:'name']
79
+ end
80
+
81
+ if attributes.key?(:'repo_mapping')
82
+ if (value = attributes[:'repo_mapping']).is_a?(Hash)
83
+ self.repo_mapping = value
84
+ end
85
+ end
86
+ end
87
+
88
+ # Show invalid properties with the reasons. Usually used together with valid?
89
+ # @return Array for valid properties with the reasons
90
+ def list_invalid_properties
91
+ invalid_properties = Array.new
92
+ if @name.nil?
93
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
94
+ end
95
+
96
+ if @name.to_s.length < 1
97
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
98
+ end
99
+
100
+ invalid_properties
101
+ end
102
+
103
+ # Check to see if the all the properties in the model are valid
104
+ # @return true if the model is valid
105
+ def valid?
106
+ return false if @name.nil?
107
+ return false if @name.to_s.length < 1
108
+ true
109
+ end
110
+
111
+ # Custom attribute writer method with validation
112
+ # @param [Object] name Value to be assigned
113
+ def name=(name)
114
+ if name.nil?
115
+ fail ArgumentError, 'name cannot be nil'
116
+ end
117
+
118
+ if name.to_s.length < 1
119
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
120
+ end
121
+
122
+ @name = name
123
+ end
124
+
125
+ # Checks equality by comparing each attribute.
126
+ # @param [Object] Object to be compared
127
+ def ==(o)
128
+ return true if self.equal?(o)
129
+ self.class == o.class &&
130
+ pulp_href == o.pulp_href &&
131
+ pulp_created == o.pulp_created &&
132
+ name == o.name &&
133
+ repo_mapping == o.repo_mapping
134
+ end
135
+
136
+ # @see the `==` method
137
+ # @param [Object] Object to be compared
138
+ def eql?(o)
139
+ self == o
140
+ end
141
+
142
+ # Calculates hash code according to all attributes.
143
+ # @return [Integer] Hash code
144
+ def hash
145
+ [pulp_href, pulp_created, name, repo_mapping].hash
146
+ end
147
+
148
+ # Builds the object from hash
149
+ # @param [Hash] attributes Model attributes in the form of hash
150
+ # @return [Object] Returns the model itself
151
+ def self.build_from_hash(attributes)
152
+ new.build_from_hash(attributes)
153
+ end
154
+
155
+ # Builds the object from hash
156
+ # @param [Hash] attributes Model attributes in the form of hash
157
+ # @return [Object] Returns the model itself
158
+ def build_from_hash(attributes)
159
+ return nil unless attributes.is_a?(Hash)
160
+ self.class.openapi_types.each_pair do |key, type|
161
+ if type =~ /\AArray<(.*)>/i
162
+ # check to ensure the input is an array given that the attribute
163
+ # is documented as an array but the input is not
164
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
165
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
166
+ end
167
+ elsif !attributes[self.class.attribute_map[key]].nil?
168
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
169
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
170
+ end
171
+
172
+ self
173
+ end
174
+
175
+ # Deserializes the data based on type
176
+ # @param string type Data type
177
+ # @param string value Value to be deserialized
178
+ # @return [Object] Deserialized data
179
+ def _deserialize(type, value)
180
+ case type.to_sym
181
+ when :DateTime
182
+ DateTime.parse(value)
183
+ when :Date
184
+ Date.parse(value)
185
+ when :String
186
+ value.to_s
187
+ when :Integer
188
+ value.to_i
189
+ when :Float
190
+ value.to_f
191
+ when :Boolean
192
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
193
+ true
194
+ else
195
+ false
196
+ end
197
+ when :Object
198
+ # generic object (usually a Hash), return directly
199
+ value
200
+ when /\AArray<(?<inner_type>.+)>\z/
201
+ inner_type = Regexp.last_match[:inner_type]
202
+ value.map { |v| _deserialize(inner_type, v) }
203
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
204
+ k_type = Regexp.last_match[:k_type]
205
+ v_type = Regexp.last_match[:v_type]
206
+ {}.tap do |hash|
207
+ value.each do |k, v|
208
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
209
+ end
210
+ end
211
+ else # model
212
+ PulpcoreClient.const_get(type).build_from_hash(value)
213
+ end
214
+ end
215
+
216
+ # Returns the string representation of the object
217
+ # @return [String] String presentation of the object
218
+ def to_s
219
+ to_hash.to_s
220
+ end
221
+
222
+ # to_body is an alias to to_hash (backward compatibility)
223
+ # @return [Hash] Returns the object in the form of hash
224
+ def to_body
225
+ to_hash
226
+ end
227
+
228
+ # Returns the object in the form of hash
229
+ # @return [Hash] Returns the object in the form of hash
230
+ def to_hash
231
+ hash = {}
232
+ self.class.attribute_map.each_pair do |attr, param|
233
+ value = self.send(attr)
234
+ if value.nil?
235
+ is_nullable = self.class.openapi_nullable.include?(attr)
236
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
237
+ end
238
+
239
+ hash[param] = _to_hash(value)
240
+ end
241
+ hash
242
+ end
243
+
244
+ # Outputs non-array value in the form of hash
245
+ # For object, use to_hash. Otherwise, just return the value
246
+ # @param [Object] value Any valid value
247
+ # @return [Hash] Returns the value in the form of hash
248
+ def _to_hash(value)
249
+ if value.is_a?(Array)
250
+ value.compact.map { |v| _to_hash(v) }
251
+ elsif value.is_a?(Hash)
252
+ {}.tap do |hash|
253
+ value.each { |k, v| hash[k] = _to_hash(v) }
254
+ end
255
+ elsif value.respond_to? :to_hash
256
+ value.to_hash
257
+ else
258
+ value
259
+ end
260
+ end
261
+ end
262
+ end