pulp_deb_client 3.0.1 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +24 -6
- data/docs/ContentGenericContentsApi.md +4 -4
- data/docs/ContentInstallerPackagesApi.md +4 -4
- data/docs/ContentPackagesApi.md +20 -4
- data/docs/ContentSourceIndicesApi.md +204 -0
- data/docs/ContentSourcePackagesApi.md +258 -0
- data/docs/ContentSourceReleaseComponentsApi.md +202 -0
- data/docs/DebGenericContent.md +2 -2
- data/docs/DebInstallerPackage.md +2 -2
- data/docs/DebPackage.md +2 -2
- data/docs/DebSourceIndex.md +25 -0
- data/docs/DebSourceIndexResponse.md +27 -0
- data/docs/DebSourcePackage.md +21 -0
- data/docs/DebSourcePackageReleaseComponent.md +21 -0
- data/docs/DebSourcePackageReleaseComponentResponse.md +23 -0
- data/docs/DebSourcePackageResponse.md +77 -0
- data/docs/PaginateddebSourceIndexResponseList.md +23 -0
- data/docs/PaginateddebSourcePackageReleaseComponentResponseList.md +23 -0
- data/docs/PaginateddebSourcePackageResponseList.md +23 -0
- data/lib/pulp_deb_client/api/content_generic_contents_api.rb +4 -4
- data/lib/pulp_deb_client/api/content_installer_packages_api.rb +4 -4
- data/lib/pulp_deb_client/api/content_packages_api.rb +28 -4
- data/lib/pulp_deb_client/api/content_source_indices_api.rb +256 -0
- data/lib/pulp_deb_client/api/content_source_packages_api.rb +337 -0
- data/lib/pulp_deb_client/api/content_source_release_components_api.rb +253 -0
- data/lib/pulp_deb_client/models/deb_generic_content.rb +2 -2
- data/lib/pulp_deb_client/models/deb_installer_package.rb +2 -2
- data/lib/pulp_deb_client/models/deb_package.rb +2 -2
- data/lib/pulp_deb_client/models/deb_source_index.rb +297 -0
- data/lib/pulp_deb_client/models/deb_source_index_response.rb +272 -0
- data/lib/pulp_deb_client/models/deb_source_package.rb +248 -0
- data/lib/pulp_deb_client/models/deb_source_package_release_component.rb +238 -0
- data/lib/pulp_deb_client/models/deb_source_package_release_component_response.rb +247 -0
- data/lib/pulp_deb_client/models/deb_source_package_response.rb +485 -0
- data/lib/pulp_deb_client/models/paginateddeb_source_index_response_list.rb +237 -0
- data/lib/pulp_deb_client/models/paginateddeb_source_package_release_component_response_list.rb +237 -0
- data/lib/pulp_deb_client/models/paginateddeb_source_package_response_list.rb +237 -0
- data/lib/pulp_deb_client/version.rb +1 -1
- data/lib/pulp_deb_client.rb +12 -0
- data/spec/api/content_generic_contents_api_spec.rb +2 -2
- data/spec/api/content_installer_packages_api_spec.rb +2 -2
- data/spec/api/content_packages_api_spec.rb +10 -2
- data/spec/api/content_source_indices_api_spec.rb +86 -0
- data/spec/api/content_source_packages_api_spec.rb +113 -0
- data/spec/api/content_source_release_components_api_spec.rb +85 -0
- data/spec/models/deb_source_index_response_spec.rb +71 -0
- data/spec/models/deb_source_index_spec.rb +65 -0
- data/spec/models/deb_source_package_release_component_response_spec.rb +59 -0
- data/spec/models/deb_source_package_release_component_spec.rb +53 -0
- data/spec/models/deb_source_package_response_spec.rb +221 -0
- data/spec/models/deb_source_package_spec.rb +53 -0
- data/spec/models/paginateddeb_source_index_response_list_spec.rb +59 -0
- data/spec/models/paginateddeb_source_package_release_component_response_list_spec.rb +59 -0
- data/spec/models/paginateddeb_source_package_response_list_spec.rb +59 -0
- metadata +110 -62
@@ -0,0 +1,485 @@
|
|
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 DebSourcePackageResponse
|
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
|
+
# Relative path of the Debian Source Control (dsc) file.It is normally advised to let Pulp generate this.
|
27
|
+
attr_accessor :relative_path
|
28
|
+
|
29
|
+
attr_accessor :format
|
30
|
+
|
31
|
+
attr_accessor :source
|
32
|
+
|
33
|
+
attr_accessor :binary
|
34
|
+
|
35
|
+
attr_accessor :architecture
|
36
|
+
|
37
|
+
attr_accessor :version
|
38
|
+
|
39
|
+
attr_accessor :maintainer
|
40
|
+
|
41
|
+
attr_accessor :uploaders
|
42
|
+
|
43
|
+
attr_accessor :homepage
|
44
|
+
|
45
|
+
attr_accessor :vcs_browser
|
46
|
+
|
47
|
+
attr_accessor :vcs_arch
|
48
|
+
|
49
|
+
attr_accessor :vcs_bzr
|
50
|
+
|
51
|
+
attr_accessor :vcs_cvs
|
52
|
+
|
53
|
+
attr_accessor :vcs_darcs
|
54
|
+
|
55
|
+
attr_accessor :vcs_git
|
56
|
+
|
57
|
+
attr_accessor :vcs_hg
|
58
|
+
|
59
|
+
attr_accessor :vcs_mtn
|
60
|
+
|
61
|
+
attr_accessor :vcs_snv
|
62
|
+
|
63
|
+
attr_accessor :testsuite
|
64
|
+
|
65
|
+
attr_accessor :dgit
|
66
|
+
|
67
|
+
attr_accessor :standards_version
|
68
|
+
|
69
|
+
attr_accessor :build_depends
|
70
|
+
|
71
|
+
attr_accessor :build_depends_indep
|
72
|
+
|
73
|
+
attr_accessor :build_depends_arch
|
74
|
+
|
75
|
+
attr_accessor :build_conflicts
|
76
|
+
|
77
|
+
attr_accessor :build_conflicts_indep
|
78
|
+
|
79
|
+
attr_accessor :build_conflicts_arch
|
80
|
+
|
81
|
+
attr_accessor :package_list
|
82
|
+
|
83
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
84
|
+
def self.attribute_map
|
85
|
+
{
|
86
|
+
:'pulp_href' => :'pulp_href',
|
87
|
+
:'pulp_created' => :'pulp_created',
|
88
|
+
:'artifacts' => :'artifacts',
|
89
|
+
:'relative_path' => :'relative_path',
|
90
|
+
:'format' => :'format',
|
91
|
+
:'source' => :'source',
|
92
|
+
:'binary' => :'binary',
|
93
|
+
:'architecture' => :'architecture',
|
94
|
+
:'version' => :'version',
|
95
|
+
:'maintainer' => :'maintainer',
|
96
|
+
:'uploaders' => :'uploaders',
|
97
|
+
:'homepage' => :'homepage',
|
98
|
+
:'vcs_browser' => :'vcs_browser',
|
99
|
+
:'vcs_arch' => :'vcs_arch',
|
100
|
+
:'vcs_bzr' => :'vcs_bzr',
|
101
|
+
:'vcs_cvs' => :'vcs_cvs',
|
102
|
+
:'vcs_darcs' => :'vcs_darcs',
|
103
|
+
:'vcs_git' => :'vcs_git',
|
104
|
+
:'vcs_hg' => :'vcs_hg',
|
105
|
+
:'vcs_mtn' => :'vcs_mtn',
|
106
|
+
:'vcs_snv' => :'vcs_snv',
|
107
|
+
:'testsuite' => :'testsuite',
|
108
|
+
:'dgit' => :'dgit',
|
109
|
+
:'standards_version' => :'standards_version',
|
110
|
+
:'build_depends' => :'build_depends',
|
111
|
+
:'build_depends_indep' => :'build_depends_indep',
|
112
|
+
:'build_depends_arch' => :'build_depends_arch',
|
113
|
+
:'build_conflicts' => :'build_conflicts',
|
114
|
+
:'build_conflicts_indep' => :'build_conflicts_indep',
|
115
|
+
:'build_conflicts_arch' => :'build_conflicts_arch',
|
116
|
+
:'package_list' => :'package_list'
|
117
|
+
}
|
118
|
+
end
|
119
|
+
|
120
|
+
# Attribute type mapping.
|
121
|
+
def self.openapi_types
|
122
|
+
{
|
123
|
+
:'pulp_href' => :'String',
|
124
|
+
:'pulp_created' => :'DateTime',
|
125
|
+
:'artifacts' => :'Object',
|
126
|
+
:'relative_path' => :'String',
|
127
|
+
:'format' => :'String',
|
128
|
+
:'source' => :'String',
|
129
|
+
:'binary' => :'String',
|
130
|
+
:'architecture' => :'String',
|
131
|
+
:'version' => :'String',
|
132
|
+
:'maintainer' => :'String',
|
133
|
+
:'uploaders' => :'String',
|
134
|
+
:'homepage' => :'String',
|
135
|
+
:'vcs_browser' => :'String',
|
136
|
+
:'vcs_arch' => :'String',
|
137
|
+
:'vcs_bzr' => :'String',
|
138
|
+
:'vcs_cvs' => :'String',
|
139
|
+
:'vcs_darcs' => :'String',
|
140
|
+
:'vcs_git' => :'String',
|
141
|
+
:'vcs_hg' => :'String',
|
142
|
+
:'vcs_mtn' => :'String',
|
143
|
+
:'vcs_snv' => :'String',
|
144
|
+
:'testsuite' => :'String',
|
145
|
+
:'dgit' => :'String',
|
146
|
+
:'standards_version' => :'String',
|
147
|
+
:'build_depends' => :'String',
|
148
|
+
:'build_depends_indep' => :'String',
|
149
|
+
:'build_depends_arch' => :'String',
|
150
|
+
:'build_conflicts' => :'String',
|
151
|
+
:'build_conflicts_indep' => :'String',
|
152
|
+
:'build_conflicts_arch' => :'String',
|
153
|
+
:'package_list' => :'String'
|
154
|
+
}
|
155
|
+
end
|
156
|
+
|
157
|
+
# List of attributes with nullable: true
|
158
|
+
def self.openapi_nullable
|
159
|
+
Set.new([
|
160
|
+
])
|
161
|
+
end
|
162
|
+
|
163
|
+
# Initializes the object
|
164
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
165
|
+
def initialize(attributes = {})
|
166
|
+
if (!attributes.is_a?(Hash))
|
167
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpDebClient::DebSourcePackageResponse` initialize method"
|
168
|
+
end
|
169
|
+
|
170
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
171
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
172
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
173
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpDebClient::DebSourcePackageResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
174
|
+
end
|
175
|
+
h[k.to_sym] = v
|
176
|
+
}
|
177
|
+
|
178
|
+
if attributes.key?(:'pulp_href')
|
179
|
+
self.pulp_href = attributes[:'pulp_href']
|
180
|
+
end
|
181
|
+
|
182
|
+
if attributes.key?(:'pulp_created')
|
183
|
+
self.pulp_created = attributes[:'pulp_created']
|
184
|
+
end
|
185
|
+
|
186
|
+
if attributes.key?(:'artifacts')
|
187
|
+
self.artifacts = attributes[:'artifacts']
|
188
|
+
end
|
189
|
+
|
190
|
+
if attributes.key?(:'relative_path')
|
191
|
+
self.relative_path = attributes[:'relative_path']
|
192
|
+
end
|
193
|
+
|
194
|
+
if attributes.key?(:'format')
|
195
|
+
self.format = attributes[:'format']
|
196
|
+
end
|
197
|
+
|
198
|
+
if attributes.key?(:'source')
|
199
|
+
self.source = attributes[:'source']
|
200
|
+
end
|
201
|
+
|
202
|
+
if attributes.key?(:'binary')
|
203
|
+
self.binary = attributes[:'binary']
|
204
|
+
end
|
205
|
+
|
206
|
+
if attributes.key?(:'architecture')
|
207
|
+
self.architecture = attributes[:'architecture']
|
208
|
+
end
|
209
|
+
|
210
|
+
if attributes.key?(:'version')
|
211
|
+
self.version = attributes[:'version']
|
212
|
+
end
|
213
|
+
|
214
|
+
if attributes.key?(:'maintainer')
|
215
|
+
self.maintainer = attributes[:'maintainer']
|
216
|
+
end
|
217
|
+
|
218
|
+
if attributes.key?(:'uploaders')
|
219
|
+
self.uploaders = attributes[:'uploaders']
|
220
|
+
end
|
221
|
+
|
222
|
+
if attributes.key?(:'homepage')
|
223
|
+
self.homepage = attributes[:'homepage']
|
224
|
+
end
|
225
|
+
|
226
|
+
if attributes.key?(:'vcs_browser')
|
227
|
+
self.vcs_browser = attributes[:'vcs_browser']
|
228
|
+
end
|
229
|
+
|
230
|
+
if attributes.key?(:'vcs_arch')
|
231
|
+
self.vcs_arch = attributes[:'vcs_arch']
|
232
|
+
end
|
233
|
+
|
234
|
+
if attributes.key?(:'vcs_bzr')
|
235
|
+
self.vcs_bzr = attributes[:'vcs_bzr']
|
236
|
+
end
|
237
|
+
|
238
|
+
if attributes.key?(:'vcs_cvs')
|
239
|
+
self.vcs_cvs = attributes[:'vcs_cvs']
|
240
|
+
end
|
241
|
+
|
242
|
+
if attributes.key?(:'vcs_darcs')
|
243
|
+
self.vcs_darcs = attributes[:'vcs_darcs']
|
244
|
+
end
|
245
|
+
|
246
|
+
if attributes.key?(:'vcs_git')
|
247
|
+
self.vcs_git = attributes[:'vcs_git']
|
248
|
+
end
|
249
|
+
|
250
|
+
if attributes.key?(:'vcs_hg')
|
251
|
+
self.vcs_hg = attributes[:'vcs_hg']
|
252
|
+
end
|
253
|
+
|
254
|
+
if attributes.key?(:'vcs_mtn')
|
255
|
+
self.vcs_mtn = attributes[:'vcs_mtn']
|
256
|
+
end
|
257
|
+
|
258
|
+
if attributes.key?(:'vcs_snv')
|
259
|
+
self.vcs_snv = attributes[:'vcs_snv']
|
260
|
+
end
|
261
|
+
|
262
|
+
if attributes.key?(:'testsuite')
|
263
|
+
self.testsuite = attributes[:'testsuite']
|
264
|
+
end
|
265
|
+
|
266
|
+
if attributes.key?(:'dgit')
|
267
|
+
self.dgit = attributes[:'dgit']
|
268
|
+
end
|
269
|
+
|
270
|
+
if attributes.key?(:'standards_version')
|
271
|
+
self.standards_version = attributes[:'standards_version']
|
272
|
+
end
|
273
|
+
|
274
|
+
if attributes.key?(:'build_depends')
|
275
|
+
self.build_depends = attributes[:'build_depends']
|
276
|
+
end
|
277
|
+
|
278
|
+
if attributes.key?(:'build_depends_indep')
|
279
|
+
self.build_depends_indep = attributes[:'build_depends_indep']
|
280
|
+
end
|
281
|
+
|
282
|
+
if attributes.key?(:'build_depends_arch')
|
283
|
+
self.build_depends_arch = attributes[:'build_depends_arch']
|
284
|
+
end
|
285
|
+
|
286
|
+
if attributes.key?(:'build_conflicts')
|
287
|
+
self.build_conflicts = attributes[:'build_conflicts']
|
288
|
+
end
|
289
|
+
|
290
|
+
if attributes.key?(:'build_conflicts_indep')
|
291
|
+
self.build_conflicts_indep = attributes[:'build_conflicts_indep']
|
292
|
+
end
|
293
|
+
|
294
|
+
if attributes.key?(:'build_conflicts_arch')
|
295
|
+
self.build_conflicts_arch = attributes[:'build_conflicts_arch']
|
296
|
+
end
|
297
|
+
|
298
|
+
if attributes.key?(:'package_list')
|
299
|
+
self.package_list = attributes[:'package_list']
|
300
|
+
end
|
301
|
+
end
|
302
|
+
|
303
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
304
|
+
# @return Array for valid properties with the reasons
|
305
|
+
def list_invalid_properties
|
306
|
+
invalid_properties = Array.new
|
307
|
+
if @artifacts.nil?
|
308
|
+
invalid_properties.push('invalid value for "artifacts", artifacts cannot be nil.')
|
309
|
+
end
|
310
|
+
|
311
|
+
invalid_properties
|
312
|
+
end
|
313
|
+
|
314
|
+
# Check to see if the all the properties in the model are valid
|
315
|
+
# @return true if the model is valid
|
316
|
+
def valid?
|
317
|
+
return false if @artifacts.nil?
|
318
|
+
true
|
319
|
+
end
|
320
|
+
|
321
|
+
# Checks equality by comparing each attribute.
|
322
|
+
# @param [Object] Object to be compared
|
323
|
+
def ==(o)
|
324
|
+
return true if self.equal?(o)
|
325
|
+
self.class == o.class &&
|
326
|
+
pulp_href == o.pulp_href &&
|
327
|
+
pulp_created == o.pulp_created &&
|
328
|
+
artifacts == o.artifacts &&
|
329
|
+
relative_path == o.relative_path &&
|
330
|
+
format == o.format &&
|
331
|
+
source == o.source &&
|
332
|
+
binary == o.binary &&
|
333
|
+
architecture == o.architecture &&
|
334
|
+
version == o.version &&
|
335
|
+
maintainer == o.maintainer &&
|
336
|
+
uploaders == o.uploaders &&
|
337
|
+
homepage == o.homepage &&
|
338
|
+
vcs_browser == o.vcs_browser &&
|
339
|
+
vcs_arch == o.vcs_arch &&
|
340
|
+
vcs_bzr == o.vcs_bzr &&
|
341
|
+
vcs_cvs == o.vcs_cvs &&
|
342
|
+
vcs_darcs == o.vcs_darcs &&
|
343
|
+
vcs_git == o.vcs_git &&
|
344
|
+
vcs_hg == o.vcs_hg &&
|
345
|
+
vcs_mtn == o.vcs_mtn &&
|
346
|
+
vcs_snv == o.vcs_snv &&
|
347
|
+
testsuite == o.testsuite &&
|
348
|
+
dgit == o.dgit &&
|
349
|
+
standards_version == o.standards_version &&
|
350
|
+
build_depends == o.build_depends &&
|
351
|
+
build_depends_indep == o.build_depends_indep &&
|
352
|
+
build_depends_arch == o.build_depends_arch &&
|
353
|
+
build_conflicts == o.build_conflicts &&
|
354
|
+
build_conflicts_indep == o.build_conflicts_indep &&
|
355
|
+
build_conflicts_arch == o.build_conflicts_arch &&
|
356
|
+
package_list == o.package_list
|
357
|
+
end
|
358
|
+
|
359
|
+
# @see the `==` method
|
360
|
+
# @param [Object] Object to be compared
|
361
|
+
def eql?(o)
|
362
|
+
self == o
|
363
|
+
end
|
364
|
+
|
365
|
+
# Calculates hash code according to all attributes.
|
366
|
+
# @return [Integer] Hash code
|
367
|
+
def hash
|
368
|
+
[pulp_href, pulp_created, artifacts, relative_path, format, source, binary, architecture, version, maintainer, uploaders, homepage, vcs_browser, vcs_arch, vcs_bzr, vcs_cvs, vcs_darcs, vcs_git, vcs_hg, vcs_mtn, vcs_snv, testsuite, dgit, standards_version, build_depends, build_depends_indep, build_depends_arch, build_conflicts, build_conflicts_indep, build_conflicts_arch, package_list].hash
|
369
|
+
end
|
370
|
+
|
371
|
+
# Builds the object from hash
|
372
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
373
|
+
# @return [Object] Returns the model itself
|
374
|
+
def self.build_from_hash(attributes)
|
375
|
+
new.build_from_hash(attributes)
|
376
|
+
end
|
377
|
+
|
378
|
+
# Builds the object from hash
|
379
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
380
|
+
# @return [Object] Returns the model itself
|
381
|
+
def build_from_hash(attributes)
|
382
|
+
return nil unless attributes.is_a?(Hash)
|
383
|
+
self.class.openapi_types.each_pair do |key, type|
|
384
|
+
if type =~ /\AArray<(.*)>/i
|
385
|
+
# check to ensure the input is an array given that the attribute
|
386
|
+
# is documented as an array but the input is not
|
387
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
388
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
389
|
+
end
|
390
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
391
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
392
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
393
|
+
end
|
394
|
+
|
395
|
+
self
|
396
|
+
end
|
397
|
+
|
398
|
+
# Deserializes the data based on type
|
399
|
+
# @param string type Data type
|
400
|
+
# @param string value Value to be deserialized
|
401
|
+
# @return [Object] Deserialized data
|
402
|
+
def _deserialize(type, value)
|
403
|
+
case type.to_sym
|
404
|
+
when :DateTime
|
405
|
+
DateTime.parse(value)
|
406
|
+
when :Date
|
407
|
+
Date.parse(value)
|
408
|
+
when :String
|
409
|
+
value.to_s
|
410
|
+
when :Integer
|
411
|
+
value.to_i
|
412
|
+
when :Float
|
413
|
+
value.to_f
|
414
|
+
when :Boolean
|
415
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
416
|
+
true
|
417
|
+
else
|
418
|
+
false
|
419
|
+
end
|
420
|
+
when :Object
|
421
|
+
# generic object (usually a Hash), return directly
|
422
|
+
value
|
423
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
424
|
+
inner_type = Regexp.last_match[:inner_type]
|
425
|
+
value.map { |v| _deserialize(inner_type, v) }
|
426
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
427
|
+
k_type = Regexp.last_match[:k_type]
|
428
|
+
v_type = Regexp.last_match[:v_type]
|
429
|
+
{}.tap do |hash|
|
430
|
+
value.each do |k, v|
|
431
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
432
|
+
end
|
433
|
+
end
|
434
|
+
else # model
|
435
|
+
PulpDebClient.const_get(type).build_from_hash(value)
|
436
|
+
end
|
437
|
+
end
|
438
|
+
|
439
|
+
# Returns the string representation of the object
|
440
|
+
# @return [String] String presentation of the object
|
441
|
+
def to_s
|
442
|
+
to_hash.to_s
|
443
|
+
end
|
444
|
+
|
445
|
+
# to_body is an alias to to_hash (backward compatibility)
|
446
|
+
# @return [Hash] Returns the object in the form of hash
|
447
|
+
def to_body
|
448
|
+
to_hash
|
449
|
+
end
|
450
|
+
|
451
|
+
# Returns the object in the form of hash
|
452
|
+
# @return [Hash] Returns the object in the form of hash
|
453
|
+
def to_hash
|
454
|
+
hash = {}
|
455
|
+
self.class.attribute_map.each_pair do |attr, param|
|
456
|
+
value = self.send(attr)
|
457
|
+
if value.nil?
|
458
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
459
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
460
|
+
end
|
461
|
+
|
462
|
+
hash[param] = _to_hash(value)
|
463
|
+
end
|
464
|
+
hash
|
465
|
+
end
|
466
|
+
|
467
|
+
# Outputs non-array value in the form of hash
|
468
|
+
# For object, use to_hash. Otherwise, just return the value
|
469
|
+
# @param [Object] value Any valid value
|
470
|
+
# @return [Hash] Returns the value in the form of hash
|
471
|
+
def _to_hash(value)
|
472
|
+
if value.is_a?(Array)
|
473
|
+
value.compact.map { |v| _to_hash(v) }
|
474
|
+
elsif value.is_a?(Hash)
|
475
|
+
{}.tap do |hash|
|
476
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
477
|
+
end
|
478
|
+
elsif value.respond_to? :to_hash
|
479
|
+
value.to_hash
|
480
|
+
else
|
481
|
+
value
|
482
|
+
end
|
483
|
+
end
|
484
|
+
end
|
485
|
+
end
|