pulp_rpm_client 3.0.0b4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +79 -0
  4. data/README.md +134 -0
  5. data/Rakefile +10 -0
  6. data/docs/AsyncOperationResponse.md +17 -0
  7. data/docs/ContentAdvisoriesApi.md +196 -0
  8. data/docs/ContentPackagesApi.md +208 -0
  9. data/docs/DistributionsRpmApi.md +352 -0
  10. data/docs/InlineResponse200.md +23 -0
  11. data/docs/InlineResponse2001.md +23 -0
  12. data/docs/InlineResponse2002.md +23 -0
  13. data/docs/InlineResponse2003.md +23 -0
  14. data/docs/InlineResponse2004.md +23 -0
  15. data/docs/Package.md +95 -0
  16. data/docs/PublicationsRpmApi.md +229 -0
  17. data/docs/RemotesRpmApi.md +412 -0
  18. data/docs/RepositorySyncURL.md +19 -0
  19. data/docs/RpmCopyApi.md +70 -0
  20. data/docs/RpmDistribution.md +29 -0
  21. data/docs/RpmPublication.md +27 -0
  22. data/docs/RpmRemote.md +45 -0
  23. data/docs/RpmUploadApi.md +66 -0
  24. data/docs/UpdateRecord.md +55 -0
  25. data/git_push.sh +55 -0
  26. data/lib/pulp_rpm_client/api/content_advisories_api.rb +243 -0
  27. data/lib/pulp_rpm_client/api/content_packages_api.rb +261 -0
  28. data/lib/pulp_rpm_client/api/distributions_rpm_api.rb +430 -0
  29. data/lib/pulp_rpm_client/api/publications_rpm_api.rb +273 -0
  30. data/lib/pulp_rpm_client/api/remotes_rpm_api.rb +506 -0
  31. data/lib/pulp_rpm_client/api/rpm_copy_api.rb +96 -0
  32. data/lib/pulp_rpm_client/api/rpm_upload_api.rb +90 -0
  33. data/lib/pulp_rpm_client/api_client.rb +387 -0
  34. data/lib/pulp_rpm_client/api_error.rb +57 -0
  35. data/lib/pulp_rpm_client/configuration.rb +251 -0
  36. data/lib/pulp_rpm_client/models/async_operation_response.rb +202 -0
  37. data/lib/pulp_rpm_client/models/inline_response200.rb +235 -0
  38. data/lib/pulp_rpm_client/models/inline_response2001.rb +235 -0
  39. data/lib/pulp_rpm_client/models/inline_response2002.rb +235 -0
  40. data/lib/pulp_rpm_client/models/inline_response2003.rb +235 -0
  41. data/lib/pulp_rpm_client/models/inline_response2004.rb +235 -0
  42. data/lib/pulp_rpm_client/models/package.rb +983 -0
  43. data/lib/pulp_rpm_client/models/repository_sync_url.rb +214 -0
  44. data/lib/pulp_rpm_client/models/rpm_distribution.rb +337 -0
  45. data/lib/pulp_rpm_client/models/rpm_publication.rb +258 -0
  46. data/lib/pulp_rpm_client/models/rpm_remote.rb +539 -0
  47. data/lib/pulp_rpm_client/models/update_record.rb +764 -0
  48. data/lib/pulp_rpm_client/version.rb +15 -0
  49. data/lib/pulp_rpm_client.rb +58 -0
  50. data/pulp_rpm_client.gemspec +45 -0
  51. data/spec/api/content_advisories_api_spec.rb +83 -0
  52. data/spec/api/content_packages_api_spec.rb +89 -0
  53. data/spec/api/distributions_rpm_api_spec.rb +116 -0
  54. data/spec/api/publications_rpm_api_spec.rb +85 -0
  55. data/spec/api/remotes_rpm_api_spec.rb +131 -0
  56. data/spec/api/rpm_copy_api_spec.rb +50 -0
  57. data/spec/api/rpm_upload_api_spec.rb +48 -0
  58. data/spec/api_client_spec.rb +226 -0
  59. data/spec/configuration_spec.rb +42 -0
  60. data/spec/models/async_operation_response_spec.rb +41 -0
  61. data/spec/models/inline_response2001_spec.rb +59 -0
  62. data/spec/models/inline_response2002_spec.rb +59 -0
  63. data/spec/models/inline_response2003_spec.rb +59 -0
  64. data/spec/models/inline_response2004_spec.rb +59 -0
  65. data/spec/models/inline_response200_spec.rb +59 -0
  66. data/spec/models/package_spec.rb +275 -0
  67. data/spec/models/repository_sync_url_spec.rb +47 -0
  68. data/spec/models/rpm_distribution_spec.rb +77 -0
  69. data/spec/models/rpm_publication_spec.rb +71 -0
  70. data/spec/models/rpm_remote_spec.rb +129 -0
  71. data/spec/models/update_record_spec.rb +155 -0
  72. data/spec/spec_helper.rb +111 -0
  73. metadata +317 -0
