pulp_maven_client 0.24.1 → 0.25.1

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.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +26 -4
  3. data/docs/ContentPackageApi.md +351 -0
  4. data/docs/DistributionsMavenApi.md +312 -0
  5. data/docs/MavenMavenPackageResponse.md +48 -0
  6. data/docs/MyPermissionsResponse.md +18 -0
  7. data/docs/NestedRole.md +22 -0
  8. data/docs/NestedRoleResponse.md +22 -0
  9. data/docs/ObjectRolesResponse.md +18 -0
  10. data/docs/PaginatedmavenMavenPackageResponseList.md +24 -0
  11. data/docs/RemotesMavenApi.md +312 -0
  12. data/docs/RepositoriesMavenApi.md +315 -3
  13. data/lib/pulp_maven_client/api/content_package_api.rb +369 -0
  14. data/lib/pulp_maven_client/api/distributions_maven_api.rb +298 -0
  15. data/lib/pulp_maven_client/api/remotes_maven_api.rb +298 -0
  16. data/lib/pulp_maven_client/api/repositories_maven_api.rb +304 -6
  17. data/lib/pulp_maven_client/models/maven_maven_package_response.rb +371 -0
  18. data/lib/pulp_maven_client/models/my_permissions_response.rb +223 -0
  19. data/lib/pulp_maven_client/models/nested_role.rb +263 -0
  20. data/lib/pulp_maven_client/models/nested_role_response.rb +244 -0
  21. data/lib/pulp_maven_client/models/object_roles_response.rb +223 -0
  22. data/lib/pulp_maven_client/models/paginatedmaven_maven_package_response_list.rb +257 -0
  23. data/lib/pulp_maven_client/version.rb +1 -1
  24. data/lib/pulp_maven_client.rb +7 -0
  25. data/spec/api/content_package_api_spec.rb +109 -0
  26. data/spec/api/distributions_maven_api_spec.rb +58 -0
  27. data/spec/api/remotes_maven_api_spec.rb +58 -0
  28. data/spec/api/repositories_maven_api_spec.rb +61 -3
  29. data/spec/models/maven_maven_package_response_spec.rb +126 -0
  30. data/spec/models/my_permissions_response_spec.rb +36 -0
  31. data/spec/models/nested_role_response_spec.rb +48 -0
  32. data/spec/models/nested_role_spec.rb +48 -0
  33. data/spec/models/object_roles_response_spec.rb +36 -0
  34. data/spec/models/paginatedmaven_maven_package_response_list_spec.rb +54 -0
  35. metadata +56 -28
