pulp_2to3_migration_client 0.3.0b1.dev01595360000

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 (48) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +114 -0
  4. data/Rakefile +10 -0
  5. data/docs/AsyncOperationResponse.md +17 -0
  6. data/docs/InlineResponse200.md +23 -0
  7. data/docs/InlineResponse2001.md +23 -0
  8. data/docs/InlineResponse2002.md +23 -0
  9. data/docs/MigrationPlanRun.md +19 -0
  10. data/docs/MigrationPlansApi.md +295 -0
  11. data/docs/Pulp2contentApi.md +154 -0
  12. data/docs/Pulp2repositoriesApi.md +140 -0
  13. data/docs/Pulp2to3MigrationMigrationPlan.md +21 -0
  14. data/docs/Pulp2to3MigrationPulp2Content.md +33 -0
  15. data/docs/Pulp2to3MigrationPulp2Repository.md +39 -0
  16. data/git_push.sh +58 -0
  17. data/lib/pulp_2to3_migration_client.rb +50 -0
  18. data/lib/pulp_2to3_migration_client/api/migration_plans_api.rb +355 -0
  19. data/lib/pulp_2to3_migration_client/api/pulp2content_api.rb +194 -0
  20. data/lib/pulp_2to3_migration_client/api/pulp2repositories_api.rb +173 -0
  21. data/lib/pulp_2to3_migration_client/api_client.rb +402 -0
  22. data/lib/pulp_2to3_migration_client/api_error.rb +57 -0
  23. data/lib/pulp_2to3_migration_client/configuration.rb +243 -0
  24. data/lib/pulp_2to3_migration_client/models/async_operation_response.rb +212 -0
  25. data/lib/pulp_2to3_migration_client/models/inline_response200.rb +247 -0
  26. data/lib/pulp_2to3_migration_client/models/inline_response2001.rb +247 -0
  27. data/lib/pulp_2to3_migration_client/models/inline_response2002.rb +247 -0
  28. data/lib/pulp_2to3_migration_client/models/migration_plan_run.rb +221 -0
  29. data/lib/pulp_2to3_migration_client/models/pulp2to3_migration_migration_plan.rb +231 -0
  30. data/lib/pulp_2to3_migration_client/models/pulp2to3_migration_pulp2_content.rb +393 -0
  31. data/lib/pulp_2to3_migration_client/models/pulp2to3_migration_pulp2_repository.rb +444 -0
  32. data/lib/pulp_2to3_migration_client/version.rb +15 -0
  33. data/pulp_2to3_migration_client.gemspec +39 -0
  34. data/spec/api/migration_plans_api_spec.rb +102 -0
  35. data/spec/api/pulp2content_api_spec.rb +76 -0
  36. data/spec/api/pulp2repositories_api_spec.rb +69 -0
  37. data/spec/api_client_spec.rb +188 -0
  38. data/spec/configuration_spec.rb +42 -0
  39. data/spec/models/async_operation_response_spec.rb +41 -0
  40. data/spec/models/inline_response2001_spec.rb +59 -0
  41. data/spec/models/inline_response2002_spec.rb +59 -0
  42. data/spec/models/inline_response200_spec.rb +59 -0
  43. data/spec/models/migration_plan_run_spec.rb +47 -0
  44. data/spec/models/pulp2to3_migration_migration_plan_spec.rb +53 -0
  45. data/spec/models/pulp2to3_migration_pulp2_content_spec.rb +89 -0
  46. data/spec/models/pulp2to3_migration_pulp2_repository_spec.rb +107 -0
  47. data/spec/spec_helper.rb +111 -0
  48. metadata +157 -0
