pulp_rpm_client 3.0.0b4 → 3.0.0b5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +21 -6
- data/docs/Addon.md +27 -0
- data/docs/Artifact.md +35 -0
- data/docs/Checksum.md +19 -0
- data/docs/ContentAdvisoriesApi.md +12 -6
- data/docs/ContentPackagesApi.md +12 -6
- data/docs/DistributionTree.md +53 -0
- data/docs/DistributionTreesDistributionTreesApi.md +179 -0
- data/docs/DistributionsRpmApi.md +14 -8
- data/docs/Image.md +23 -0
- data/docs/InlineResponse200.md +3 -3
- data/docs/InlineResponse2001.md +3 -3
- data/docs/InlineResponse2002.md +4 -4
- data/docs/InlineResponse2003.md +4 -4
- data/docs/InlineResponse2004.md +4 -4
- data/docs/InlineResponse2005.md +23 -0
- data/docs/InlineResponse2006.md +23 -0
- data/docs/Package.md +10 -8
- data/docs/PublicationsRpmApi.md +14 -8
- data/docs/RemotesRpmApi.md +14 -8
- data/docs/RepoMetadataFile.md +31 -0
- data/docs/RepoMetadataFilesRepoMetadataFilesApi.md +179 -0
- data/docs/Variant.md +37 -0
- data/git_push.sh +10 -7
- data/lib/pulp_rpm_client/api/content_advisories_api.rb +15 -9
- data/lib/pulp_rpm_client/api/content_packages_api.rb +15 -9
- data/lib/pulp_rpm_client/api/distribution_trees_distribution_trees_api.rb +212 -0
- data/lib/pulp_rpm_client/api/distributions_rpm_api.rb +21 -15
- data/lib/pulp_rpm_client/api/publications_rpm_api.rb +19 -13
- data/lib/pulp_rpm_client/api/remotes_rpm_api.rb +22 -16
- data/lib/pulp_rpm_client/api/repo_metadata_files_repo_metadata_files_api.rb +212 -0
- data/lib/pulp_rpm_client/api/rpm_copy_api.rb +2 -2
- data/lib/pulp_rpm_client/api/rpm_upload_api.rb +2 -2
- data/lib/pulp_rpm_client/api_client.rb +77 -62
- data/lib/pulp_rpm_client/api_error.rb +1 -1
- data/lib/pulp_rpm_client/configuration.rb +13 -21
- data/lib/pulp_rpm_client/models/addon.rb +372 -0
- data/lib/pulp_rpm_client/models/artifact.rb +376 -0
- data/lib/pulp_rpm_client/models/async_operation_response.rb +1 -1
- data/lib/pulp_rpm_client/models/checksum.rb +255 -0
- data/lib/pulp_rpm_client/models/distribution_tree.rb +660 -0
- data/lib/pulp_rpm_client/models/image.rb +303 -0
- data/lib/pulp_rpm_client/models/inline_response200.rb +11 -11
- data/lib/pulp_rpm_client/models/inline_response2001.rb +11 -11
- data/lib/pulp_rpm_client/models/inline_response2002.rb +12 -12
- data/lib/pulp_rpm_client/models/inline_response2003.rb +12 -12
- data/lib/pulp_rpm_client/models/inline_response2004.rb +12 -12
- data/lib/pulp_rpm_client/models/inline_response2005.rb +235 -0
- data/lib/pulp_rpm_client/models/inline_response2006.rb +235 -0
- data/lib/pulp_rpm_client/models/package.rb +69 -40
- data/lib/pulp_rpm_client/models/repo_metadata_file.rb +381 -0
- data/lib/pulp_rpm_client/models/repository_sync_url.rb +1 -1
- data/lib/pulp_rpm_client/models/rpm_distribution.rb +1 -1
- data/lib/pulp_rpm_client/models/rpm_publication.rb +1 -1
- data/lib/pulp_rpm_client/models/rpm_remote.rb +1 -1
- data/lib/pulp_rpm_client/models/update_record.rb +1 -1
- data/lib/pulp_rpm_client/models/variant.rb +542 -0
- data/lib/pulp_rpm_client/version.rb +2 -2
- data/lib/pulp_rpm_client.rb +12 -1
- data/pulp_rpm_client.gemspec +3 -9
- data/spec/api/content_advisories_api_spec.rb +5 -3
- data/spec/api/content_packages_api_spec.rb +5 -3
- data/spec/api/distribution_trees_distribution_trees_api_spec.rb +74 -0
- data/spec/api/distributions_rpm_api_spec.rb +6 -4
- data/spec/api/publications_rpm_api_spec.rb +6 -4
- data/spec/api/remotes_rpm_api_spec.rb +6 -4
- data/spec/api/repo_metadata_files_repo_metadata_files_api_spec.rb +74 -0
- data/spec/api/rpm_copy_api_spec.rb +1 -1
- data/spec/api/rpm_upload_api_spec.rb +1 -1
- data/spec/api_client_spec.rb +1 -39
- data/spec/configuration_spec.rb +1 -1
- data/spec/models/addon_spec.rb +71 -0
- data/spec/models/artifact_spec.rb +95 -0
- data/spec/models/async_operation_response_spec.rb +1 -1
- data/spec/models/checksum_spec.rb +47 -0
- data/spec/models/distribution_tree_spec.rb +149 -0
- data/spec/models/image_spec.rb +59 -0
- data/spec/models/inline_response2001_spec.rb +4 -4
- data/spec/models/inline_response2002_spec.rb +4 -4
- data/spec/models/inline_response2003_spec.rb +4 -4
- data/spec/models/inline_response2004_spec.rb +4 -4
- data/spec/models/inline_response2005_spec.rb +59 -0
- data/spec/models/inline_response2006_spec.rb +59 -0
- data/spec/models/inline_response200_spec.rb +4 -4
- data/spec/models/package_spec.rb +16 -10
- data/spec/models/repo_metadata_file_spec.rb +83 -0
- data/spec/models/repository_sync_url_spec.rb +1 -1
- data/spec/models/rpm_distribution_spec.rb +1 -1
- data/spec/models/rpm_publication_spec.rb +1 -1
- data/spec/models/rpm_remote_spec.rb +1 -1
- data/spec/models/update_record_spec.rb +1 -1
- data/spec/models/variant_spec.rb +101 -0
- data/spec/spec_helper.rb +1 -1
- metadata +50 -133
- data/Gemfile.lock +0 -79
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: v3
|
7
7
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 4.
|
9
|
+
OpenAPI Generator version: 4.1.3-SNAPSHOT
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -14,15 +14,18 @@ require 'date'
|
|
14
14
|
|
15
15
|
module PulpRpmClient
|
16
16
|
class Package
|
17
|
-
|
17
|
+
# File name of the package
|
18
|
+
attr_accessor :relative_path
|
18
19
|
|
19
|
-
attr_accessor :
|
20
|
+
attr_accessor :_href
|
20
21
|
|
21
22
|
# Timestamp of creation.
|
22
23
|
attr_accessor :_created
|
23
24
|
|
24
25
|
# Artifact file representing the physical content
|
25
|
-
attr_accessor :
|
26
|
+
attr_accessor :artifact
|
27
|
+
|
28
|
+
attr_accessor :_type
|
26
29
|
|
27
30
|
# Name of the package
|
28
31
|
attr_accessor :name
|
@@ -114,6 +117,9 @@ module PulpRpmClient
|
|
114
117
|
# Last byte of the header
|
115
118
|
attr_accessor :rpm_header_end
|
116
119
|
|
120
|
+
# Flag to identify if the package is modular
|
121
|
+
attr_accessor :is_modular
|
122
|
+
|
117
123
|
# Size, in bytes, of the archive portion of the original package file
|
118
124
|
attr_accessor :size_archive
|
119
125
|
|
@@ -129,16 +135,14 @@ module PulpRpmClient
|
|
129
135
|
# The 'file' time attribute in the primary XML - file mtime in seconds since the epoch.
|
130
136
|
attr_accessor :time_file
|
131
137
|
|
132
|
-
# File name of the package
|
133
|
-
attr_accessor :relative_path
|
134
|
-
|
135
138
|
# Attribute mapping from ruby-style variable name to JSON key.
|
136
139
|
def self.attribute_map
|
137
140
|
{
|
141
|
+
:'relative_path' => :'relative_path',
|
138
142
|
:'_href' => :'_href',
|
139
|
-
:'_type' => :'_type',
|
140
143
|
:'_created' => :'_created',
|
141
|
-
:'
|
144
|
+
:'artifact' => :'artifact',
|
145
|
+
:'_type' => :'_type',
|
142
146
|
:'name' => :'name',
|
143
147
|
:'epoch' => :'epoch',
|
144
148
|
:'version' => :'version',
|
@@ -169,22 +173,23 @@ module PulpRpmClient
|
|
169
173
|
:'rpm_vendor' => :'rpm_vendor',
|
170
174
|
:'rpm_header_start' => :'rpm_header_start',
|
171
175
|
:'rpm_header_end' => :'rpm_header_end',
|
176
|
+
:'is_modular' => :'is_modular',
|
172
177
|
:'size_archive' => :'size_archive',
|
173
178
|
:'size_installed' => :'size_installed',
|
174
179
|
:'size_package' => :'size_package',
|
175
180
|
:'time_build' => :'time_build',
|
176
|
-
:'time_file' => :'time_file'
|
177
|
-
:'relative_path' => :'relative_path'
|
181
|
+
:'time_file' => :'time_file'
|
178
182
|
}
|
179
183
|
end
|
180
184
|
|
181
185
|
# Attribute type mapping.
|
182
186
|
def self.openapi_types
|
183
187
|
{
|
188
|
+
:'relative_path' => :'String',
|
184
189
|
:'_href' => :'String',
|
185
|
-
:'_type' => :'String',
|
186
190
|
:'_created' => :'DateTime',
|
187
|
-
:'
|
191
|
+
:'artifact' => :'String',
|
192
|
+
:'_type' => :'String',
|
188
193
|
:'name' => :'String',
|
189
194
|
:'epoch' => :'String',
|
190
195
|
:'version' => :'String',
|
@@ -215,12 +220,12 @@ module PulpRpmClient
|
|
215
220
|
:'rpm_vendor' => :'String',
|
216
221
|
:'rpm_header_start' => :'Integer',
|
217
222
|
:'rpm_header_end' => :'Integer',
|
223
|
+
:'is_modular' => :'Boolean',
|
218
224
|
:'size_archive' => :'Integer',
|
219
225
|
:'size_installed' => :'Integer',
|
220
226
|
:'size_package' => :'Integer',
|
221
227
|
:'time_build' => :'Integer',
|
222
|
-
:'time_file' => :'Integer'
|
223
|
-
:'relative_path' => :'String'
|
228
|
+
:'time_file' => :'Integer'
|
224
229
|
}
|
225
230
|
end
|
226
231
|
|
@@ -239,20 +244,24 @@ module PulpRpmClient
|
|
239
244
|
h[k.to_sym] = v
|
240
245
|
}
|
241
246
|
|
242
|
-
if attributes.key?(:'
|
243
|
-
self.
|
247
|
+
if attributes.key?(:'relative_path')
|
248
|
+
self.relative_path = attributes[:'relative_path']
|
244
249
|
end
|
245
250
|
|
246
|
-
if attributes.key?(:'
|
247
|
-
self.
|
251
|
+
if attributes.key?(:'_href')
|
252
|
+
self._href = attributes[:'_href']
|
248
253
|
end
|
249
254
|
|
250
255
|
if attributes.key?(:'_created')
|
251
256
|
self._created = attributes[:'_created']
|
252
257
|
end
|
253
258
|
|
254
|
-
if attributes.key?(:'
|
255
|
-
self.
|
259
|
+
if attributes.key?(:'artifact')
|
260
|
+
self.artifact = attributes[:'artifact']
|
261
|
+
end
|
262
|
+
|
263
|
+
if attributes.key?(:'_type')
|
264
|
+
self._type = attributes[:'_type']
|
256
265
|
end
|
257
266
|
|
258
267
|
if attributes.key?(:'name')
|
@@ -395,6 +404,10 @@ module PulpRpmClient
|
|
395
404
|
self.rpm_header_end = attributes[:'rpm_header_end']
|
396
405
|
end
|
397
406
|
|
407
|
+
if attributes.key?(:'is_modular')
|
408
|
+
self.is_modular = attributes[:'is_modular']
|
409
|
+
end
|
410
|
+
|
398
411
|
if attributes.key?(:'size_archive')
|
399
412
|
self.size_archive = attributes[:'size_archive']
|
400
413
|
end
|
@@ -414,22 +427,26 @@ module PulpRpmClient
|
|
414
427
|
if attributes.key?(:'time_file')
|
415
428
|
self.time_file = attributes[:'time_file']
|
416
429
|
end
|
417
|
-
|
418
|
-
if attributes.key?(:'relative_path')
|
419
|
-
self.relative_path = attributes[:'relative_path']
|
420
|
-
end
|
421
430
|
end
|
422
431
|
|
423
432
|
# Show invalid properties with the reasons. Usually used together with valid?
|
424
433
|
# @return Array for valid properties with the reasons
|
425
434
|
def list_invalid_properties
|
426
435
|
invalid_properties = Array.new
|
427
|
-
if
|
428
|
-
invalid_properties.push('invalid value for "
|
436
|
+
if @relative_path.nil?
|
437
|
+
invalid_properties.push('invalid value for "relative_path", relative_path cannot be nil.')
|
429
438
|
end
|
430
439
|
|
431
|
-
if @
|
432
|
-
invalid_properties.push('invalid value for "
|
440
|
+
if @relative_path.to_s.length < 1
|
441
|
+
invalid_properties.push('invalid value for "relative_path", the character length must be great than or equal to 1.')
|
442
|
+
end
|
443
|
+
|
444
|
+
if @artifact.nil?
|
445
|
+
invalid_properties.push('invalid value for "artifact", artifact cannot be nil.')
|
446
|
+
end
|
447
|
+
|
448
|
+
if !@_type.nil? && @_type.to_s.length < 1
|
449
|
+
invalid_properties.push('invalid value for "_type", the character length must be great than or equal to 1.')
|
433
450
|
end
|
434
451
|
|
435
452
|
if @name.nil?
|
@@ -556,18 +573,16 @@ module PulpRpmClient
|
|
556
573
|
invalid_properties.push('invalid value for "time_file", time_file cannot be nil.')
|
557
574
|
end
|
558
575
|
|
559
|
-
if @relative_path.nil?
|
560
|
-
invalid_properties.push('invalid value for "relative_path", relative_path cannot be nil.')
|
561
|
-
end
|
562
|
-
|
563
576
|
invalid_properties
|
564
577
|
end
|
565
578
|
|
566
579
|
# Check to see if the all the properties in the model are valid
|
567
580
|
# @return true if the model is valid
|
568
581
|
def valid?
|
582
|
+
return false if @relative_path.nil?
|
583
|
+
return false if @relative_path.to_s.length < 1
|
584
|
+
return false if @artifact.nil?
|
569
585
|
return false if !@_type.nil? && @_type.to_s.length < 1
|
570
|
-
return false if @_artifact.nil?
|
571
586
|
return false if @name.nil?
|
572
587
|
return false if @name.to_s.length < 1
|
573
588
|
return false if @version.nil?
|
@@ -599,10 +614,23 @@ module PulpRpmClient
|
|
599
614
|
return false if @size_package.nil?
|
600
615
|
return false if @time_build.nil?
|
601
616
|
return false if @time_file.nil?
|
602
|
-
return false if @relative_path.nil?
|
603
617
|
true
|
604
618
|
end
|
605
619
|
|
620
|
+
# Custom attribute writer method with validation
|
621
|
+
# @param [Object] relative_path Value to be assigned
|
622
|
+
def relative_path=(relative_path)
|
623
|
+
if relative_path.nil?
|
624
|
+
fail ArgumentError, 'relative_path cannot be nil'
|
625
|
+
end
|
626
|
+
|
627
|
+
if relative_path.to_s.length < 1
|
628
|
+
fail ArgumentError, 'invalid value for "relative_path", the character length must be great than or equal to 1.'
|
629
|
+
end
|
630
|
+
|
631
|
+
@relative_path = relative_path
|
632
|
+
end
|
633
|
+
|
606
634
|
# Custom attribute writer method with validation
|
607
635
|
# @param [Object] _type Value to be assigned
|
608
636
|
def _type=(_type)
|
@@ -816,10 +844,11 @@ module PulpRpmClient
|
|
816
844
|
def ==(o)
|
817
845
|
return true if self.equal?(o)
|
818
846
|
self.class == o.class &&
|
847
|
+
relative_path == o.relative_path &&
|
819
848
|
_href == o._href &&
|
820
|
-
_type == o._type &&
|
821
849
|
_created == o._created &&
|
822
|
-
|
850
|
+
artifact == o.artifact &&
|
851
|
+
_type == o._type &&
|
823
852
|
name == o.name &&
|
824
853
|
epoch == o.epoch &&
|
825
854
|
version == o.version &&
|
@@ -850,12 +879,12 @@ module PulpRpmClient
|
|
850
879
|
rpm_vendor == o.rpm_vendor &&
|
851
880
|
rpm_header_start == o.rpm_header_start &&
|
852
881
|
rpm_header_end == o.rpm_header_end &&
|
882
|
+
is_modular == o.is_modular &&
|
853
883
|
size_archive == o.size_archive &&
|
854
884
|
size_installed == o.size_installed &&
|
855
885
|
size_package == o.size_package &&
|
856
886
|
time_build == o.time_build &&
|
857
|
-
time_file == o.time_file
|
858
|
-
relative_path == o.relative_path
|
887
|
+
time_file == o.time_file
|
859
888
|
end
|
860
889
|
|
861
890
|
# @see the `==` method
|
@@ -867,7 +896,7 @@ module PulpRpmClient
|
|
867
896
|
# Calculates hash code according to all attributes.
|
868
897
|
# @return [Integer] Hash code
|
869
898
|
def hash
|
870
|
-
[
|
899
|
+
[relative_path, _href, _created, artifact, _type, name, epoch, version, release, arch, pkg_id, checksum_type, summary, description, url, changelogs, files, requires, provides, conflicts, obsoletes, suggests, enhances, recommends, supplements, location_base, location_href, rpm_buildhost, rpm_group, rpm_license, rpm_packager, rpm_sourcerpm, rpm_vendor, rpm_header_start, rpm_header_end, is_modular, size_archive, size_installed, size_package, time_build, time_file].hash
|
871
900
|
end
|
872
901
|
|
873
902
|
# Builds the object from hash
|
@@ -0,0 +1,381 @@
|
|
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.1.3-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module PulpRpmClient
|
16
|
+
class RepoMetadataFile
|
17
|
+
attr_accessor :_href
|
18
|
+
|
19
|
+
# Timestamp of creation.
|
20
|
+
attr_accessor :_created
|
21
|
+
|
22
|
+
attr_accessor :_type
|
23
|
+
|
24
|
+
# Artifact file representing the physical content
|
25
|
+
attr_accessor :artifact
|
26
|
+
|
27
|
+
# Path where the artifact is located relative to distributions base_path
|
28
|
+
attr_accessor :relative_path
|
29
|
+
|
30
|
+
# Metadata type.
|
31
|
+
attr_accessor :data_type
|
32
|
+
|
33
|
+
# Checksum type for the file.
|
34
|
+
attr_accessor :checksum_type
|
35
|
+
|
36
|
+
# Checksum for the file.
|
37
|
+
attr_accessor :checksum
|
38
|
+
|
39
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
40
|
+
def self.attribute_map
|
41
|
+
{
|
42
|
+
:'_href' => :'_href',
|
43
|
+
:'_created' => :'_created',
|
44
|
+
:'_type' => :'_type',
|
45
|
+
:'artifact' => :'artifact',
|
46
|
+
:'relative_path' => :'relative_path',
|
47
|
+
:'data_type' => :'data_type',
|
48
|
+
:'checksum_type' => :'checksum_type',
|
49
|
+
:'checksum' => :'checksum'
|
50
|
+
}
|
51
|
+
end
|
52
|
+
|
53
|
+
# Attribute type mapping.
|
54
|
+
def self.openapi_types
|
55
|
+
{
|
56
|
+
:'_href' => :'String',
|
57
|
+
:'_created' => :'DateTime',
|
58
|
+
:'_type' => :'String',
|
59
|
+
:'artifact' => :'String',
|
60
|
+
:'relative_path' => :'String',
|
61
|
+
:'data_type' => :'String',
|
62
|
+
:'checksum_type' => :'String',
|
63
|
+
:'checksum' => :'String'
|
64
|
+
}
|
65
|
+
end
|
66
|
+
|
67
|
+
# Initializes the object
|
68
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
69
|
+
def initialize(attributes = {})
|
70
|
+
if (!attributes.is_a?(Hash))
|
71
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpRpmClient::RepoMetadataFile` initialize method"
|
72
|
+
end
|
73
|
+
|
74
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
75
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
76
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
77
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpRpmClient::RepoMetadataFile`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
78
|
+
end
|
79
|
+
h[k.to_sym] = v
|
80
|
+
}
|
81
|
+
|
82
|
+
if attributes.key?(:'_href')
|
83
|
+
self._href = attributes[:'_href']
|
84
|
+
end
|
85
|
+
|
86
|
+
if attributes.key?(:'_created')
|
87
|
+
self._created = attributes[:'_created']
|
88
|
+
end
|
89
|
+
|
90
|
+
if attributes.key?(:'_type')
|
91
|
+
self._type = attributes[:'_type']
|
92
|
+
end
|
93
|
+
|
94
|
+
if attributes.key?(:'artifact')
|
95
|
+
self.artifact = attributes[:'artifact']
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.key?(:'relative_path')
|
99
|
+
self.relative_path = attributes[:'relative_path']
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes.key?(:'data_type')
|
103
|
+
self.data_type = attributes[:'data_type']
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes.key?(:'checksum_type')
|
107
|
+
self.checksum_type = attributes[:'checksum_type']
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes.key?(:'checksum')
|
111
|
+
self.checksum = attributes[:'checksum']
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
116
|
+
# @return Array for valid properties with the reasons
|
117
|
+
def list_invalid_properties
|
118
|
+
invalid_properties = Array.new
|
119
|
+
if !@_type.nil? && @_type.to_s.length < 1
|
120
|
+
invalid_properties.push('invalid value for "_type", the character length must be great than or equal to 1.')
|
121
|
+
end
|
122
|
+
|
123
|
+
if @artifact.nil?
|
124
|
+
invalid_properties.push('invalid value for "artifact", artifact cannot be nil.')
|
125
|
+
end
|
126
|
+
|
127
|
+
if @relative_path.nil?
|
128
|
+
invalid_properties.push('invalid value for "relative_path", relative_path cannot be nil.')
|
129
|
+
end
|
130
|
+
|
131
|
+
if @relative_path.to_s.length < 1
|
132
|
+
invalid_properties.push('invalid value for "relative_path", the character length must be great than or equal to 1.')
|
133
|
+
end
|
134
|
+
|
135
|
+
if @data_type.nil?
|
136
|
+
invalid_properties.push('invalid value for "data_type", data_type cannot be nil.')
|
137
|
+
end
|
138
|
+
|
139
|
+
if @data_type.to_s.length < 1
|
140
|
+
invalid_properties.push('invalid value for "data_type", the character length must be great than or equal to 1.')
|
141
|
+
end
|
142
|
+
|
143
|
+
if @checksum_type.nil?
|
144
|
+
invalid_properties.push('invalid value for "checksum_type", checksum_type cannot be nil.')
|
145
|
+
end
|
146
|
+
|
147
|
+
if @checksum_type.to_s.length < 1
|
148
|
+
invalid_properties.push('invalid value for "checksum_type", the character length must be great than or equal to 1.')
|
149
|
+
end
|
150
|
+
|
151
|
+
if @checksum.nil?
|
152
|
+
invalid_properties.push('invalid value for "checksum", checksum cannot be nil.')
|
153
|
+
end
|
154
|
+
|
155
|
+
if @checksum.to_s.length < 1
|
156
|
+
invalid_properties.push('invalid value for "checksum", the character length must be great than or equal to 1.')
|
157
|
+
end
|
158
|
+
|
159
|
+
invalid_properties
|
160
|
+
end
|
161
|
+
|
162
|
+
# Check to see if the all the properties in the model are valid
|
163
|
+
# @return true if the model is valid
|
164
|
+
def valid?
|
165
|
+
return false if !@_type.nil? && @_type.to_s.length < 1
|
166
|
+
return false if @artifact.nil?
|
167
|
+
return false if @relative_path.nil?
|
168
|
+
return false if @relative_path.to_s.length < 1
|
169
|
+
return false if @data_type.nil?
|
170
|
+
return false if @data_type.to_s.length < 1
|
171
|
+
return false if @checksum_type.nil?
|
172
|
+
return false if @checksum_type.to_s.length < 1
|
173
|
+
return false if @checksum.nil?
|
174
|
+
return false if @checksum.to_s.length < 1
|
175
|
+
true
|
176
|
+
end
|
177
|
+
|
178
|
+
# Custom attribute writer method with validation
|
179
|
+
# @param [Object] _type Value to be assigned
|
180
|
+
def _type=(_type)
|
181
|
+
if !_type.nil? && _type.to_s.length < 1
|
182
|
+
fail ArgumentError, 'invalid value for "_type", the character length must be great than or equal to 1.'
|
183
|
+
end
|
184
|
+
|
185
|
+
@_type = _type
|
186
|
+
end
|
187
|
+
|
188
|
+
# Custom attribute writer method with validation
|
189
|
+
# @param [Object] relative_path Value to be assigned
|
190
|
+
def relative_path=(relative_path)
|
191
|
+
if relative_path.nil?
|
192
|
+
fail ArgumentError, 'relative_path cannot be nil'
|
193
|
+
end
|
194
|
+
|
195
|
+
if relative_path.to_s.length < 1
|
196
|
+
fail ArgumentError, 'invalid value for "relative_path", the character length must be great than or equal to 1.'
|
197
|
+
end
|
198
|
+
|
199
|
+
@relative_path = relative_path
|
200
|
+
end
|
201
|
+
|
202
|
+
# Custom attribute writer method with validation
|
203
|
+
# @param [Object] data_type Value to be assigned
|
204
|
+
def data_type=(data_type)
|
205
|
+
if data_type.nil?
|
206
|
+
fail ArgumentError, 'data_type cannot be nil'
|
207
|
+
end
|
208
|
+
|
209
|
+
if data_type.to_s.length < 1
|
210
|
+
fail ArgumentError, 'invalid value for "data_type", the character length must be great than or equal to 1.'
|
211
|
+
end
|
212
|
+
|
213
|
+
@data_type = data_type
|
214
|
+
end
|
215
|
+
|
216
|
+
# Custom attribute writer method with validation
|
217
|
+
# @param [Object] checksum_type Value to be assigned
|
218
|
+
def checksum_type=(checksum_type)
|
219
|
+
if checksum_type.nil?
|
220
|
+
fail ArgumentError, 'checksum_type cannot be nil'
|
221
|
+
end
|
222
|
+
|
223
|
+
if checksum_type.to_s.length < 1
|
224
|
+
fail ArgumentError, 'invalid value for "checksum_type", the character length must be great than or equal to 1.'
|
225
|
+
end
|
226
|
+
|
227
|
+
@checksum_type = checksum_type
|
228
|
+
end
|
229
|
+
|
230
|
+
# Custom attribute writer method with validation
|
231
|
+
# @param [Object] checksum Value to be assigned
|
232
|
+
def checksum=(checksum)
|
233
|
+
if checksum.nil?
|
234
|
+
fail ArgumentError, 'checksum cannot be nil'
|
235
|
+
end
|
236
|
+
|
237
|
+
if checksum.to_s.length < 1
|
238
|
+
fail ArgumentError, 'invalid value for "checksum", the character length must be great than or equal to 1.'
|
239
|
+
end
|
240
|
+
|
241
|
+
@checksum = checksum
|
242
|
+
end
|
243
|
+
|
244
|
+
# Checks equality by comparing each attribute.
|
245
|
+
# @param [Object] Object to be compared
|
246
|
+
def ==(o)
|
247
|
+
return true if self.equal?(o)
|
248
|
+
self.class == o.class &&
|
249
|
+
_href == o._href &&
|
250
|
+
_created == o._created &&
|
251
|
+
_type == o._type &&
|
252
|
+
artifact == o.artifact &&
|
253
|
+
relative_path == o.relative_path &&
|
254
|
+
data_type == o.data_type &&
|
255
|
+
checksum_type == o.checksum_type &&
|
256
|
+
checksum == o.checksum
|
257
|
+
end
|
258
|
+
|
259
|
+
# @see the `==` method
|
260
|
+
# @param [Object] Object to be compared
|
261
|
+
def eql?(o)
|
262
|
+
self == o
|
263
|
+
end
|
264
|
+
|
265
|
+
# Calculates hash code according to all attributes.
|
266
|
+
# @return [Integer] Hash code
|
267
|
+
def hash
|
268
|
+
[_href, _created, _type, artifact, relative_path, data_type, checksum_type, checksum].hash
|
269
|
+
end
|
270
|
+
|
271
|
+
# Builds the object from hash
|
272
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
273
|
+
# @return [Object] Returns the model itself
|
274
|
+
def self.build_from_hash(attributes)
|
275
|
+
new.build_from_hash(attributes)
|
276
|
+
end
|
277
|
+
|
278
|
+
# Builds the object from hash
|
279
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
280
|
+
# @return [Object] Returns the model itself
|
281
|
+
def build_from_hash(attributes)
|
282
|
+
return nil unless attributes.is_a?(Hash)
|
283
|
+
self.class.openapi_types.each_pair do |key, type|
|
284
|
+
if type =~ /\AArray<(.*)>/i
|
285
|
+
# check to ensure the input is an array given that the attribute
|
286
|
+
# is documented as an array but the input is not
|
287
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
288
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
289
|
+
end
|
290
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
291
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
292
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
293
|
+
end
|
294
|
+
|
295
|
+
self
|
296
|
+
end
|
297
|
+
|
298
|
+
# Deserializes the data based on type
|
299
|
+
# @param string type Data type
|
300
|
+
# @param string value Value to be deserialized
|
301
|
+
# @return [Object] Deserialized data
|
302
|
+
def _deserialize(type, value)
|
303
|
+
case type.to_sym
|
304
|
+
when :DateTime
|
305
|
+
DateTime.parse(value)
|
306
|
+
when :Date
|
307
|
+
Date.parse(value)
|
308
|
+
when :String
|
309
|
+
value.to_s
|
310
|
+
when :Integer
|
311
|
+
value.to_i
|
312
|
+
when :Float
|
313
|
+
value.to_f
|
314
|
+
when :Boolean
|
315
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
316
|
+
true
|
317
|
+
else
|
318
|
+
false
|
319
|
+
end
|
320
|
+
when :Object
|
321
|
+
# generic object (usually a Hash), return directly
|
322
|
+
value
|
323
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
324
|
+
inner_type = Regexp.last_match[:inner_type]
|
325
|
+
value.map { |v| _deserialize(inner_type, v) }
|
326
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
327
|
+
k_type = Regexp.last_match[:k_type]
|
328
|
+
v_type = Regexp.last_match[:v_type]
|
329
|
+
{}.tap do |hash|
|
330
|
+
value.each do |k, v|
|
331
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
332
|
+
end
|
333
|
+
end
|
334
|
+
else # model
|
335
|
+
PulpRpmClient.const_get(type).build_from_hash(value)
|
336
|
+
end
|
337
|
+
end
|
338
|
+
|
339
|
+
# Returns the string representation of the object
|
340
|
+
# @return [String] String presentation of the object
|
341
|
+
def to_s
|
342
|
+
to_hash.to_s
|
343
|
+
end
|
344
|
+
|
345
|
+
# to_body is an alias to to_hash (backward compatibility)
|
346
|
+
# @return [Hash] Returns the object in the form of hash
|
347
|
+
def to_body
|
348
|
+
to_hash
|
349
|
+
end
|
350
|
+
|
351
|
+
# Returns the object in the form of hash
|
352
|
+
# @return [Hash] Returns the object in the form of hash
|
353
|
+
def to_hash
|
354
|
+
hash = {}
|
355
|
+
self.class.attribute_map.each_pair do |attr, param|
|
356
|
+
value = self.send(attr)
|
357
|
+
next if value.nil?
|
358
|
+
hash[param] = _to_hash(value)
|
359
|
+
end
|
360
|
+
hash
|
361
|
+
end
|
362
|
+
|
363
|
+
# Outputs non-array value in the form of hash
|
364
|
+
# For object, use to_hash. Otherwise, just return the value
|
365
|
+
# @param [Object] value Any valid value
|
366
|
+
# @return [Hash] Returns the value in the form of hash
|
367
|
+
def _to_hash(value)
|
368
|
+
if value.is_a?(Array)
|
369
|
+
value.compact.map { |v| _to_hash(v) }
|
370
|
+
elsif value.is_a?(Hash)
|
371
|
+
{}.tap do |hash|
|
372
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
373
|
+
end
|
374
|
+
elsif value.respond_to? :to_hash
|
375
|
+
value.to_hash
|
376
|
+
else
|
377
|
+
value
|
378
|
+
end
|
379
|
+
end
|
380
|
+
end
|
381
|
+
end
|