@@ -0,0 +1,371 @@
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
+ # A read-only Serializer for MavenPackage.
18
+ class MavenMavenPackageResponse
19
+ attr_accessor :pulp_href
20
+
21
+ # The Pulp Resource Name (PRN).
22
+ attr_accessor :prn
23
+
24
+ # Timestamp of creation.
25
+ attr_accessor :pulp_created
26
+
27
+ # Timestamp of the last time this resource was updated. Note: for immutable resources - like content, repository versions, and publication - pulp_created and pulp_last_updated dates will be the same.
28
+ attr_accessor :pulp_last_updated
29
+
30
+ # A dictionary of arbitrary key/value pairs used to describe a specific Content instance.
31
+ attr_accessor :pulp_labels
32
+
33
+ attr_accessor :vuln_report
34
+
35
+ # Group Id of the package.
36
+ attr_accessor :group_id
37
+
38
+ # Artifact Id of the package.
39
+ attr_accessor :artifact_id
40
+
41
+ # Version of the package.
42
+ attr_accessor :version
43
+
44
+ # Human-readable name from the POM.
45
+ attr_accessor :name
46
+
47
+ # Description from the POM.
48
+ attr_accessor :description
49
+
50
+ # Packaging type (jar, war, pom, etc).
51
+ attr_accessor :packaging
52
+
53
+ # Project URL from the POM.
54
+ attr_accessor :url
55
+
56
+ attr_accessor :licenses
57
+
58
+ attr_accessor :dependencies
59
+
60
+ # Source control URL from the POM.
61
+ attr_accessor :scm_url
62
+
63
+ # Attribute mapping from ruby-style variable name to JSON key.
64
+ def self.attribute_map
65
+ {
66
+ :'pulp_href' => :'pulp_href',
67
+ :'prn' => :'prn',
68
+ :'pulp_created' => :'pulp_created',
69
+ :'pulp_last_updated' => :'pulp_last_updated',
70
+ :'pulp_labels' => :'pulp_labels',
71
+ :'vuln_report' => :'vuln_report',
72
+ :'group_id' => :'group_id',
73
+ :'artifact_id' => :'artifact_id',
74
+ :'version' => :'version',
75
+ :'name' => :'name',
76
+ :'description' => :'description',
77
+ :'packaging' => :'packaging',
78
+ :'url' => :'url',
79
+ :'licenses' => :'licenses',
80
+ :'dependencies' => :'dependencies',
81
+ :'scm_url' => :'scm_url'
82
+ }
83
+ end
84
+
85
+ # Returns all the JSON keys this model knows about
86
+ def self.acceptable_attributes
87
+ attribute_map.values
88
+ end
89
+
90
+ # Attribute type mapping.
91
+ def self.openapi_types
92
+ {
93
+ :'pulp_href' => :'String',
94
+ :'prn' => :'String',
95
+ :'pulp_created' => :'Time',
96
+ :'pulp_last_updated' => :'Time',
97
+ :'pulp_labels' => :'Hash<String, String>',
98
+ :'vuln_report' => :'String',
99
+ :'group_id' => :'String',
100
+ :'artifact_id' => :'String',
101
+ :'version' => :'String',
102
+ :'name' => :'String',
103
+ :'description' => :'String',
104
+ :'packaging' => :'String',
105
+ :'url' => :'String',
106
+ :'licenses' => :'Object',
107
+ :'dependencies' => :'Object',
108
+ :'scm_url' => :'String'
109
+ }
110
+ end
111
+
112
+ # List of attributes with nullable: true
113
+ def self.openapi_nullable
114
+ Set.new([
115
+ :'name',
116
+ :'description',
117
+ :'packaging',
118
+ :'url',
119
+ :'licenses',
120
+ :'dependencies',
121
+ :'scm_url'
122
+ ])
123
+ end
124
+
125
+ # Initializes the object
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ def initialize(attributes = {})
128
+ if (!attributes.is_a?(Hash))
129
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpMavenClient::MavenMavenPackageResponse` initialize method"
130
+ end
131
+
132
+ # check to see if the attribute exists and convert string to symbol for hash key
133
+ attributes = attributes.each_with_object({}) { |(k, v), h|
134
+ if (!self.class.attribute_map.key?(k.to_sym))
135
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpMavenClient::MavenMavenPackageResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
136
+ end
137
+ h[k.to_sym] = v
138
+ }
139
+
140
+ if attributes.key?(:'pulp_href')
141
+ self.pulp_href = attributes[:'pulp_href']
142
+ end
143
+
144
+ if attributes.key?(:'prn')
145
+ self.prn = attributes[:'prn']
146
+ end
147
+
148
+ if attributes.key?(:'pulp_created')
149
+ self.pulp_created = attributes[:'pulp_created']
150
+ end
151
+
152
+ if attributes.key?(:'pulp_last_updated')
153
+ self.pulp_last_updated = attributes[:'pulp_last_updated']
154
+ end
155
+
156
+ if attributes.key?(:'pulp_labels')
157
+ if (value = attributes[:'pulp_labels']).is_a?(Hash)
158
+ self.pulp_labels = value
159
+ end
160
+ end
161
+
162
+ if attributes.key?(:'vuln_report')
163
+ self.vuln_report = attributes[:'vuln_report']
164
+ end
165
+
166
+ if attributes.key?(:'group_id')
167
+ self.group_id = attributes[:'group_id']
168
+ end
169
+
170
+ if attributes.key?(:'artifact_id')
171
+ self.artifact_id = attributes[:'artifact_id']
172
+ end
173
+
174
+ if attributes.key?(:'version')
175
+ self.version = attributes[:'version']
176
+ end
177
+
178
+ if attributes.key?(:'name')
179
+ self.name = attributes[:'name']
180
+ end
181
+
182
+ if attributes.key?(:'description')
183
+ self.description = attributes[:'description']
184
+ end
185
+
186
+ if attributes.key?(:'packaging')
187
+ self.packaging = attributes[:'packaging']
188
+ end
189
+
190
+ if attributes.key?(:'url')
191
+ self.url = attributes[:'url']
192
+ end
193
+
194
+ if attributes.key?(:'licenses')
195
+ self.licenses = attributes[:'licenses']
196
+ end
197
+
198
+ if attributes.key?(:'dependencies')
199
+ self.dependencies = attributes[:'dependencies']
200
+ end
201
+
202
+ if attributes.key?(:'scm_url')
203
+ self.scm_url = attributes[:'scm_url']
204
+ end
205
+ end
206
+
207
+ # Show invalid properties with the reasons. Usually used together with valid?
208
+ # @return Array for valid properties with the reasons
209
+ def list_invalid_properties
210
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
211
+ invalid_properties = Array.new
212
+ invalid_properties
213
+ end
214
+
215
+ # Check to see if the all the properties in the model are valid
216
+ # @return true if the model is valid
217
+ def valid?
218
+ warn '[DEPRECATED] the `valid?` method is obsolete'
219
+ true
220
+ end
221
+
222
+ # Checks equality by comparing each attribute.
223
+ # @param [Object] Object to be compared
224
+ def ==(o)
225
+ return true if self.equal?(o)
226
+ self.class == o.class &&
227
+ pulp_href == o.pulp_href &&
228
+ prn == o.prn &&
229
+ pulp_created == o.pulp_created &&
230
+ pulp_last_updated == o.pulp_last_updated &&
231
+ pulp_labels == o.pulp_labels &&
232
+ vuln_report == o.vuln_report &&
233
+ group_id == o.group_id &&
234
+ artifact_id == o.artifact_id &&
235
+ version == o.version &&
236
+ name == o.name &&
237
+ description == o.description &&
238
+ packaging == o.packaging &&
239
+ url == o.url &&
240
+ licenses == o.licenses &&
241
+ dependencies == o.dependencies &&
242
+ scm_url == o.scm_url
243
+ end
244
+
245
+ # @see the `==` method
246
+ # @param [Object] Object to be compared
247
+ def eql?(o)
248
+ self == o
249
+ end
250
+
251
+ # Calculates hash code according to all attributes.
252
+ # @return [Integer] Hash code
253
+ 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
255
+ end
256
+
257
+ # Builds the object from hash
258
+ # @param [Hash] attributes Model attributes in the form of hash
259
+ # @return [Object] Returns the model itself
260
+ def self.build_from_hash(attributes)
261
+ return nil unless attributes.is_a?(Hash)
262
+ attributes = attributes.transform_keys(&:to_sym)
263
+ transformed_hash = {}
264
+ openapi_types.each_pair do |key, type|
265
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
266
+ transformed_hash["#{key}"] = nil
267
+ elsif type =~ /\AArray<(.*)>/i
268
+ # check to ensure the input is an array given that the attribute
269
+ # is documented as an array but the input is not
270
+ if attributes[attribute_map[key]].is_a?(Array)
271
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
272
+ end
273
+ elsif !attributes[attribute_map[key]].nil?
274
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
275
+ end
276
+ end
277
+ new(transformed_hash)
278
+ end
279
+
280
+ # Deserializes the data based on type
281
+ # @param string type Data type
282
+ # @param string value Value to be deserialized
283
+ # @return [Object] Deserialized data
284
+ def self._deserialize(type, value)
285
+ case type.to_sym
286
+ when :Time
287
+ Time.parse(value)
288
+ when :Date
289
+ Date.parse(value)
290
+ when :String
291
+ value.to_s
292
+ when :Integer
293
+ value.to_i
294
+ when :Float
295
+ value.to_f
296
+ when :Boolean
297
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
298
+ true
299
+ else
300
+ false
301
+ end
302
+ when :Object
303
+ # generic object (usually a Hash), return directly
304
+ value
305
+ when /\AArray<(?<inner_type>.+)>\z/
306
+ inner_type = Regexp.last_match[:inner_type]
307
+ value.map { |v| _deserialize(inner_type, v) }
308
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
309
+ k_type = Regexp.last_match[:k_type]
310
+ v_type = Regexp.last_match[:v_type]
311
+ {}.tap do |hash|
312
+ value.each do |k, v|
313
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
314
+ end
315
+ end
316
+ else # model
317
+ # models (e.g. Pet) or oneOf
318
+ klass = PulpMavenClient.const_get(type)
319
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
320
+ end
321
+ end
322
+
323
+ # Returns the string representation of the object
324
+ # @return [String] String presentation of the object
325
+ def to_s
326
+ to_hash.to_s
327
+ end
328
+
329
+ # to_body is an alias to to_hash (backward compatibility)
330
+ # @return [Hash] Returns the object in the form of hash
331
+ def to_body
332
+ to_hash
333
+ end
334
+
335
+ # Returns the object in the form of hash
336
+ # @return [Hash] Returns the object in the form of hash
337
+ def to_hash
338
+ hash = {}
339
+ self.class.attribute_map.each_pair do |attr, param|
340
+ value = self.send(attr)
341
+ if value.nil?
342
+ is_nullable = self.class.openapi_nullable.include?(attr)
343
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
344
+ end
345
+
346
+ hash[param] = _to_hash(value)
347
+ end
348
+ hash
349
+ end
350
+
351
+ # Outputs non-array value in the form of hash
352
+ # For object, use to_hash. Otherwise, just return the value
353
+ # @param [Object] value Any valid value
354
+ # @return [Hash] Returns the value in the form of hash
355
+ def _to_hash(value)
356
+ if value.is_a?(Array)
357
+ value.compact.map { |v| _to_hash(v) }
358
+ elsif value.is_a?(Hash)
359
+ {}.tap do |hash|
360
+ value.each { |k, v| hash[k] = _to_hash(v) }
361
+ end
362
+ elsif value.respond_to? :to_hash
363
+ value.to_hash
364
+ else
365
+ value
366
+ end
367
+ end
368
+
369
+ end
370
+
371
+ end
@@ -0,0 +1,223 @@
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 MyPermissionsResponse
18
+ attr_accessor :permissions
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'permissions' => :'permissions'
24
+ }
25
+ end
26
+
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'permissions' => :'Array<String>'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpMavenClient::MyPermissionsResponse` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpMavenClient::MyPermissionsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'permissions')
61
+ if (value = attributes[:'permissions']).is_a?(Array)
62
+ self.permissions = value
63
+ end
64
+ else
65
+ self.permissions = nil
66
+ end
67
+ end
68
+
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properties with the reasons
71
+ def list_invalid_properties
72
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
73
+ invalid_properties = Array.new
74
+ if @permissions.nil?
75
+ invalid_properties.push('invalid value for "permissions", permissions cannot be nil.')
76
+ end
77
+
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ warn '[DEPRECATED] the `valid?` method is obsolete'
85
+ return false if @permissions.nil?
86
+ true
87
+ end
88
+
89
+ # Checks equality by comparing each attribute.
90
+ # @param [Object] Object to be compared
91
+ def ==(o)
92
+ return true if self.equal?(o)
93
+ self.class == o.class &&
94
+ permissions == o.permissions
95
+ end
96
+
97
+ # @see the `==` method
98
+ # @param [Object] Object to be compared
99
+ def eql?(o)
100
+ self == o
101
+ end
102
+
103
+ # Calculates hash code according to all attributes.
104
+ # @return [Integer] Hash code
105
+ def hash
106
+ [permissions].hash
107
+ end
108
+
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def self.build_from_hash(attributes)
113
+ return nil unless attributes.is_a?(Hash)
114
+ attributes = attributes.transform_keys(&:to_sym)
115
+ transformed_hash = {}
116
+ openapi_types.each_pair do |key, type|
117
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
118
+ transformed_hash["#{key}"] = nil
119
+ elsif type =~ /\AArray<(.*)>/i
120
+ # check to ensure the input is an array given that the attribute
121
+ # is documented as an array but the input is not
122
+ if attributes[attribute_map[key]].is_a?(Array)
123
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
124
+ end
125
+ elsif !attributes[attribute_map[key]].nil?
126
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
127
+ end
128
+ end
129
+ new(transformed_hash)
130
+ end
131
+
132
+ # Deserializes the data based on type
133
+ # @param string type Data type
134
+ # @param string value Value to be deserialized
135
+ # @return [Object] Deserialized data
136
+ def self._deserialize(type, value)
137
+ case type.to_sym
138
+ when :Time
139
+ Time.parse(value)
140
+ when :Date
141
+ Date.parse(value)
142
+ when :String
143
+ value.to_s
144
+ when :Integer
145
+ value.to_i
146
+ when :Float
147
+ value.to_f
148
+ when :Boolean
149
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
150
+ true
151
+ else
152
+ false
153
+ end
154
+ when :Object
155
+ # generic object (usually a Hash), return directly
156
+ value
157
+ when /\AArray<(?<inner_type>.+)>\z/
158
+ inner_type = Regexp.last_match[:inner_type]
159
+ value.map { |v| _deserialize(inner_type, v) }
160
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
161
+ k_type = Regexp.last_match[:k_type]
162
+ v_type = Regexp.last_match[:v_type]
163
+ {}.tap do |hash|
164
+ value.each do |k, v|
165
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
166
+ end
167
+ end
168
+ else # model
169
+ # models (e.g. Pet) or oneOf
170
+ klass = PulpMavenClient.const_get(type)
171
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
172
+ end
173
+ end
174
+
175
+ # Returns the string representation of the object
176
+ # @return [String] String presentation of the object
177
+ def to_s
178
+ to_hash.to_s
179
+ end
180
+
181
+ # to_body is an alias to to_hash (backward compatibility)
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_body
184
+ to_hash
185
+ end
186
+
187
+ # Returns the object in the form of hash
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_hash
190
+ hash = {}
191
+ self.class.attribute_map.each_pair do |attr, param|
192
+ value = self.send(attr)
193
+ if value.nil?
194
+ is_nullable = self.class.openapi_nullable.include?(attr)
195
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
196
+ end
197
+
198
+ hash[param] = _to_hash(value)
199
+ end
200
+ hash
201
+ end
202
+
203
+ # Outputs non-array value in the form of hash
204
+ # For object, use to_hash. Otherwise, just return the value
205
+ # @param [Object] value Any valid value
206
+ # @return [Hash] Returns the value in the form of hash
207
+ def _to_hash(value)
208
+ if value.is_a?(Array)
209
+ value.compact.map { |v| _to_hash(v) }
210
+ elsif value.is_a?(Hash)
211
+ {}.tap do |hash|
212
+ value.each { |k, v| hash[k] = _to_hash(v) }
213
+ end
214
+ elsif value.respond_to? :to_hash
215
+ value.to_hash
216
+ else
217
+ value
218
+ end
219
+ end
220
+
221
+ end
222
+
223
+ end