@@ -0,0 +1,214 @@
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.0.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpRpmClient
16
+ class RepositorySyncURL
17
+ # A URI of the repository to be synchronized.
18
+ attr_accessor :repository
19
+
20
+ # If ``True``, synchronization will remove all content that is not present in the remote repository. If ``False``, sync will be additive only.
21
+ attr_accessor :mirror
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'repository' => :'repository',
27
+ :'mirror' => :'mirror'
28
+ }
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.openapi_types
33
+ {
34
+ :'repository' => :'String',
35
+ :'mirror' => :'Boolean'
36
+ }
37
+ end
38
+
39
+ # Initializes the object
40
+ # @param [Hash] attributes Model attributes in the form of hash
41
+ def initialize(attributes = {})
42
+ if (!attributes.is_a?(Hash))
43
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpRpmClient::RepositorySyncURL` initialize method"
44
+ end
45
+
46
+ # check to see if the attribute exists and convert string to symbol for hash key
47
+ attributes = attributes.each_with_object({}) { |(k, v), h|
48
+ if (!self.class.attribute_map.key?(k.to_sym))
49
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpRpmClient::RepositorySyncURL`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
50
+ end
51
+ h[k.to_sym] = v
52
+ }
53
+
54
+ if attributes.key?(:'repository')
55
+ self.repository = attributes[:'repository']
56
+ end
57
+
58
+ if attributes.key?(:'mirror')
59
+ self.mirror = attributes[:'mirror']
60
+ else
61
+ self.mirror = false
62
+ end
63
+ end
64
+
65
+ # Show invalid properties with the reasons. Usually used together with valid?
66
+ # @return Array for valid properties with the reasons
67
+ def list_invalid_properties
68
+ invalid_properties = Array.new
69
+ if @repository.nil?
70
+ invalid_properties.push('invalid value for "repository", repository cannot be nil.')
71
+ end
72
+
73
+ invalid_properties
74
+ end
75
+
76
+ # Check to see if the all the properties in the model are valid
77
+ # @return true if the model is valid
78
+ def valid?
79
+ return false if @repository.nil?
80
+ true
81
+ end
82
+
83
+ # Checks equality by comparing each attribute.
84
+ # @param [Object] Object to be compared
85
+ def ==(o)
86
+ return true if self.equal?(o)
87
+ self.class == o.class &&
88
+ repository == o.repository &&
89
+ mirror == o.mirror
90
+ end
91
+
92
+ # @see the `==` method
93
+ # @param [Object] Object to be compared
94
+ def eql?(o)
95
+ self == o
96
+ end
97
+
98
+ # Calculates hash code according to all attributes.
99
+ # @return [Integer] Hash code
100
+ def hash
101
+ [repository, mirror].hash
102
+ end
103
+
104
+ # Builds the object from hash
105
+ # @param [Hash] attributes Model attributes in the form of hash
106
+ # @return [Object] Returns the model itself
107
+ def self.build_from_hash(attributes)
108
+ new.build_from_hash(attributes)
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def build_from_hash(attributes)
115
+ return nil unless attributes.is_a?(Hash)
116
+ self.class.openapi_types.each_pair do |key, type|
117
+ if type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the attribute
119
+ # is documented as an array but the input is not
120
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
121
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
122
+ end
123
+ elsif !attributes[self.class.attribute_map[key]].nil?
124
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
125
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
126
+ end
127
+
128
+ self
129
+ end
130
+
131
+ # Deserializes the data based on type
132
+ # @param string type Data type
133
+ # @param string value Value to be deserialized
134
+ # @return [Object] Deserialized data
135
+ def _deserialize(type, value)
136
+ case type.to_sym
137
+ when :DateTime
138
+ DateTime.parse(value)
139
+ when :Date
140
+ Date.parse(value)
141
+ when :String
142
+ value.to_s
143
+ when :Integer
144
+ value.to_i
145
+ when :Float
146
+ value.to_f
147
+ when :Boolean
148
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
149
+ true
150
+ else
151
+ false
152
+ end
153
+ when :Object
154
+ # generic object (usually a Hash), return directly
155
+ value
156
+ when /\AArray<(?<inner_type>.+)>\z/
157
+ inner_type = Regexp.last_match[:inner_type]
158
+ value.map { |v| _deserialize(inner_type, v) }
159
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
160
+ k_type = Regexp.last_match[:k_type]
161
+ v_type = Regexp.last_match[:v_type]
162
+ {}.tap do |hash|
163
+ value.each do |k, v|
164
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
165
+ end
166
+ end
167
+ else # model
168
+ PulpRpmClient.const_get(type).build_from_hash(value)
169
+ end
170
+ end
171
+
172
+ # Returns the string representation of the object
173
+ # @return [String] String presentation of the object
174
+ def to_s
175
+ to_hash.to_s
176
+ end
177
+
178
+ # to_body is an alias to to_hash (backward compatibility)
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_body
181
+ to_hash
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ next if value.nil?
191
+ hash[param] = _to_hash(value)
192
+ end
193
+ hash
194
+ end
195
+
196
+ # Outputs non-array value in the form of hash
197
+ # For object, use to_hash. Otherwise, just return the value
198
+ # @param [Object] value Any valid value
199
+ # @return [Hash] Returns the value in the form of hash
200
+ def _to_hash(value)
201
+ if value.is_a?(Array)
202
+ value.compact.map { |v| _to_hash(v) }
203
+ elsif value.is_a?(Hash)
204
+ {}.tap do |hash|
205
+ value.each { |k, v| hash[k] = _to_hash(v) }
206
+ end
207
+ elsif value.respond_to? :to_hash
208
+ value.to_hash
209
+ else
210
+ value
211
+ end
212
+ end
213
+ end
214
+ end
@@ -0,0 +1,337 @@
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.0.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpRpmClient
16
+ class RpmDistribution
17
+ attr_accessor :_href
18
+
19
+ # Timestamp of creation.
20
+ attr_accessor :_created
21
+
22
+ # The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")
23
+ attr_accessor :base_path
24
+
25
+ # The URL for accessing the publication as defined by this distribution.
26
+ attr_accessor :base_url
27
+
28
+ # An optional content-guard.
29
+ attr_accessor :content_guard
30
+
31
+ # A unique name. Ex, `rawhide` and `stable`.
32
+ attr_accessor :name
33
+
34
+ # Publication to be served
35
+ attr_accessor :publication
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'_href' => :'_href',
41
+ :'_created' => :'_created',
42
+ :'base_path' => :'base_path',
43
+ :'base_url' => :'base_url',
44
+ :'content_guard' => :'content_guard',
45
+ :'name' => :'name',
46
+ :'publication' => :'publication'
47
+ }
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.openapi_types
52
+ {
53
+ :'_href' => :'String',
54
+ :'_created' => :'DateTime',
55
+ :'base_path' => :'String',
56
+ :'base_url' => :'String',
57
+ :'content_guard' => :'String',
58
+ :'name' => :'String',
59
+ :'publication' => :'String'
60
+ }
61
+ end
62
+
63
+ # Initializes the object
64
+ # @param [Hash] attributes Model attributes in the form of hash
65
+ def initialize(attributes = {})
66
+ if (!attributes.is_a?(Hash))
67
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpRpmClient::RpmDistribution` initialize method"
68
+ end
69
+
70
+ # check to see if the attribute exists and convert string to symbol for hash key
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!self.class.attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpRpmClient::RpmDistribution`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'_href')
79
+ self._href = attributes[:'_href']
80
+ end
81
+
82
+ if attributes.key?(:'_created')
83
+ self._created = attributes[:'_created']
84
+ end
85
+
86
+ if attributes.key?(:'base_path')
87
+ self.base_path = attributes[:'base_path']
88
+ end
89
+
90
+ if attributes.key?(:'base_url')
91
+ self.base_url = attributes[:'base_url']
92
+ end
93
+
94
+ if attributes.key?(:'content_guard')
95
+ self.content_guard = attributes[:'content_guard']
96
+ end
97
+
98
+ if attributes.key?(:'name')
99
+ self.name = attributes[:'name']
100
+ end
101
+
102
+ if attributes.key?(:'publication')
103
+ self.publication = attributes[:'publication']
104
+ end
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ invalid_properties = Array.new
111
+ if @base_path.nil?
112
+ invalid_properties.push('invalid value for "base_path", base_path cannot be nil.')
113
+ end
114
+
115
+ if @base_path.to_s.length > 255
116
+ invalid_properties.push('invalid value for "base_path", the character length must be smaller than or equal to 255.')
117
+ end
118
+
119
+ if @base_path.to_s.length < 1
120
+ invalid_properties.push('invalid value for "base_path", the character length must be great than or equal to 1.')
121
+ end
122
+
123
+ if !@base_url.nil? && @base_url.to_s.length < 1
124
+ invalid_properties.push('invalid value for "base_url", the character length must be great than or equal to 1.')
125
+ end
126
+
127
+ if @name.nil?
128
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
129
+ end
130
+
131
+ if @name.to_s.length > 255
132
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.')
133
+ end
134
+
135
+ if @name.to_s.length < 1
136
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
137
+ end
138
+
139
+ invalid_properties
140
+ end
141
+
142
+ # Check to see if the all the properties in the model are valid
143
+ # @return true if the model is valid
144
+ def valid?
145
+ return false if @base_path.nil?
146
+ return false if @base_path.to_s.length > 255
147
+ return false if @base_path.to_s.length < 1
148
+ return false if !@base_url.nil? && @base_url.to_s.length < 1
149
+ return false if @name.nil?
150
+ return false if @name.to_s.length > 255
151
+ return false if @name.to_s.length < 1
152
+ true
153
+ end
154
+
155
+ # Custom attribute writer method with validation
156
+ # @param [Object] base_path Value to be assigned
157
+ def base_path=(base_path)
158
+ if base_path.nil?
159
+ fail ArgumentError, 'base_path cannot be nil'
160
+ end
161
+
162
+ if base_path.to_s.length > 255
163
+ fail ArgumentError, 'invalid value for "base_path", the character length must be smaller than or equal to 255.'
164
+ end
165
+
166
+ if base_path.to_s.length < 1
167
+ fail ArgumentError, 'invalid value for "base_path", the character length must be great than or equal to 1.'
168
+ end
169
+
170
+ @base_path = base_path
171
+ end
172
+
173
+ # Custom attribute writer method with validation
174
+ # @param [Object] base_url Value to be assigned
175
+ def base_url=(base_url)
176
+ if !base_url.nil? && base_url.to_s.length < 1
177
+ fail ArgumentError, 'invalid value for "base_url", the character length must be great than or equal to 1.'
178
+ end
179
+
180
+ @base_url = base_url
181
+ end
182
+
183
+ # Custom attribute writer method with validation
184
+ # @param [Object] name Value to be assigned
185
+ def name=(name)
186
+ if name.nil?
187
+ fail ArgumentError, 'name cannot be nil'
188
+ end
189
+
190
+ if name.to_s.length > 255
191
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.'
192
+ end
193
+
194
+ if name.to_s.length < 1
195
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
196
+ end
197
+
198
+ @name = name
199
+ end
200
+
201
+ # Checks equality by comparing each attribute.
202
+ # @param [Object] Object to be compared
203
+ def ==(o)
204
+ return true if self.equal?(o)
205
+ self.class == o.class &&
206
+ _href == o._href &&
207
+ _created == o._created &&
208
+ base_path == o.base_path &&
209
+ base_url == o.base_url &&
210
+ content_guard == o.content_guard &&
211
+ name == o.name &&
212
+ publication == o.publication
213
+ end
214
+
215
+ # @see the `==` method
216
+ # @param [Object] Object to be compared
217
+ def eql?(o)
218
+ self == o
219
+ end
220
+
221
+ # Calculates hash code according to all attributes.
222
+ # @return [Integer] Hash code
223
+ def hash
224
+ [_href, _created, base_path, base_url, content_guard, name, publication].hash
225
+ end
226
+
227
+ # Builds the object from hash
228
+ # @param [Hash] attributes Model attributes in the form of hash
229
+ # @return [Object] Returns the model itself
230
+ def self.build_from_hash(attributes)
231
+ new.build_from_hash(attributes)
232
+ end
233
+
234
+ # Builds the object from hash
235
+ # @param [Hash] attributes Model attributes in the form of hash
236
+ # @return [Object] Returns the model itself
237
+ def build_from_hash(attributes)
238
+ return nil unless attributes.is_a?(Hash)
239
+ self.class.openapi_types.each_pair do |key, type|
240
+ if type =~ /\AArray<(.*)>/i
241
+ # check to ensure the input is an array given that the attribute
242
+ # is documented as an array but the input is not
243
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
244
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
245
+ end
246
+ elsif !attributes[self.class.attribute_map[key]].nil?
247
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
248
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
249
+ end
250
+
251
+ self
252
+ end
253
+
254
+ # Deserializes the data based on type
255
+ # @param string type Data type
256
+ # @param string value Value to be deserialized
257
+ # @return [Object] Deserialized data
258
+ def _deserialize(type, value)
259
+ case type.to_sym
260
+ when :DateTime
261
+ DateTime.parse(value)
262
+ when :Date
263
+ Date.parse(value)
264
+ when :String
265
+ value.to_s
266
+ when :Integer
267
+ value.to_i
268
+ when :Float
269
+ value.to_f
270
+ when :Boolean
271
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
272
+ true
273
+ else
274
+ false
275
+ end
276
+ when :Object
277
+ # generic object (usually a Hash), return directly
278
+ value
279
+ when /\AArray<(?<inner_type>.+)>\z/
280
+ inner_type = Regexp.last_match[:inner_type]
281
+ value.map { |v| _deserialize(inner_type, v) }
282
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
283
+ k_type = Regexp.last_match[:k_type]
284
+ v_type = Regexp.last_match[:v_type]
285
+ {}.tap do |hash|
286
+ value.each do |k, v|
287
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
288
+ end
289
+ end
290
+ else # model
291
+ PulpRpmClient.const_get(type).build_from_hash(value)
292
+ end
293
+ end
294
+
295
+ # Returns the string representation of the object
296
+ # @return [String] String presentation of the object
297
+ def to_s
298
+ to_hash.to_s
299
+ end
300
+
301
+ # to_body is an alias to to_hash (backward compatibility)
302
+ # @return [Hash] Returns the object in the form of hash
303
+ def to_body
304
+ to_hash
305
+ end
306
+
307
+ # Returns the object in the form of hash
308
+ # @return [Hash] Returns the object in the form of hash
309
+ def to_hash
310
+ hash = {}
311
+ self.class.attribute_map.each_pair do |attr, param|
312
+ value = self.send(attr)
313
+ next if value.nil?
314
+ hash[param] = _to_hash(value)
315
+ end
316
+ hash
317
+ end
318
+
319
+ # Outputs non-array value in the form of hash
320
+ # For object, use to_hash. Otherwise, just return the value
321
+ # @param [Object] value Any valid value
322
+ # @return [Hash] Returns the value in the form of hash
323
+ def _to_hash(value)
324
+ if value.is_a?(Array)
325
+ value.compact.map { |v| _to_hash(v) }
326
+ elsif value.is_a?(Hash)
327
+ {}.tap do |hash|
328
+ value.each { |k, v| hash[k] = _to_hash(v) }
329
+ end
330
+ elsif value.respond_to? :to_hash
331
+ value.to_hash
332
+ else
333
+ value
334
+ end
335
+ end
336
+ end
337
+ end