@@ -0,0 +1,444 @@
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.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Pulp2to3MigrationClient
16
+ class Pulp2to3MigrationPulp2Repository
17
+ attr_accessor :pulp_href
18
+
19
+ # Timestamp of creation.
20
+ attr_accessor :pulp_created
21
+
22
+ attr_accessor :pulp2_object_id
23
+
24
+ attr_accessor :pulp2_repo_id
25
+
26
+ attr_accessor :pulp2_repo_type
27
+
28
+ attr_accessor :is_migrated
29
+
30
+ attr_accessor :not_in_plan
31
+
32
+ # RepositoryVersion to be served
33
+ attr_accessor :pulp3_repository_version
34
+
35
+ # Get pulp3_remote_href from pulp2repo
36
+ attr_accessor :pulp3_remote_href
37
+
38
+ # Get pulp3_publication_href from pulp3_repository_version
39
+ attr_accessor :pulp3_publication_href
40
+
41
+ # Get pulp3_distribution_hrefs from pulp3_repository_version
42
+ attr_accessor :pulp3_distribution_hrefs
43
+
44
+ # Get pulp3_repository_href from pulp2repo
45
+ attr_accessor :pulp3_repository_href
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ :'pulp_href' => :'pulp_href',
51
+ :'pulp_created' => :'pulp_created',
52
+ :'pulp2_object_id' => :'pulp2_object_id',
53
+ :'pulp2_repo_id' => :'pulp2_repo_id',
54
+ :'pulp2_repo_type' => :'pulp2_repo_type',
55
+ :'is_migrated' => :'is_migrated',
56
+ :'not_in_plan' => :'not_in_plan',
57
+ :'pulp3_repository_version' => :'pulp3_repository_version',
58
+ :'pulp3_remote_href' => :'pulp3_remote_href',
59
+ :'pulp3_publication_href' => :'pulp3_publication_href',
60
+ :'pulp3_distribution_hrefs' => :'pulp3_distribution_hrefs',
61
+ :'pulp3_repository_href' => :'pulp3_repository_href'
62
+ }
63
+ end
64
+
65
+ # Attribute type mapping.
66
+ def self.openapi_types
67
+ {
68
+ :'pulp_href' => :'String',
69
+ :'pulp_created' => :'DateTime',
70
+ :'pulp2_object_id' => :'String',
71
+ :'pulp2_repo_id' => :'String',
72
+ :'pulp2_repo_type' => :'String',
73
+ :'is_migrated' => :'Boolean',
74
+ :'not_in_plan' => :'Boolean',
75
+ :'pulp3_repository_version' => :'String',
76
+ :'pulp3_remote_href' => :'String',
77
+ :'pulp3_publication_href' => :'String',
78
+ :'pulp3_distribution_hrefs' => :'Array<String>',
79
+ :'pulp3_repository_href' => :'String'
80
+ }
81
+ end
82
+
83
+ # List of attributes with nullable: true
84
+ def self.openapi_nullable
85
+ Set.new([
86
+ :'pulp3_repository_version',
87
+ ])
88
+ end
89
+
90
+ # Initializes the object
91
+ # @param [Hash] attributes Model attributes in the form of hash
92
+ def initialize(attributes = {})
93
+ if (!attributes.is_a?(Hash))
94
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pulp2to3MigrationClient::Pulp2to3MigrationPulp2Repository` initialize method"
95
+ end
96
+
97
+ # check to see if the attribute exists and convert string to symbol for hash key
98
+ attributes = attributes.each_with_object({}) { |(k, v), h|
99
+ if (!self.class.attribute_map.key?(k.to_sym))
100
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pulp2to3MigrationClient::Pulp2to3MigrationPulp2Repository`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
101
+ end
102
+ h[k.to_sym] = v
103
+ }
104
+
105
+ if attributes.key?(:'pulp_href')
106
+ self.pulp_href = attributes[:'pulp_href']
107
+ end
108
+
109
+ if attributes.key?(:'pulp_created')
110
+ self.pulp_created = attributes[:'pulp_created']
111
+ end
112
+
113
+ if attributes.key?(:'pulp2_object_id')
114
+ self.pulp2_object_id = attributes[:'pulp2_object_id']
115
+ end
116
+
117
+ if attributes.key?(:'pulp2_repo_id')
118
+ self.pulp2_repo_id = attributes[:'pulp2_repo_id']
119
+ end
120
+
121
+ if attributes.key?(:'pulp2_repo_type')
122
+ self.pulp2_repo_type = attributes[:'pulp2_repo_type']
123
+ end
124
+
125
+ if attributes.key?(:'is_migrated')
126
+ self.is_migrated = attributes[:'is_migrated']
127
+ else
128
+ self.is_migrated = false
129
+ end
130
+
131
+ if attributes.key?(:'not_in_plan')
132
+ self.not_in_plan = attributes[:'not_in_plan']
133
+ else
134
+ self.not_in_plan = false
135
+ end
136
+
137
+ if attributes.key?(:'pulp3_repository_version')
138
+ self.pulp3_repository_version = attributes[:'pulp3_repository_version']
139
+ end
140
+
141
+ if attributes.key?(:'pulp3_remote_href')
142
+ self.pulp3_remote_href = attributes[:'pulp3_remote_href']
143
+ end
144
+
145
+ if attributes.key?(:'pulp3_publication_href')
146
+ self.pulp3_publication_href = attributes[:'pulp3_publication_href']
147
+ end
148
+
149
+ if attributes.key?(:'pulp3_distribution_hrefs')
150
+ if (value = attributes[:'pulp3_distribution_hrefs']).is_a?(Array)
151
+ self.pulp3_distribution_hrefs = value
152
+ end
153
+ end
154
+
155
+ if attributes.key?(:'pulp3_repository_href')
156
+ self.pulp3_repository_href = attributes[:'pulp3_repository_href']
157
+ end
158
+ end
159
+
160
+ # Show invalid properties with the reasons. Usually used together with valid?
161
+ # @return Array for valid properties with the reasons
162
+ def list_invalid_properties
163
+ invalid_properties = Array.new
164
+ if @pulp2_object_id.nil?
165
+ invalid_properties.push('invalid value for "pulp2_object_id", pulp2_object_id cannot be nil.')
166
+ end
167
+
168
+ if @pulp2_object_id.to_s.length > 255
169
+ invalid_properties.push('invalid value for "pulp2_object_id", the character length must be smaller than or equal to 255.')
170
+ end
171
+
172
+ if @pulp2_object_id.to_s.length < 1
173
+ invalid_properties.push('invalid value for "pulp2_object_id", the character length must be great than or equal to 1.')
174
+ end
175
+
176
+ if @pulp2_repo_id.nil?
177
+ invalid_properties.push('invalid value for "pulp2_repo_id", pulp2_repo_id cannot be nil.')
178
+ end
179
+
180
+ if @pulp2_repo_id.to_s.length < 1
181
+ invalid_properties.push('invalid value for "pulp2_repo_id", the character length must be great than or equal to 1.')
182
+ end
183
+
184
+ if @pulp2_repo_type.nil?
185
+ invalid_properties.push('invalid value for "pulp2_repo_type", pulp2_repo_type cannot be nil.')
186
+ end
187
+
188
+ if @pulp2_repo_type.to_s.length < 1
189
+ invalid_properties.push('invalid value for "pulp2_repo_type", the character length must be great than or equal to 1.')
190
+ end
191
+
192
+ if !@pulp3_remote_href.nil? && @pulp3_remote_href.to_s.length < 1
193
+ invalid_properties.push('invalid value for "pulp3_remote_href", the character length must be great than or equal to 1.')
194
+ end
195
+
196
+ if !@pulp3_publication_href.nil? && @pulp3_publication_href.to_s.length < 1
197
+ invalid_properties.push('invalid value for "pulp3_publication_href", the character length must be great than or equal to 1.')
198
+ end
199
+
200
+ if !@pulp3_repository_href.nil? && @pulp3_repository_href.to_s.length < 1
201
+ invalid_properties.push('invalid value for "pulp3_repository_href", the character length must be great than or equal to 1.')
202
+ end
203
+
204
+ invalid_properties
205
+ end
206
+
207
+ # Check to see if the all the properties in the model are valid
208
+ # @return true if the model is valid
209
+ def valid?
210
+ return false if @pulp2_object_id.nil?
211
+ return false if @pulp2_object_id.to_s.length > 255
212
+ return false if @pulp2_object_id.to_s.length < 1
213
+ return false if @pulp2_repo_id.nil?
214
+ return false if @pulp2_repo_id.to_s.length < 1
215
+ return false if @pulp2_repo_type.nil?
216
+ return false if @pulp2_repo_type.to_s.length < 1
217
+ return false if !@pulp3_remote_href.nil? && @pulp3_remote_href.to_s.length < 1
218
+ return false if !@pulp3_publication_href.nil? && @pulp3_publication_href.to_s.length < 1
219
+ return false if !@pulp3_repository_href.nil? && @pulp3_repository_href.to_s.length < 1
220
+ true
221
+ end
222
+
223
+ # Custom attribute writer method with validation
224
+ # @param [Object] pulp2_object_id Value to be assigned
225
+ def pulp2_object_id=(pulp2_object_id)
226
+ if pulp2_object_id.nil?
227
+ fail ArgumentError, 'pulp2_object_id cannot be nil'
228
+ end
229
+
230
+ if pulp2_object_id.to_s.length > 255
231
+ fail ArgumentError, 'invalid value for "pulp2_object_id", the character length must be smaller than or equal to 255.'
232
+ end
233
+
234
+ if pulp2_object_id.to_s.length < 1
235
+ fail ArgumentError, 'invalid value for "pulp2_object_id", the character length must be great than or equal to 1.'
236
+ end
237
+
238
+ @pulp2_object_id = pulp2_object_id
239
+ end
240
+
241
+ # Custom attribute writer method with validation
242
+ # @param [Object] pulp2_repo_id Value to be assigned
243
+ def pulp2_repo_id=(pulp2_repo_id)
244
+ if pulp2_repo_id.nil?
245
+ fail ArgumentError, 'pulp2_repo_id cannot be nil'
246
+ end
247
+
248
+ if pulp2_repo_id.to_s.length < 1
249
+ fail ArgumentError, 'invalid value for "pulp2_repo_id", the character length must be great than or equal to 1.'
250
+ end
251
+
252
+ @pulp2_repo_id = pulp2_repo_id
253
+ end
254
+
255
+ # Custom attribute writer method with validation
256
+ # @param [Object] pulp2_repo_type Value to be assigned
257
+ def pulp2_repo_type=(pulp2_repo_type)
258
+ if pulp2_repo_type.nil?
259
+ fail ArgumentError, 'pulp2_repo_type cannot be nil'
260
+ end
261
+
262
+ if pulp2_repo_type.to_s.length < 1
263
+ fail ArgumentError, 'invalid value for "pulp2_repo_type", the character length must be great than or equal to 1.'
264
+ end
265
+
266
+ @pulp2_repo_type = pulp2_repo_type
267
+ end
268
+
269
+ # Custom attribute writer method with validation
270
+ # @param [Object] pulp3_remote_href Value to be assigned
271
+ def pulp3_remote_href=(pulp3_remote_href)
272
+ if !pulp3_remote_href.nil? && pulp3_remote_href.to_s.length < 1
273
+ fail ArgumentError, 'invalid value for "pulp3_remote_href", the character length must be great than or equal to 1.'
274
+ end
275
+
276
+ @pulp3_remote_href = pulp3_remote_href
277
+ end
278
+
279
+ # Custom attribute writer method with validation
280
+ # @param [Object] pulp3_publication_href Value to be assigned
281
+ def pulp3_publication_href=(pulp3_publication_href)
282
+ if !pulp3_publication_href.nil? && pulp3_publication_href.to_s.length < 1
283
+ fail ArgumentError, 'invalid value for "pulp3_publication_href", the character length must be great than or equal to 1.'
284
+ end
285
+
286
+ @pulp3_publication_href = pulp3_publication_href
287
+ end
288
+
289
+ # Custom attribute writer method with validation
290
+ # @param [Object] pulp3_repository_href Value to be assigned
291
+ def pulp3_repository_href=(pulp3_repository_href)
292
+ if !pulp3_repository_href.nil? && pulp3_repository_href.to_s.length < 1
293
+ fail ArgumentError, 'invalid value for "pulp3_repository_href", the character length must be great than or equal to 1.'
294
+ end
295
+
296
+ @pulp3_repository_href = pulp3_repository_href
297
+ end
298
+
299
+ # Checks equality by comparing each attribute.
300
+ # @param [Object] Object to be compared
301
+ def ==(o)
302
+ return true if self.equal?(o)
303
+ self.class == o.class &&
304
+ pulp_href == o.pulp_href &&
305
+ pulp_created == o.pulp_created &&
306
+ pulp2_object_id == o.pulp2_object_id &&
307
+ pulp2_repo_id == o.pulp2_repo_id &&
308
+ pulp2_repo_type == o.pulp2_repo_type &&
309
+ is_migrated == o.is_migrated &&
310
+ not_in_plan == o.not_in_plan &&
311
+ pulp3_repository_version == o.pulp3_repository_version &&
312
+ pulp3_remote_href == o.pulp3_remote_href &&
313
+ pulp3_publication_href == o.pulp3_publication_href &&
314
+ pulp3_distribution_hrefs == o.pulp3_distribution_hrefs &&
315
+ pulp3_repository_href == o.pulp3_repository_href
316
+ end
317
+
318
+ # @see the `==` method
319
+ # @param [Object] Object to be compared
320
+ def eql?(o)
321
+ self == o
322
+ end
323
+
324
+ # Calculates hash code according to all attributes.
325
+ # @return [Integer] Hash code
326
+ def hash
327
+ [pulp_href, pulp_created, pulp2_object_id, pulp2_repo_id, pulp2_repo_type, is_migrated, not_in_plan, pulp3_repository_version, pulp3_remote_href, pulp3_publication_href, pulp3_distribution_hrefs, pulp3_repository_href].hash
328
+ end
329
+
330
+ # Builds the object from hash
331
+ # @param [Hash] attributes Model attributes in the form of hash
332
+ # @return [Object] Returns the model itself
333
+ def self.build_from_hash(attributes)
334
+ new.build_from_hash(attributes)
335
+ end
336
+
337
+ # Builds the object from hash
338
+ # @param [Hash] attributes Model attributes in the form of hash
339
+ # @return [Object] Returns the model itself
340
+ def build_from_hash(attributes)
341
+ return nil unless attributes.is_a?(Hash)
342
+ self.class.openapi_types.each_pair do |key, type|
343
+ if type =~ /\AArray<(.*)>/i
344
+ # check to ensure the input is an array given that the attribute
345
+ # is documented as an array but the input is not
346
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
347
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
348
+ end
349
+ elsif !attributes[self.class.attribute_map[key]].nil?
350
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
351
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
352
+ end
353
+
354
+ self
355
+ end
356
+
357
+ # Deserializes the data based on type
358
+ # @param string type Data type
359
+ # @param string value Value to be deserialized
360
+ # @return [Object] Deserialized data
361
+ def _deserialize(type, value)
362
+ case type.to_sym
363
+ when :DateTime
364
+ DateTime.parse(value)
365
+ when :Date
366
+ Date.parse(value)
367
+ when :String
368
+ value.to_s
369
+ when :Integer
370
+ value.to_i
371
+ when :Float
372
+ value.to_f
373
+ when :Boolean
374
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
375
+ true
376
+ else
377
+ false
378
+ end
379
+ when :Object
380
+ # generic object (usually a Hash), return directly
381
+ value
382
+ when /\AArray<(?<inner_type>.+)>\z/
383
+ inner_type = Regexp.last_match[:inner_type]
384
+ value.map { |v| _deserialize(inner_type, v) }
385
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
386
+ k_type = Regexp.last_match[:k_type]
387
+ v_type = Regexp.last_match[:v_type]
388
+ {}.tap do |hash|
389
+ value.each do |k, v|
390
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
391
+ end
392
+ end
393
+ else # model
394
+ Pulp2to3MigrationClient.const_get(type).build_from_hash(value)
395
+ end
396
+ end
397
+
398
+ # Returns the string representation of the object
399
+ # @return [String] String presentation of the object
400
+ def to_s
401
+ to_hash.to_s
402
+ end
403
+
404
+ # to_body is an alias to to_hash (backward compatibility)
405
+ # @return [Hash] Returns the object in the form of hash
406
+ def to_body
407
+ to_hash
408
+ end
409
+
410
+ # Returns the object in the form of hash
411
+ # @return [Hash] Returns the object in the form of hash
412
+ def to_hash
413
+ hash = {}
414
+ self.class.attribute_map.each_pair do |attr, param|
415
+ value = self.send(attr)
416
+ if value.nil?
417
+ is_nullable = self.class.openapi_nullable.include?(attr)
418
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
419
+ end
420
+
421
+ hash[param] = _to_hash(value)
422
+ end
423
+ hash
424
+ end
425
+
426
+ # Outputs non-array value in the form of hash
427
+ # For object, use to_hash. Otherwise, just return the value
428
+ # @param [Object] value Any valid value
429
+ # @return [Hash] Returns the value in the form of hash
430
+ def _to_hash(value)
431
+ if value.is_a?(Array)
432
+ value.compact.map { |v| _to_hash(v) }
433
+ elsif value.is_a?(Hash)
434
+ {}.tap do |hash|
435
+ value.each { |k, v| hash[k] = _to_hash(v) }
436
+ end
437
+ elsif value.respond_to? :to_hash
438
+ value.to_hash
439
+ else
440
+ value
441
+ end
442
+ end
443
+ end
444
+ end
@@ -0,0 +1,15 @@
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.2.3
10
+
11
+ =end
12
+
13
+ module Pulp2to3MigrationClient
14
+ VERSION = '0.3.0b1.dev01595360000'
15
+ end