pulp_maven_client 0.25.1 → 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
|
@@ -0,0 +1,278 @@
|
|
|
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 distinct (group_id, artifact_id) in a repository version.
|
|
18
|
+
class MavenRepositoryPackageResponse
|
|
19
|
+
# Maven groupId. Index rows are unique on GA.
|
|
20
|
+
attr_accessor :group_id
|
|
21
|
+
|
|
22
|
+
# Maven artifactId. Index rows are unique on GA.
|
|
23
|
+
attr_accessor :artifact_id
|
|
24
|
+
|
|
25
|
+
# Distinct logical version keys after rebuild-suffix strip. The set of values matches latest_releases[].version.
|
|
26
|
+
attr_accessor :versions
|
|
27
|
+
|
|
28
|
+
# Newest rebuild per logical version (latest pulp_created). set(versions) === set(latest_releases[].version).
|
|
29
|
+
attr_accessor :latest_releases
|
|
30
|
+
|
|
31
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
32
|
+
def self.attribute_map
|
|
33
|
+
{
|
|
34
|
+
:'group_id' => :'group_id',
|
|
35
|
+
:'artifact_id' => :'artifact_id',
|
|
36
|
+
:'versions' => :'versions',
|
|
37
|
+
:'latest_releases' => :'latest_releases'
|
|
38
|
+
}
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Returns all the JSON keys this model knows about
|
|
42
|
+
def self.acceptable_attributes
|
|
43
|
+
attribute_map.values
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Attribute type mapping.
|
|
47
|
+
def self.openapi_types
|
|
48
|
+
{
|
|
49
|
+
:'group_id' => :'String',
|
|
50
|
+
:'artifact_id' => :'String',
|
|
51
|
+
:'versions' => :'Array<String>',
|
|
52
|
+
:'latest_releases' => :'Array<MavenPackageReleaseResponse>'
|
|
53
|
+
}
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# List of attributes with nullable: true
|
|
57
|
+
def self.openapi_nullable
|
|
58
|
+
Set.new([
|
|
59
|
+
])
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Initializes the object
|
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
64
|
+
def initialize(attributes = {})
|
|
65
|
+
if (!attributes.is_a?(Hash))
|
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpMavenClient::MavenRepositoryPackageResponse` initialize method"
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
71
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
72
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpMavenClient::MavenRepositoryPackageResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
73
|
+
end
|
|
74
|
+
h[k.to_sym] = v
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if attributes.key?(:'group_id')
|
|
78
|
+
self.group_id = attributes[:'group_id']
|
|
79
|
+
else
|
|
80
|
+
self.group_id = nil
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
if attributes.key?(:'artifact_id')
|
|
84
|
+
self.artifact_id = attributes[:'artifact_id']
|
|
85
|
+
else
|
|
86
|
+
self.artifact_id = nil
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
if attributes.key?(:'versions')
|
|
90
|
+
if (value = attributes[:'versions']).is_a?(Array)
|
|
91
|
+
self.versions = value
|
|
92
|
+
end
|
|
93
|
+
else
|
|
94
|
+
self.versions = nil
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
if attributes.key?(:'latest_releases')
|
|
98
|
+
if (value = attributes[:'latest_releases']).is_a?(Array)
|
|
99
|
+
self.latest_releases = value
|
|
100
|
+
end
|
|
101
|
+
else
|
|
102
|
+
self.latest_releases = nil
|
|
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
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
110
|
+
invalid_properties = Array.new
|
|
111
|
+
if @group_id.nil?
|
|
112
|
+
invalid_properties.push('invalid value for "group_id", group_id cannot be nil.')
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if @artifact_id.nil?
|
|
116
|
+
invalid_properties.push('invalid value for "artifact_id", artifact_id cannot be nil.')
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
if @versions.nil?
|
|
120
|
+
invalid_properties.push('invalid value for "versions", versions cannot be nil.')
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
if @latest_releases.nil?
|
|
124
|
+
invalid_properties.push('invalid value for "latest_releases", latest_releases cannot be nil.')
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
invalid_properties
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Check to see if the all the properties in the model are valid
|
|
131
|
+
# @return true if the model is valid
|
|
132
|
+
def valid?
|
|
133
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
134
|
+
return false if @group_id.nil?
|
|
135
|
+
return false if @artifact_id.nil?
|
|
136
|
+
return false if @versions.nil?
|
|
137
|
+
return false if @latest_releases.nil?
|
|
138
|
+
true
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Checks equality by comparing each attribute.
|
|
142
|
+
# @param [Object] Object to be compared
|
|
143
|
+
def ==(o)
|
|
144
|
+
return true if self.equal?(o)
|
|
145
|
+
self.class == o.class &&
|
|
146
|
+
group_id == o.group_id &&
|
|
147
|
+
artifact_id == o.artifact_id &&
|
|
148
|
+
versions == o.versions &&
|
|
149
|
+
latest_releases == o.latest_releases
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# @see the `==` method
|
|
153
|
+
# @param [Object] Object to be compared
|
|
154
|
+
def eql?(o)
|
|
155
|
+
self == o
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Calculates hash code according to all attributes.
|
|
159
|
+
# @return [Integer] Hash code
|
|
160
|
+
def hash
|
|
161
|
+
[group_id, artifact_id, versions, latest_releases].hash
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Builds the object from hash
|
|
165
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
166
|
+
# @return [Object] Returns the model itself
|
|
167
|
+
def self.build_from_hash(attributes)
|
|
168
|
+
return nil unless attributes.is_a?(Hash)
|
|
169
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
170
|
+
transformed_hash = {}
|
|
171
|
+
openapi_types.each_pair do |key, type|
|
|
172
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
173
|
+
transformed_hash["#{key}"] = nil
|
|
174
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
175
|
+
# check to ensure the input is an array given that the attribute
|
|
176
|
+
# is documented as an array but the input is not
|
|
177
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
178
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
179
|
+
end
|
|
180
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
181
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
182
|
+
end
|
|
183
|
+
end
|
|
184
|
+
new(transformed_hash)
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Deserializes the data based on type
|
|
188
|
+
# @param string type Data type
|
|
189
|
+
# @param string value Value to be deserialized
|
|
190
|
+
# @return [Object] Deserialized data
|
|
191
|
+
def self._deserialize(type, value)
|
|
192
|
+
case type.to_sym
|
|
193
|
+
when :Time
|
|
194
|
+
Time.parse(value)
|
|
195
|
+
when :Date
|
|
196
|
+
Date.parse(value)
|
|
197
|
+
when :String
|
|
198
|
+
value.to_s
|
|
199
|
+
when :Integer
|
|
200
|
+
value.to_i
|
|
201
|
+
when :Float
|
|
202
|
+
value.to_f
|
|
203
|
+
when :Boolean
|
|
204
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
205
|
+
true
|
|
206
|
+
else
|
|
207
|
+
false
|
|
208
|
+
end
|
|
209
|
+
when :Object
|
|
210
|
+
# generic object (usually a Hash), return directly
|
|
211
|
+
value
|
|
212
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
213
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
214
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
215
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
216
|
+
k_type = Regexp.last_match[:k_type]
|
|
217
|
+
v_type = Regexp.last_match[:v_type]
|
|
218
|
+
{}.tap do |hash|
|
|
219
|
+
value.each do |k, v|
|
|
220
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
else # model
|
|
224
|
+
# models (e.g. Pet) or oneOf
|
|
225
|
+
klass = PulpMavenClient.const_get(type)
|
|
226
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
227
|
+
end
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
# Returns the string representation of the object
|
|
231
|
+
# @return [String] String presentation of the object
|
|
232
|
+
def to_s
|
|
233
|
+
to_hash.to_s
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
237
|
+
# @return [Hash] Returns the object in the form of hash
|
|
238
|
+
def to_body
|
|
239
|
+
to_hash
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
# Returns the object in the form of hash
|
|
243
|
+
# @return [Hash] Returns the object in the form of hash
|
|
244
|
+
def to_hash
|
|
245
|
+
hash = {}
|
|
246
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
247
|
+
value = self.send(attr)
|
|
248
|
+
if value.nil?
|
|
249
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
250
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
hash[param] = _to_hash(value)
|
|
254
|
+
end
|
|
255
|
+
hash
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# Outputs non-array value in the form of hash
|
|
259
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
260
|
+
# @param [Object] value Any valid value
|
|
261
|
+
# @return [Hash] Returns the value in the form of hash
|
|
262
|
+
def _to_hash(value)
|
|
263
|
+
if value.is_a?(Array)
|
|
264
|
+
value.compact.map { |v| _to_hash(v) }
|
|
265
|
+
elsif value.is_a?(Hash)
|
|
266
|
+
{}.tap do |hash|
|
|
267
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
268
|
+
end
|
|
269
|
+
elsif value.respond_to? :to_hash
|
|
270
|
+
value.to_hash
|
|
271
|
+
else
|
|
272
|
+
value
|
|
273
|
+
end
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
end
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module PulpMavenClient
|
|
17
|
-
# Serializer to add/remove object roles to/from users/groups. This is used in conjunction with
|
|
17
|
+
# Serializer to add/remove object roles to/from users/groups. This is used in conjunction with `pulpcore.app.viewsets.base.RolesMixin` and requires the underlying object to be passed as `content_object` in the context.
|
|
18
18
|
class NestedRole
|
|
19
19
|
attr_accessor :users
|
|
20
20
|
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module PulpMavenClient
|
|
17
|
-
# Serializer to add/remove object roles to/from users/groups. This is used in conjunction with
|
|
17
|
+
# Serializer to add/remove object roles to/from users/groups. This is used in conjunction with `pulpcore.app.viewsets.base.RolesMixin` and requires the underlying object to be passed as `content_object` in the context.
|
|
18
18
|
class NestedRoleResponse
|
|
19
19
|
attr_accessor :users
|
|
20
20
|
|
|
@@ -0,0 +1,263 @@
|
|
|
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
|
+
class PaginatedMavenRepositoryPackageListResponse
|
|
18
|
+
attr_accessor :count
|
|
19
|
+
|
|
20
|
+
attr_accessor :_next
|
|
21
|
+
|
|
22
|
+
attr_accessor :previous
|
|
23
|
+
|
|
24
|
+
attr_accessor :results
|
|
25
|
+
|
|
26
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
27
|
+
def self.attribute_map
|
|
28
|
+
{
|
|
29
|
+
:'count' => :'count',
|
|
30
|
+
:'_next' => :'next',
|
|
31
|
+
:'previous' => :'previous',
|
|
32
|
+
:'results' => :'results'
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns all the JSON keys this model knows about
|
|
37
|
+
def self.acceptable_attributes
|
|
38
|
+
attribute_map.values
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Attribute type mapping.
|
|
42
|
+
def self.openapi_types
|
|
43
|
+
{
|
|
44
|
+
:'count' => :'Integer',
|
|
45
|
+
:'_next' => :'String',
|
|
46
|
+
:'previous' => :'String',
|
|
47
|
+
:'results' => :'Array<MavenRepositoryPackageResponse>'
|
|
48
|
+
}
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# List of attributes with nullable: true
|
|
52
|
+
def self.openapi_nullable
|
|
53
|
+
Set.new([
|
|
54
|
+
:'_next',
|
|
55
|
+
:'previous',
|
|
56
|
+
])
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Initializes the object
|
|
60
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
61
|
+
def initialize(attributes = {})
|
|
62
|
+
if (!attributes.is_a?(Hash))
|
|
63
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpMavenClient::PaginatedMavenRepositoryPackageListResponse` initialize method"
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
67
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
68
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
69
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpMavenClient::PaginatedMavenRepositoryPackageListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
70
|
+
end
|
|
71
|
+
h[k.to_sym] = v
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if attributes.key?(:'count')
|
|
75
|
+
self.count = attributes[:'count']
|
|
76
|
+
else
|
|
77
|
+
self.count = nil
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
if attributes.key?(:'_next')
|
|
81
|
+
self._next = attributes[:'_next']
|
|
82
|
+
else
|
|
83
|
+
self._next = nil
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
if attributes.key?(:'previous')
|
|
87
|
+
self.previous = attributes[:'previous']
|
|
88
|
+
else
|
|
89
|
+
self.previous = nil
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'results')
|
|
93
|
+
if (value = attributes[:'results']).is_a?(Array)
|
|
94
|
+
self.results = value
|
|
95
|
+
end
|
|
96
|
+
else
|
|
97
|
+
self.results = nil
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
102
|
+
# @return Array for valid properties with the reasons
|
|
103
|
+
def list_invalid_properties
|
|
104
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
105
|
+
invalid_properties = Array.new
|
|
106
|
+
if @count.nil?
|
|
107
|
+
invalid_properties.push('invalid value for "count", count cannot be nil.')
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if @results.nil?
|
|
111
|
+
invalid_properties.push('invalid value for "results", results cannot be nil.')
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
invalid_properties
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Check to see if the all the properties in the model are valid
|
|
118
|
+
# @return true if the model is valid
|
|
119
|
+
def valid?
|
|
120
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
121
|
+
return false if @count.nil?
|
|
122
|
+
return false if @results.nil?
|
|
123
|
+
true
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Checks equality by comparing each attribute.
|
|
127
|
+
# @param [Object] Object to be compared
|
|
128
|
+
def ==(o)
|
|
129
|
+
return true if self.equal?(o)
|
|
130
|
+
self.class == o.class &&
|
|
131
|
+
count == o.count &&
|
|
132
|
+
_next == o._next &&
|
|
133
|
+
previous == o.previous &&
|
|
134
|
+
results == o.results
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# @see the `==` method
|
|
138
|
+
# @param [Object] Object to be compared
|
|
139
|
+
def eql?(o)
|
|
140
|
+
self == o
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Calculates hash code according to all attributes.
|
|
144
|
+
# @return [Integer] Hash code
|
|
145
|
+
def hash
|
|
146
|
+
[count, _next, previous, results].hash
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Builds the object from hash
|
|
150
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
151
|
+
# @return [Object] Returns the model itself
|
|
152
|
+
def self.build_from_hash(attributes)
|
|
153
|
+
return nil unless attributes.is_a?(Hash)
|
|
154
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
155
|
+
transformed_hash = {}
|
|
156
|
+
openapi_types.each_pair do |key, type|
|
|
157
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
158
|
+
transformed_hash["#{key}"] = nil
|
|
159
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
160
|
+
# check to ensure the input is an array given that the attribute
|
|
161
|
+
# is documented as an array but the input is not
|
|
162
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
163
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
164
|
+
end
|
|
165
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
166
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
new(transformed_hash)
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Deserializes the data based on type
|
|
173
|
+
# @param string type Data type
|
|
174
|
+
# @param string value Value to be deserialized
|
|
175
|
+
# @return [Object] Deserialized data
|
|
176
|
+
def self._deserialize(type, value)
|
|
177
|
+
case type.to_sym
|
|
178
|
+
when :Time
|
|
179
|
+
Time.parse(value)
|
|
180
|
+
when :Date
|
|
181
|
+
Date.parse(value)
|
|
182
|
+
when :String
|
|
183
|
+
value.to_s
|
|
184
|
+
when :Integer
|
|
185
|
+
value.to_i
|
|
186
|
+
when :Float
|
|
187
|
+
value.to_f
|
|
188
|
+
when :Boolean
|
|
189
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
190
|
+
true
|
|
191
|
+
else
|
|
192
|
+
false
|
|
193
|
+
end
|
|
194
|
+
when :Object
|
|
195
|
+
# generic object (usually a Hash), return directly
|
|
196
|
+
value
|
|
197
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
198
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
199
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
200
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
201
|
+
k_type = Regexp.last_match[:k_type]
|
|
202
|
+
v_type = Regexp.last_match[:v_type]
|
|
203
|
+
{}.tap do |hash|
|
|
204
|
+
value.each do |k, v|
|
|
205
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
else # model
|
|
209
|
+
# models (e.g. Pet) or oneOf
|
|
210
|
+
klass = PulpMavenClient.const_get(type)
|
|
211
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
212
|
+
end
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# Returns the string representation of the object
|
|
216
|
+
# @return [String] String presentation of the object
|
|
217
|
+
def to_s
|
|
218
|
+
to_hash.to_s
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
222
|
+
# @return [Hash] Returns the object in the form of hash
|
|
223
|
+
def to_body
|
|
224
|
+
to_hash
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# Returns the object in the form of hash
|
|
228
|
+
# @return [Hash] Returns the object in the form of hash
|
|
229
|
+
def to_hash
|
|
230
|
+
hash = {}
|
|
231
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
232
|
+
value = self.send(attr)
|
|
233
|
+
if value.nil?
|
|
234
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
235
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
hash[param] = _to_hash(value)
|
|
239
|
+
end
|
|
240
|
+
hash
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
# Outputs non-array value in the form of hash
|
|
244
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
245
|
+
# @param [Object] value Any valid value
|
|
246
|
+
# @return [Hash] Returns the value in the form of hash
|
|
247
|
+
def _to_hash(value)
|
|
248
|
+
if value.is_a?(Array)
|
|
249
|
+
value.compact.map { |v| _to_hash(v) }
|
|
250
|
+
elsif value.is_a?(Hash)
|
|
251
|
+
{}.tap do |hash|
|
|
252
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
253
|
+
end
|
|
254
|
+
elsif value.respond_to? :to_hash
|
|
255
|
+
value.to_hash
|
|
256
|
+
else
|
|
257
|
+
value
|
|
258
|
+
end
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
end
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module PulpMavenClient
|
|
17
|
-
# Base serializer for use with [pulpcore.app.models.Model][] This ensures that all Serializers provide values for the 'pulp_href` field. The class provides a default for the
|
|
17
|
+
# Base serializer for use with [pulpcore.app.models.Model][] This ensures that all Serializers provide values for the 'pulp_href` field. The class provides a default for the `ref_name` attribute in the ModelSerializers's `Meta` class. This ensures that the OpenAPI definitions of plugins are namespaced properly.
|
|
18
18
|
class RepositoryAddRemoveContent
|
|
19
19
|
# A list of content units to add to a new repository version. This content is added after remove_content_units are removed.
|
|
20
20
|
attr_accessor :add_content_units
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module PulpMavenClient
|
|
17
|
-
# Base serializer for use with [pulpcore.app.models.Model][] This ensures that all Serializers provide values for the 'pulp_href` field. The class provides a default for the
|
|
17
|
+
# Base serializer for use with [pulpcore.app.models.Model][] This ensures that all Serializers provide values for the 'pulp_href` field. The class provides a default for the `ref_name` attribute in the ModelSerializers's `Meta` class. This ensures that the OpenAPI definitions of plugins are namespaced properly.
|
|
18
18
|
class RepositoryVersionResponse
|
|
19
19
|
attr_accessor :pulp_href
|
|
20
20
|
|
data/lib/pulp_maven_client.rb
CHANGED
|
@@ -29,10 +29,14 @@ require 'pulp_maven_client/models/maven_maven_remote_response'
|
|
|
29
29
|
require 'pulp_maven_client/models/maven_maven_remote_response_hidden_fields_inner'
|
|
30
30
|
require 'pulp_maven_client/models/maven_maven_repository'
|
|
31
31
|
require 'pulp_maven_client/models/maven_maven_repository_response'
|
|
32
|
+
require 'pulp_maven_client/models/maven_package_release_response'
|
|
33
|
+
require 'pulp_maven_client/models/maven_repository_metrics_response'
|
|
34
|
+
require 'pulp_maven_client/models/maven_repository_package_response'
|
|
32
35
|
require 'pulp_maven_client/models/my_permissions_response'
|
|
33
36
|
require 'pulp_maven_client/models/nested_role'
|
|
34
37
|
require 'pulp_maven_client/models/nested_role_response'
|
|
35
38
|
require 'pulp_maven_client/models/object_roles_response'
|
|
39
|
+
require 'pulp_maven_client/models/paginated_maven_repository_package_list_response'
|
|
36
40
|
require 'pulp_maven_client/models/paginated_repository_version_response_list'
|
|
37
41
|
require 'pulp_maven_client/models/paginatedmaven_maven_artifact_response_list'
|
|
38
42
|
require 'pulp_maven_client/models/paginatedmaven_maven_distribution_response_list'
|
|
@@ -38,6 +38,8 @@ describe 'ContentPackageApi' do
|
|
|
38
38
|
# @param [Hash] opts the optional parameters
|
|
39
39
|
# @option opts [Array<String>] :x_task_diagnostics List of profilers to use on tasks.
|
|
40
40
|
# @option opts [String] :artifact_id Filter results where artifact_id matches value
|
|
41
|
+
# @option opts [String] :base_version Match units whose version strips to this logical version (same suffix as collapse_builds: \\.[a-zA-Z]+-\\d+$). 5.3.18 matches 5.3.18 and 5.3.18.rhlw-00003, but not 5.3.180.
|
|
42
|
+
# @option opts [Boolean] :collapse_builds When true, collapse rebuilds of the same logical version: strip a trailing suffix matching \\.[a-zA-Z]+-\\d+$ from version, then keep one MavenPackage per (group_id, artifact_id, base_version) with the latest pulp_created. Default false.
|
|
41
43
|
# @option opts [String] :group_id Filter results where group_id matches value
|
|
42
44
|
# @option opts [Integer] :limit Number of results to return per page.
|
|
43
45
|
# @option opts [String] :name Filter results where name matches value
|
|
@@ -54,6 +56,7 @@ describe 'ContentPackageApi' do
|
|
|
54
56
|
# @option opts [String] :repository_version_added
|
|
55
57
|
# @option opts [String] :repository_version_removed
|
|
56
58
|
# @option opts [String] :version Filter results where version matches value
|
|
59
|
+
# @option opts [String] :version__startswith Filter results where version starts with value
|
|
57
60
|
# @option opts [Array<String>] :fields A list of fields to include in the response.
|
|
58
61
|
# @option opts [Array<String>] :exclude_fields A list of fields to exclude from the response.
|
|
59
62
|
# @return [PaginatedmavenMavenPackageResponseList]
|
|
@@ -151,6 +151,22 @@ describe 'RepositoriesMavenApi' do
|
|
|
151
151
|
end
|
|
152
152
|
end
|
|
153
153
|
|
|
154
|
+
# unit tests for metrics
|
|
155
|
+
# Repository metrics
|
|
156
|
+
# Distinct counts for MavenPackage content in a repository version (latest complete version if repository_version is omitted). package_count is distinct (group_id, artifact_id). version_count is distinct (group_id, artifact_id, base_version) after rebuild-suffix strip. build_count is distinct (group_id, artifact_id, full version). Counts use MavenPackage (POM-backed GAV), not MavenArtifact files.
|
|
157
|
+
# @param maven_maven_repository_href
|
|
158
|
+
# @param [Hash] opts the optional parameters
|
|
159
|
+
# @option opts [Array<String>] :x_task_diagnostics List of profilers to use on tasks.
|
|
160
|
+
# @option opts [String] :repository_version HREF or PRN of a version of this repository. Defaults to the latest complete version.
|
|
161
|
+
# @option opts [Array<String>] :fields A list of fields to include in the response.
|
|
162
|
+
# @option opts [Array<String>] :exclude_fields A list of fields to exclude from the response.
|
|
163
|
+
# @return [MavenRepositoryMetricsResponse]
|
|
164
|
+
describe 'metrics test' do
|
|
165
|
+
it 'should work' do
|
|
166
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
|
|
154
170
|
# unit tests for modify
|
|
155
171
|
# Modify Repository Content
|
|
156
172
|
# Trigger an asynchronous task to create a new repository version.
|
|
@@ -180,6 +196,24 @@ describe 'RepositoriesMavenApi' do
|
|
|
180
196
|
end
|
|
181
197
|
end
|
|
182
198
|
|
|
199
|
+
# unit tests for packages
|
|
200
|
+
# List packages
|
|
201
|
+
# Return one row per distinct (group_id, artifact_id) in a repository version (latest complete version if repository_version is omitted). Pagination count is the number of distinct packages, not GAVs. Each row includes versions (logical version keys after rebuild-suffix strip) and latest_releases (newest rebuild per logical version). set(versions) === set(latest_releases[].version).
|
|
202
|
+
# @param maven_maven_repository_href
|
|
203
|
+
# @param [Hash] opts the optional parameters
|
|
204
|
+
# @option opts [Array<String>] :x_task_diagnostics List of profilers to use on tasks.
|
|
205
|
+
# @option opts [String] :artifact_id__istartswith Case-insensitive prefix on artifact_id.
|
|
206
|
+
# @option opts [String] :group_id__istartswith Case-insensitive prefix on group_id.
|
|
207
|
+
# @option opts [String] :repository_version HREF or PRN of a version of this repository. Defaults to the latest complete version.
|
|
208
|
+
# @option opts [Array<String>] :fields A list of fields to include in the response.
|
|
209
|
+
# @option opts [Array<String>] :exclude_fields A list of fields to exclude from the response.
|
|
210
|
+
# @return [PaginatedMavenRepositoryPackageListResponse]
|
|
211
|
+
describe 'packages test' do
|
|
212
|
+
it 'should work' do
|
|
213
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
214
|
+
end
|
|
215
|
+
end
|
|
216
|
+
|
|
183
217
|
# unit tests for partial_update
|
|
184
218
|
# Update a maven repository
|
|
185
219
|
# Update the entity partially and trigger an asynchronous task if necessary
|
|
@@ -81,6 +81,12 @@ describe PulpMavenClient::MavenMavenPackageResponse do
|
|
|
81
81
|
end
|
|
82
82
|
end
|
|
83
83
|
|
|
84
|
+
describe 'test attribute "base_version"' do
|
|
85
|
+
it 'should work' do
|
|
86
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
|
|
84
90
|
describe 'test attribute "name"' do
|
|
85
91
|
it 'should work' do
|
|
86
92
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|