pulp_maven_client 0.25.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +10 -4
- data/docs/ContentPackageApi.md +6 -0
- data/docs/MavenMavenPackageResponse.md +2 -0
- data/docs/MavenPackageReleaseResponse.md +22 -0
- data/docs/MavenRepositoryMetricsResponse.md +22 -0
- data/docs/MavenRepositoryPackageResponse.md +24 -0
- data/docs/PaginatedMavenRepositoryPackageListResponse.md +24 -0
- data/docs/RepositoriesMavenApi.md +166 -0
- data/lib/pulp_maven_client/api/content_package_api.rb +9 -0
- data/lib/pulp_maven_client/api/repositories_maven_api.rb +156 -0
- data/lib/pulp_maven_client/models/maven_maven_package_response.rb +11 -1
- data/lib/pulp_maven_client/models/maven_package_release_response.rb +257 -0
- data/lib/pulp_maven_client/models/maven_repository_metrics_response.rb +257 -0
- data/lib/pulp_maven_client/models/maven_repository_package_response.rb +278 -0
- data/lib/pulp_maven_client/models/nested_role.rb +1 -1
- data/lib/pulp_maven_client/models/nested_role_response.rb +1 -1
- data/lib/pulp_maven_client/models/paginated_maven_repository_package_list_response.rb +263 -0
- data/lib/pulp_maven_client/models/repository_add_remove_content.rb +1 -1
- data/lib/pulp_maven_client/models/repository_version_response.rb +1 -1
- data/lib/pulp_maven_client/version.rb +1 -1
- data/lib/pulp_maven_client.rb +4 -0
- data/spec/api/content_package_api_spec.rb +3 -0
- data/spec/api/repositories_maven_api_spec.rb +34 -0
- data/spec/models/maven_maven_package_response_spec.rb +6 -0
- data/spec/models/maven_package_release_response_spec.rb +48 -0
- data/spec/models/maven_repository_metrics_response_spec.rb +48 -0
- data/spec/models/maven_repository_package_response_spec.rb +54 -0
- data/spec/models/paginated_maven_repository_package_list_response_spec.rb +54 -0
- metadata +51 -35
|
@@ -41,6 +41,9 @@ module PulpMavenClient
|
|
|
41
41
|
# Version of the package.
|
|
42
42
|
attr_accessor :version
|
|
43
43
|
|
|
44
|
+
# The package version with a trailing rebuild suffix stripped (matching \\.[a-zA-Z]+-\\d+$). Equal to version when no suffix is present.
|
|
45
|
+
attr_accessor :base_version
|
|
46
|
+
|
|
44
47
|
# Human-readable name from the POM.
|
|
45
48
|
attr_accessor :name
|
|
46
49
|
|
|
@@ -72,6 +75,7 @@ module PulpMavenClient
|
|
|
72
75
|
:'group_id' => :'group_id',
|
|
73
76
|
:'artifact_id' => :'artifact_id',
|
|
74
77
|
:'version' => :'version',
|
|
78
|
+
:'base_version' => :'base_version',
|
|
75
79
|
:'name' => :'name',
|
|
76
80
|
:'description' => :'description',
|
|
77
81
|
:'packaging' => :'packaging',
|
|
@@ -99,6 +103,7 @@ module PulpMavenClient
|
|
|
99
103
|
:'group_id' => :'String',
|
|
100
104
|
:'artifact_id' => :'String',
|
|
101
105
|
:'version' => :'String',
|
|
106
|
+
:'base_version' => :'String',
|
|
102
107
|
:'name' => :'String',
|
|
103
108
|
:'description' => :'String',
|
|
104
109
|
:'packaging' => :'String',
|
|
@@ -175,6 +180,10 @@ module PulpMavenClient
|
|
|
175
180
|
self.version = attributes[:'version']
|
|
176
181
|
end
|
|
177
182
|
|
|
183
|
+
if attributes.key?(:'base_version')
|
|
184
|
+
self.base_version = attributes[:'base_version']
|
|
185
|
+
end
|
|
186
|
+
|
|
178
187
|
if attributes.key?(:'name')
|
|
179
188
|
self.name = attributes[:'name']
|
|
180
189
|
end
|
|
@@ -233,6 +242,7 @@ module PulpMavenClient
|
|
|
233
242
|
group_id == o.group_id &&
|
|
234
243
|
artifact_id == o.artifact_id &&
|
|
235
244
|
version == o.version &&
|
|
245
|
+
base_version == o.base_version &&
|
|
236
246
|
name == o.name &&
|
|
237
247
|
description == o.description &&
|
|
238
248
|
packaging == o.packaging &&
|
|
@@ -251,7 +261,7 @@ module PulpMavenClient
|
|
|
251
261
|
# Calculates hash code according to all attributes.
|
|
252
262
|
# @return [Integer] Hash code
|
|
253
263
|
def hash
|
|
254
|
-
[pulp_href, prn, pulp_created, pulp_last_updated, pulp_labels, vuln_report, group_id, artifact_id, version, name, description, packaging, url, licenses, dependencies, scm_url].hash
|
|
264
|
+
[pulp_href, prn, pulp_created, pulp_last_updated, pulp_labels, vuln_report, group_id, artifact_id, version, base_version, name, description, packaging, url, licenses, dependencies, scm_url].hash
|
|
255
265
|
end
|
|
256
266
|
|
|
257
267
|
# Builds the object from hash
|
|
@@ -0,0 +1,257 @@
|
|
|
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
|
+
Generator version: 7.10.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module PulpMavenClient
|
|
17
|
+
# One logical version on the repository package index.
|
|
18
|
+
class MavenPackageReleaseResponse
|
|
19
|
+
# Logical version key (rebuild suffix stripped).
|
|
20
|
+
attr_accessor :version
|
|
21
|
+
|
|
22
|
+
# Rebuild/release qualifier within the version line (e.g. rhlw-00003). Empty when the selected unit has no rebuild suffix.
|
|
23
|
+
attr_accessor :release
|
|
24
|
+
|
|
25
|
+
# When this logical version entered the repository: RepositoryContent.pulp_created of the newest rebuild, falling back to the content unit's pulp_created.
|
|
26
|
+
attr_accessor :created_at
|
|
27
|
+
|
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
|
+
def self.attribute_map
|
|
30
|
+
{
|
|
31
|
+
:'version' => :'version',
|
|
32
|
+
:'release' => :'release',
|
|
33
|
+
:'created_at' => :'created_at'
|
|
34
|
+
}
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns all the JSON keys this model knows about
|
|
38
|
+
def self.acceptable_attributes
|
|
39
|
+
attribute_map.values
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Attribute type mapping.
|
|
43
|
+
def self.openapi_types
|
|
44
|
+
{
|
|
45
|
+
:'version' => :'String',
|
|
46
|
+
:'release' => :'String',
|
|
47
|
+
:'created_at' => :'Time'
|
|
48
|
+
}
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# List of attributes with nullable: true
|
|
52
|
+
def self.openapi_nullable
|
|
53
|
+
Set.new([
|
|
54
|
+
])
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Initializes the object
|
|
58
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
59
|
+
def initialize(attributes = {})
|
|
60
|
+
if (!attributes.is_a?(Hash))
|
|
61
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpMavenClient::MavenPackageReleaseResponse` initialize method"
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
66
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpMavenClient::MavenPackageReleaseResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
68
|
+
end
|
|
69
|
+
h[k.to_sym] = v
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if attributes.key?(:'version')
|
|
73
|
+
self.version = attributes[:'version']
|
|
74
|
+
else
|
|
75
|
+
self.version = nil
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'release')
|
|
79
|
+
self.release = attributes[:'release']
|
|
80
|
+
else
|
|
81
|
+
self.release = nil
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
if attributes.key?(:'created_at')
|
|
85
|
+
self.created_at = attributes[:'created_at']
|
|
86
|
+
else
|
|
87
|
+
self.created_at = nil
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
92
|
+
# @return Array for valid properties with the reasons
|
|
93
|
+
def list_invalid_properties
|
|
94
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
95
|
+
invalid_properties = Array.new
|
|
96
|
+
if @version.nil?
|
|
97
|
+
invalid_properties.push('invalid value for "version", version cannot be nil.')
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if @release.nil?
|
|
101
|
+
invalid_properties.push('invalid value for "release", release cannot be nil.')
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if @created_at.nil?
|
|
105
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
invalid_properties
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Check to see if the all the properties in the model are valid
|
|
112
|
+
# @return true if the model is valid
|
|
113
|
+
def valid?
|
|
114
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
115
|
+
return false if @version.nil?
|
|
116
|
+
return false if @release.nil?
|
|
117
|
+
return false if @created_at.nil?
|
|
118
|
+
true
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Checks equality by comparing each attribute.
|
|
122
|
+
# @param [Object] Object to be compared
|
|
123
|
+
def ==(o)
|
|
124
|
+
return true if self.equal?(o)
|
|
125
|
+
self.class == o.class &&
|
|
126
|
+
version == o.version &&
|
|
127
|
+
release == o.release &&
|
|
128
|
+
created_at == o.created_at
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# @see the `==` method
|
|
132
|
+
# @param [Object] Object to be compared
|
|
133
|
+
def eql?(o)
|
|
134
|
+
self == o
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Calculates hash code according to all attributes.
|
|
138
|
+
# @return [Integer] Hash code
|
|
139
|
+
def hash
|
|
140
|
+
[version, release, created_at].hash
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Builds the object from hash
|
|
144
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
145
|
+
# @return [Object] Returns the model itself
|
|
146
|
+
def self.build_from_hash(attributes)
|
|
147
|
+
return nil unless attributes.is_a?(Hash)
|
|
148
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
149
|
+
transformed_hash = {}
|
|
150
|
+
openapi_types.each_pair do |key, type|
|
|
151
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
152
|
+
transformed_hash["#{key}"] = nil
|
|
153
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
154
|
+
# check to ensure the input is an array given that the attribute
|
|
155
|
+
# is documented as an array but the input is not
|
|
156
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
157
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
158
|
+
end
|
|
159
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
160
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
new(transformed_hash)
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Deserializes the data based on type
|
|
167
|
+
# @param string type Data type
|
|
168
|
+
# @param string value Value to be deserialized
|
|
169
|
+
# @return [Object] Deserialized data
|
|
170
|
+
def self._deserialize(type, value)
|
|
171
|
+
case type.to_sym
|
|
172
|
+
when :Time
|
|
173
|
+
Time.parse(value)
|
|
174
|
+
when :Date
|
|
175
|
+
Date.parse(value)
|
|
176
|
+
when :String
|
|
177
|
+
value.to_s
|
|
178
|
+
when :Integer
|
|
179
|
+
value.to_i
|
|
180
|
+
when :Float
|
|
181
|
+
value.to_f
|
|
182
|
+
when :Boolean
|
|
183
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
184
|
+
true
|
|
185
|
+
else
|
|
186
|
+
false
|
|
187
|
+
end
|
|
188
|
+
when :Object
|
|
189
|
+
# generic object (usually a Hash), return directly
|
|
190
|
+
value
|
|
191
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
192
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
193
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
194
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
195
|
+
k_type = Regexp.last_match[:k_type]
|
|
196
|
+
v_type = Regexp.last_match[:v_type]
|
|
197
|
+
{}.tap do |hash|
|
|
198
|
+
value.each do |k, v|
|
|
199
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
200
|
+
end
|
|
201
|
+
end
|
|
202
|
+
else # model
|
|
203
|
+
# models (e.g. Pet) or oneOf
|
|
204
|
+
klass = PulpMavenClient.const_get(type)
|
|
205
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
# Returns the string representation of the object
|
|
210
|
+
# @return [String] String presentation of the object
|
|
211
|
+
def to_s
|
|
212
|
+
to_hash.to_s
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
216
|
+
# @return [Hash] Returns the object in the form of hash
|
|
217
|
+
def to_body
|
|
218
|
+
to_hash
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Returns the object in the form of hash
|
|
222
|
+
# @return [Hash] Returns the object in the form of hash
|
|
223
|
+
def to_hash
|
|
224
|
+
hash = {}
|
|
225
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
226
|
+
value = self.send(attr)
|
|
227
|
+
if value.nil?
|
|
228
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
229
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
hash[param] = _to_hash(value)
|
|
233
|
+
end
|
|
234
|
+
hash
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
# Outputs non-array value in the form of hash
|
|
238
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
239
|
+
# @param [Object] value Any valid value
|
|
240
|
+
# @return [Hash] Returns the value in the form of hash
|
|
241
|
+
def _to_hash(value)
|
|
242
|
+
if value.is_a?(Array)
|
|
243
|
+
value.compact.map { |v| _to_hash(v) }
|
|
244
|
+
elsif value.is_a?(Hash)
|
|
245
|
+
{}.tap do |hash|
|
|
246
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
247
|
+
end
|
|
248
|
+
elsif value.respond_to? :to_hash
|
|
249
|
+
value.to_hash
|
|
250
|
+
else
|
|
251
|
+
value
|
|
252
|
+
end
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
end
|
|
@@ -0,0 +1,257 @@
|
|
|
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
|
+
Generator version: 7.10.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module PulpMavenClient
|
|
17
|
+
# Distinct package / version / build counts for a repository version.
|
|
18
|
+
class MavenRepositoryMetricsResponse
|
|
19
|
+
# Distinct (group_id, artifact_id) pairs among MavenPackage units.
|
|
20
|
+
attr_accessor :package_count
|
|
21
|
+
|
|
22
|
+
# Distinct (group_id, artifact_id, base_version) triples after rebuild-suffix strip.
|
|
23
|
+
attr_accessor :version_count
|
|
24
|
+
|
|
25
|
+
# Distinct (group_id, artifact_id, full version) GAVs among MavenPackage units.
|
|
26
|
+
attr_accessor :build_count
|
|
27
|
+
|
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
|
+
def self.attribute_map
|
|
30
|
+
{
|
|
31
|
+
:'package_count' => :'package_count',
|
|
32
|
+
:'version_count' => :'version_count',
|
|
33
|
+
:'build_count' => :'build_count'
|
|
34
|
+
}
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns all the JSON keys this model knows about
|
|
38
|
+
def self.acceptable_attributes
|
|
39
|
+
attribute_map.values
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Attribute type mapping.
|
|
43
|
+
def self.openapi_types
|
|
44
|
+
{
|
|
45
|
+
:'package_count' => :'Integer',
|
|
46
|
+
:'version_count' => :'Integer',
|
|
47
|
+
:'build_count' => :'Integer'
|
|
48
|
+
}
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# List of attributes with nullable: true
|
|
52
|
+
def self.openapi_nullable
|
|
53
|
+
Set.new([
|
|
54
|
+
])
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Initializes the object
|
|
58
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
59
|
+
def initialize(attributes = {})
|
|
60
|
+
if (!attributes.is_a?(Hash))
|
|
61
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpMavenClient::MavenRepositoryMetricsResponse` initialize method"
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
66
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpMavenClient::MavenRepositoryMetricsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
68
|
+
end
|
|
69
|
+
h[k.to_sym] = v
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if attributes.key?(:'package_count')
|
|
73
|
+
self.package_count = attributes[:'package_count']
|
|
74
|
+
else
|
|
75
|
+
self.package_count = nil
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'version_count')
|
|
79
|
+
self.version_count = attributes[:'version_count']
|
|
80
|
+
else
|
|
81
|
+
self.version_count = nil
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
if attributes.key?(:'build_count')
|
|
85
|
+
self.build_count = attributes[:'build_count']
|
|
86
|
+
else
|
|
87
|
+
self.build_count = nil
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
92
|
+
# @return Array for valid properties with the reasons
|
|
93
|
+
def list_invalid_properties
|
|
94
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
95
|
+
invalid_properties = Array.new
|
|
96
|
+
if @package_count.nil?
|
|
97
|
+
invalid_properties.push('invalid value for "package_count", package_count cannot be nil.')
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if @version_count.nil?
|
|
101
|
+
invalid_properties.push('invalid value for "version_count", version_count cannot be nil.')
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if @build_count.nil?
|
|
105
|
+
invalid_properties.push('invalid value for "build_count", build_count cannot be nil.')
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
invalid_properties
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Check to see if the all the properties in the model are valid
|
|
112
|
+
# @return true if the model is valid
|
|
113
|
+
def valid?
|
|
114
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
115
|
+
return false if @package_count.nil?
|
|
116
|
+
return false if @version_count.nil?
|
|
117
|
+
return false if @build_count.nil?
|
|
118
|
+
true
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Checks equality by comparing each attribute.
|
|
122
|
+
# @param [Object] Object to be compared
|
|
123
|
+
def ==(o)
|
|
124
|
+
return true if self.equal?(o)
|
|
125
|
+
self.class == o.class &&
|
|
126
|
+
package_count == o.package_count &&
|
|
127
|
+
version_count == o.version_count &&
|
|
128
|
+
build_count == o.build_count
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# @see the `==` method
|
|
132
|
+
# @param [Object] Object to be compared
|
|
133
|
+
def eql?(o)
|
|
134
|
+
self == o
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Calculates hash code according to all attributes.
|
|
138
|
+
# @return [Integer] Hash code
|
|
139
|
+
def hash
|
|
140
|
+
[package_count, version_count, build_count].hash
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Builds the object from hash
|
|
144
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
145
|
+
# @return [Object] Returns the model itself
|
|
146
|
+
def self.build_from_hash(attributes)
|
|
147
|
+
return nil unless attributes.is_a?(Hash)
|
|
148
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
149
|
+
transformed_hash = {}
|
|
150
|
+
openapi_types.each_pair do |key, type|
|
|
151
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
152
|
+
transformed_hash["#{key}"] = nil
|
|
153
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
154
|
+
# check to ensure the input is an array given that the attribute
|
|
155
|
+
# is documented as an array but the input is not
|
|
156
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
157
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
158
|
+
end
|
|
159
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
160
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
new(transformed_hash)
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Deserializes the data based on type
|
|
167
|
+
# @param string type Data type
|
|
168
|
+
# @param string value Value to be deserialized
|
|
169
|
+
# @return [Object] Deserialized data
|
|
170
|
+
def self._deserialize(type, value)
|
|
171
|
+
case type.to_sym
|
|
172
|
+
when :Time
|
|
173
|
+
Time.parse(value)
|
|
174
|
+
when :Date
|
|
175
|
+
Date.parse(value)
|
|
176
|
+
when :String
|
|
177
|
+
value.to_s
|
|
178
|
+
when :Integer
|
|
179
|
+
value.to_i
|
|
180
|
+
when :Float
|
|
181
|
+
value.to_f
|
|
182
|
+
when :Boolean
|
|
183
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
184
|
+
true
|
|
185
|
+
else
|
|
186
|
+
false
|
|
187
|
+
end
|
|
188
|
+
when :Object
|
|
189
|
+
# generic object (usually a Hash), return directly
|
|
190
|
+
value
|
|
191
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
192
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
193
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
194
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
195
|
+
k_type = Regexp.last_match[:k_type]
|
|
196
|
+
v_type = Regexp.last_match[:v_type]
|
|
197
|
+
{}.tap do |hash|
|
|
198
|
+
value.each do |k, v|
|
|
199
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
200
|
+
end
|
|
201
|
+
end
|
|
202
|
+
else # model
|
|
203
|
+
# models (e.g. Pet) or oneOf
|
|
204
|
+
klass = PulpMavenClient.const_get(type)
|
|
205
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
# Returns the string representation of the object
|
|
210
|
+
# @return [String] String presentation of the object
|
|
211
|
+
def to_s
|
|
212
|
+
to_hash.to_s
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
216
|
+
# @return [Hash] Returns the object in the form of hash
|
|
217
|
+
def to_body
|
|
218
|
+
to_hash
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Returns the object in the form of hash
|
|
222
|
+
# @return [Hash] Returns the object in the form of hash
|
|
223
|
+
def to_hash
|
|
224
|
+
hash = {}
|
|
225
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
226
|
+
value = self.send(attr)
|
|
227
|
+
if value.nil?
|
|
228
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
229
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
hash[param] = _to_hash(value)
|
|
233
|
+
end
|
|
234
|
+
hash
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
# Outputs non-array value in the form of hash
|
|
238
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
239
|
+
# @param [Object] value Any valid value
|
|
240
|
+
# @return [Hash] Returns the value in the form of hash
|
|
241
|
+
def _to_hash(value)
|
|
242
|
+
if value.is_a?(Array)
|
|
243
|
+
value.compact.map { |v| _to_hash(v) }
|
|
244
|
+
elsif value.is_a?(Hash)
|
|
245
|
+
{}.tap do |hash|
|
|
246
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
247
|
+
end
|
|
248
|
+
elsif value.respond_to? :to_hash
|
|
249
|
+
value.to_hash
|
|
250
|
+
else
|
|
251
|
+
value
|
|
252
|
+
end
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
end
|