pulp_2to3_migration_client 0.0.1a1.dev01572548060 → 0.0.1a1.dev01572634587

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 (30) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -7
  3. data/docs/InlineResponse200.md +1 -1
  4. data/docs/InlineResponse2001.md +1 -1
  5. data/docs/InlineResponse2002.md +23 -0
  6. data/docs/MigrationPlansApi.md +6 -6
  7. data/docs/Pulp2contentApi.md +2 -2
  8. data/docs/Pulp2repositoriesApi.md +134 -0
  9. data/docs/{MigrationPlan.md → Pulp2to3MigrationMigrationPlan.md} +2 -2
  10. data/docs/{Pulp2Content.md → Pulp2to3MigrationPulp2Content.md} +2 -2
  11. data/docs/Pulp2to3MigrationPulp2Repository.md +35 -0
  12. data/lib/pulp_2to3_migration_client/api/migration_plans_api.rb +8 -8
  13. data/lib/pulp_2to3_migration_client/api/pulp2content_api.rb +3 -3
  14. data/lib/pulp_2to3_migration_client/api/pulp2repositories_api.rb +164 -0
  15. data/lib/pulp_2to3_migration_client/models/inline_response200.rb +1 -1
  16. data/lib/pulp_2to3_migration_client/models/inline_response2001.rb +1 -1
  17. data/lib/pulp_2to3_migration_client/models/inline_response2002.rb +235 -0
  18. data/lib/pulp_2to3_migration_client/models/{migration_plan.rb → pulp2to3_migration_migration_plan.rb} +3 -3
  19. data/lib/pulp_2to3_migration_client/models/{pulp2_content.rb → pulp2to3_migration_pulp2_content.rb} +3 -3
  20. data/lib/pulp_2to3_migration_client/models/pulp2to3_migration_pulp2_repository.rb +337 -0
  21. data/lib/pulp_2to3_migration_client/version.rb +1 -1
  22. data/lib/pulp_2to3_migration_client.rb +5 -2
  23. data/spec/api/migration_plans_api_spec.rb +2 -2
  24. data/spec/api/pulp2content_api_spec.rb +1 -1
  25. data/spec/api/pulp2repositories_api_spec.rb +66 -0
  26. data/spec/models/inline_response2002_spec.rb +59 -0
  27. data/spec/models/{migration_plan_spec.rb → pulp2to3_migration_migration_plan_spec.rb} +6 -6
  28. data/spec/models/{pulp2_content_spec.rb → pulp2to3_migration_pulp2_content_spec.rb} +6 -6
  29. data/spec/models/pulp2to3_migration_pulp2_repository_spec.rb +95 -0
  30. metadata +22 -10
@@ -0,0 +1,235 @@
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.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Pulp2to3MigrationClient
16
+ class InlineResponse2002
17
+ attr_accessor :count
18
+
19
+ attr_accessor :_next
20
+
21
+ attr_accessor :previous
22
+
23
+ attr_accessor :results
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'count' => :'count',
29
+ :'_next' => :'next',
30
+ :'previous' => :'previous',
31
+ :'results' => :'results'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'count' => :'Integer',
39
+ :'_next' => :'String',
40
+ :'previous' => :'String',
41
+ :'results' => :'Array<Pulp2to3MigrationPulp2Repository>'
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 `Pulp2to3MigrationClient::InlineResponse2002` 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 `Pulp2to3MigrationClient::InlineResponse2002`. 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?(:'count')
61
+ self.count = attributes[:'count']
62
+ end
63
+
64
+ if attributes.key?(:'_next')
65
+ self._next = attributes[:'_next']
66
+ end
67
+
68
+ if attributes.key?(:'previous')
69
+ self.previous = attributes[:'previous']
70
+ end
71
+
72
+ if attributes.key?(:'results')
73
+ if (value = attributes[:'results']).is_a?(Array)
74
+ self.results = value
75
+ end
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ invalid_properties = Array.new
83
+ if @count.nil?
84
+ invalid_properties.push('invalid value for "count", count cannot be nil.')
85
+ end
86
+
87
+ if @results.nil?
88
+ invalid_properties.push('invalid value for "results", results cannot be nil.')
89
+ end
90
+
91
+ invalid_properties
92
+ end
93
+
94
+ # Check to see if the all the properties in the model are valid
95
+ # @return true if the model is valid
96
+ def valid?
97
+ return false if @count.nil?
98
+ return false if @results.nil?
99
+ true
100
+ end
101
+
102
+ # Checks equality by comparing each attribute.
103
+ # @param [Object] Object to be compared
104
+ def ==(o)
105
+ return true if self.equal?(o)
106
+ self.class == o.class &&
107
+ count == o.count &&
108
+ _next == o._next &&
109
+ previous == o.previous &&
110
+ results == o.results
111
+ end
112
+
113
+ # @see the `==` method
114
+ # @param [Object] Object to be compared
115
+ def eql?(o)
116
+ self == o
117
+ end
118
+
119
+ # Calculates hash code according to all attributes.
120
+ # @return [Integer] Hash code
121
+ def hash
122
+ [count, _next, previous, results].hash
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def self.build_from_hash(attributes)
129
+ new.build_from_hash(attributes)
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def build_from_hash(attributes)
136
+ return nil unless attributes.is_a?(Hash)
137
+ self.class.openapi_types.each_pair do |key, type|
138
+ if type =~ /\AArray<(.*)>/i
139
+ # check to ensure the input is an array given that the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
142
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
143
+ end
144
+ elsif !attributes[self.class.attribute_map[key]].nil?
145
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
146
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
147
+ end
148
+
149
+ self
150
+ end
151
+
152
+ # Deserializes the data based on type
153
+ # @param string type Data type
154
+ # @param string value Value to be deserialized
155
+ # @return [Object] Deserialized data
156
+ def _deserialize(type, value)
157
+ case type.to_sym
158
+ when :DateTime
159
+ DateTime.parse(value)
160
+ when :Date
161
+ Date.parse(value)
162
+ when :String
163
+ value.to_s
164
+ when :Integer
165
+ value.to_i
166
+ when :Float
167
+ value.to_f
168
+ when :Boolean
169
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
170
+ true
171
+ else
172
+ false
173
+ end
174
+ when :Object
175
+ # generic object (usually a Hash), return directly
176
+ value
177
+ when /\AArray<(?<inner_type>.+)>\z/
178
+ inner_type = Regexp.last_match[:inner_type]
179
+ value.map { |v| _deserialize(inner_type, v) }
180
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
181
+ k_type = Regexp.last_match[:k_type]
182
+ v_type = Regexp.last_match[:v_type]
183
+ {}.tap do |hash|
184
+ value.each do |k, v|
185
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
186
+ end
187
+ end
188
+ else # model
189
+ Pulp2to3MigrationClient.const_get(type).build_from_hash(value)
190
+ end
191
+ end
192
+
193
+ # Returns the string representation of the object
194
+ # @return [String] String presentation of the object
195
+ def to_s
196
+ to_hash.to_s
197
+ end
198
+
199
+ # to_body is an alias to to_hash (backward compatibility)
200
+ # @return [Hash] Returns the object in the form of hash
201
+ def to_body
202
+ to_hash
203
+ end
204
+
205
+ # Returns the object in the form of hash
206
+ # @return [Hash] Returns the object in the form of hash
207
+ def to_hash
208
+ hash = {}
209
+ self.class.attribute_map.each_pair do |attr, param|
210
+ value = self.send(attr)
211
+ next if value.nil?
212
+ hash[param] = _to_hash(value)
213
+ end
214
+ hash
215
+ end
216
+
217
+ # Outputs non-array value in the form of hash
218
+ # For object, use to_hash. Otherwise, just return the value
219
+ # @param [Object] value Any valid value
220
+ # @return [Hash] Returns the value in the form of hash
221
+ def _to_hash(value)
222
+ if value.is_a?(Array)
223
+ value.compact.map { |v| _to_hash(v) }
224
+ elsif value.is_a?(Hash)
225
+ {}.tap do |hash|
226
+ value.each { |k, v| hash[k] = _to_hash(v) }
227
+ end
228
+ elsif value.respond_to? :to_hash
229
+ value.to_hash
230
+ else
231
+ value
232
+ end
233
+ end
234
+ end
235
+ end
@@ -13,7 +13,7 @@ OpenAPI Generator version: 4.2.1-SNAPSHOT
13
13
  require 'date'
14
14
 
15
15
  module Pulp2to3MigrationClient
16
- class MigrationPlan
16
+ class Pulp2to3MigrationMigrationPlan
17
17
  attr_accessor :pulp_href
18
18
 
19
19
  # Timestamp of creation.
@@ -44,13 +44,13 @@ module Pulp2to3MigrationClient
44
44
  # @param [Hash] attributes Model attributes in the form of hash
45
45
  def initialize(attributes = {})
46
46
  if (!attributes.is_a?(Hash))
47
- fail ArgumentError, "The input argument (attributes) must be a hash in `Pulp2to3MigrationClient::MigrationPlan` initialize method"
47
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pulp2to3MigrationClient::Pulp2to3MigrationMigrationPlan` initialize method"
48
48
  end
49
49
 
50
50
  # check to see if the attribute exists and convert string to symbol for hash key
51
51
  attributes = attributes.each_with_object({}) { |(k, v), h|
52
52
  if (!self.class.attribute_map.key?(k.to_sym))
53
- fail ArgumentError, "`#{k}` is not a valid attribute in `Pulp2to3MigrationClient::MigrationPlan`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
53
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pulp2to3MigrationClient::Pulp2to3MigrationMigrationPlan`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
54
54
  end
55
55
  h[k.to_sym] = v
56
56
  }
@@ -13,7 +13,7 @@ OpenAPI Generator version: 4.2.1-SNAPSHOT
13
13
  require 'date'
14
14
 
15
15
  module Pulp2to3MigrationClient
16
- class Pulp2Content
16
+ class Pulp2to3MigrationPulp2Content
17
17
  attr_accessor :pulp_href
18
18
 
19
19
  # Timestamp of creation.
@@ -63,13 +63,13 @@ module Pulp2to3MigrationClient
63
63
  # @param [Hash] attributes Model attributes in the form of hash
64
64
  def initialize(attributes = {})
65
65
  if (!attributes.is_a?(Hash))
66
- fail ArgumentError, "The input argument (attributes) must be a hash in `Pulp2to3MigrationClient::Pulp2Content` initialize method"
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pulp2to3MigrationClient::Pulp2to3MigrationPulp2Content` initialize method"
67
67
  end
68
68
 
69
69
  # check to see if the attribute exists and convert string to symbol for hash key
70
70
  attributes = attributes.each_with_object({}) { |(k, v), h|
71
71
  if (!self.class.attribute_map.key?(k.to_sym))
72
- fail ArgumentError, "`#{k}` is not a valid attribute in `Pulp2to3MigrationClient::Pulp2Content`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pulp2to3MigrationClient::Pulp2to3MigrationPulp2Content`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
73
73
  end
74
74
  h[k.to_sym] = v
75
75
  }
@@ -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.2.1-SNAPSHOT
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 :is_migrated
27
+
28
+ attr_accessor :pulp3_repository_version
29
+
30
+ attr_accessor :pulp3_remote_href
31
+
32
+ attr_accessor :pulp3_publisher_href
33
+
34
+ attr_accessor :pulp3_publication_href
35
+
36
+ attr_accessor :pulp3_distribution_hrefs
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'pulp_href' => :'pulp_href',
42
+ :'pulp_created' => :'pulp_created',
43
+ :'pulp2_object_id' => :'pulp2_object_id',
44
+ :'pulp2_repo_id' => :'pulp2_repo_id',
45
+ :'is_migrated' => :'is_migrated',
46
+ :'pulp3_repository_version' => :'pulp3_repository_version',
47
+ :'pulp3_remote_href' => :'pulp3_remote_href',
48
+ :'pulp3_publisher_href' => :'pulp3_publisher_href',
49
+ :'pulp3_publication_href' => :'pulp3_publication_href',
50
+ :'pulp3_distribution_hrefs' => :'pulp3_distribution_hrefs'
51
+ }
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.openapi_types
56
+ {
57
+ :'pulp_href' => :'String',
58
+ :'pulp_created' => :'DateTime',
59
+ :'pulp2_object_id' => :'String',
60
+ :'pulp2_repo_id' => :'String',
61
+ :'is_migrated' => :'Boolean',
62
+ :'pulp3_repository_version' => :'String',
63
+ :'pulp3_remote_href' => :'String',
64
+ :'pulp3_publisher_href' => :'String',
65
+ :'pulp3_publication_href' => :'String',
66
+ :'pulp3_distribution_hrefs' => :'String'
67
+ }
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ def initialize(attributes = {})
73
+ if (!attributes.is_a?(Hash))
74
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pulp2to3MigrationClient::Pulp2to3MigrationPulp2Repository` initialize method"
75
+ end
76
+
77
+ # check to see if the attribute exists and convert string to symbol for hash key
78
+ attributes = attributes.each_with_object({}) { |(k, v), h|
79
+ if (!self.class.attribute_map.key?(k.to_sym))
80
+ 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
81
+ end
82
+ h[k.to_sym] = v
83
+ }
84
+
85
+ if attributes.key?(:'pulp_href')
86
+ self.pulp_href = attributes[:'pulp_href']
87
+ end
88
+
89
+ if attributes.key?(:'pulp_created')
90
+ self.pulp_created = attributes[:'pulp_created']
91
+ end
92
+
93
+ if attributes.key?(:'pulp2_object_id')
94
+ self.pulp2_object_id = attributes[:'pulp2_object_id']
95
+ end
96
+
97
+ if attributes.key?(:'pulp2_repo_id')
98
+ self.pulp2_repo_id = attributes[:'pulp2_repo_id']
99
+ end
100
+
101
+ if attributes.key?(:'is_migrated')
102
+ self.is_migrated = attributes[:'is_migrated']
103
+ else
104
+ self.is_migrated = false
105
+ end
106
+
107
+ if attributes.key?(:'pulp3_repository_version')
108
+ self.pulp3_repository_version = attributes[:'pulp3_repository_version']
109
+ end
110
+
111
+ if attributes.key?(:'pulp3_remote_href')
112
+ self.pulp3_remote_href = attributes[:'pulp3_remote_href']
113
+ end
114
+
115
+ if attributes.key?(:'pulp3_publisher_href')
116
+ self.pulp3_publisher_href = attributes[:'pulp3_publisher_href']
117
+ end
118
+
119
+ if attributes.key?(:'pulp3_publication_href')
120
+ self.pulp3_publication_href = attributes[:'pulp3_publication_href']
121
+ end
122
+
123
+ if attributes.key?(:'pulp3_distribution_hrefs')
124
+ self.pulp3_distribution_hrefs = attributes[:'pulp3_distribution_hrefs']
125
+ end
126
+ end
127
+
128
+ # Show invalid properties with the reasons. Usually used together with valid?
129
+ # @return Array for valid properties with the reasons
130
+ def list_invalid_properties
131
+ invalid_properties = Array.new
132
+ if @pulp2_object_id.nil?
133
+ invalid_properties.push('invalid value for "pulp2_object_id", pulp2_object_id cannot be nil.')
134
+ end
135
+
136
+ if @pulp2_object_id.to_s.length > 255
137
+ invalid_properties.push('invalid value for "pulp2_object_id", the character length must be smaller than or equal to 255.')
138
+ end
139
+
140
+ if @pulp2_object_id.to_s.length < 1
141
+ invalid_properties.push('invalid value for "pulp2_object_id", the character length must be great than or equal to 1.')
142
+ end
143
+
144
+ if @pulp2_repo_id.nil?
145
+ invalid_properties.push('invalid value for "pulp2_repo_id", pulp2_repo_id cannot be nil.')
146
+ end
147
+
148
+ if @pulp2_repo_id.to_s.length < 1
149
+ invalid_properties.push('invalid value for "pulp2_repo_id", the character length must be great than or equal to 1.')
150
+ end
151
+
152
+ invalid_properties
153
+ end
154
+
155
+ # Check to see if the all the properties in the model are valid
156
+ # @return true if the model is valid
157
+ def valid?
158
+ return false if @pulp2_object_id.nil?
159
+ return false if @pulp2_object_id.to_s.length > 255
160
+ return false if @pulp2_object_id.to_s.length < 1
161
+ return false if @pulp2_repo_id.nil?
162
+ return false if @pulp2_repo_id.to_s.length < 1
163
+ true
164
+ end
165
+
166
+ # Custom attribute writer method with validation
167
+ # @param [Object] pulp2_object_id Value to be assigned
168
+ def pulp2_object_id=(pulp2_object_id)
169
+ if pulp2_object_id.nil?
170
+ fail ArgumentError, 'pulp2_object_id cannot be nil'
171
+ end
172
+
173
+ if pulp2_object_id.to_s.length > 255
174
+ fail ArgumentError, 'invalid value for "pulp2_object_id", the character length must be smaller than or equal to 255.'
175
+ end
176
+
177
+ if pulp2_object_id.to_s.length < 1
178
+ fail ArgumentError, 'invalid value for "pulp2_object_id", the character length must be great than or equal to 1.'
179
+ end
180
+
181
+ @pulp2_object_id = pulp2_object_id
182
+ end
183
+
184
+ # Custom attribute writer method with validation
185
+ # @param [Object] pulp2_repo_id Value to be assigned
186
+ def pulp2_repo_id=(pulp2_repo_id)
187
+ if pulp2_repo_id.nil?
188
+ fail ArgumentError, 'pulp2_repo_id cannot be nil'
189
+ end
190
+
191
+ if pulp2_repo_id.to_s.length < 1
192
+ fail ArgumentError, 'invalid value for "pulp2_repo_id", the character length must be great than or equal to 1.'
193
+ end
194
+
195
+ @pulp2_repo_id = pulp2_repo_id
196
+ end
197
+
198
+ # Checks equality by comparing each attribute.
199
+ # @param [Object] Object to be compared
200
+ def ==(o)
201
+ return true if self.equal?(o)
202
+ self.class == o.class &&
203
+ pulp_href == o.pulp_href &&
204
+ pulp_created == o.pulp_created &&
205
+ pulp2_object_id == o.pulp2_object_id &&
206
+ pulp2_repo_id == o.pulp2_repo_id &&
207
+ is_migrated == o.is_migrated &&
208
+ pulp3_repository_version == o.pulp3_repository_version &&
209
+ pulp3_remote_href == o.pulp3_remote_href &&
210
+ pulp3_publisher_href == o.pulp3_publisher_href &&
211
+ pulp3_publication_href == o.pulp3_publication_href &&
212
+ pulp3_distribution_hrefs == o.pulp3_distribution_hrefs
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
+ [pulp_href, pulp_created, pulp2_object_id, pulp2_repo_id, is_migrated, pulp3_repository_version, pulp3_remote_href, pulp3_publisher_href, pulp3_publication_href, pulp3_distribution_hrefs].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
+ Pulp2to3MigrationClient.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
@@ -11,5 +11,5 @@ OpenAPI Generator version: 4.2.1-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module Pulp2to3MigrationClient
14
- VERSION = '0.0.1a1.dev01572548060'
14
+ VERSION = '0.0.1a1.dev01572634587'
15
15
  end
@@ -20,13 +20,16 @@ require 'pulp_2to3_migration_client/configuration'
20
20
  require 'pulp_2to3_migration_client/models/async_operation_response'
21
21
  require 'pulp_2to3_migration_client/models/inline_response200'
22
22
  require 'pulp_2to3_migration_client/models/inline_response2001'
23
- require 'pulp_2to3_migration_client/models/migration_plan'
23
+ require 'pulp_2to3_migration_client/models/inline_response2002'
24
24
  require 'pulp_2to3_migration_client/models/migration_plan_run'
25
- require 'pulp_2to3_migration_client/models/pulp2_content'
25
+ require 'pulp_2to3_migration_client/models/pulp2to3_migration_migration_plan'
26
+ require 'pulp_2to3_migration_client/models/pulp2to3_migration_pulp2_content'
27
+ require 'pulp_2to3_migration_client/models/pulp2to3_migration_pulp2_repository'
26
28
 
27
29
  # APIs
28
30
  require 'pulp_2to3_migration_client/api/migration_plans_api'
29
31
  require 'pulp_2to3_migration_client/api/pulp2content_api'
32
+ require 'pulp_2to3_migration_client/api/pulp2repositories_api'
30
33
 
31
34
  module Pulp2to3MigrationClient
32
35
  class << self
@@ -37,7 +37,7 @@ describe 'MigrationPlansApi' do
37
37
  # MigrationPlan ViewSet.
38
38
  # @param data
39
39
  # @param [Hash] opts the optional parameters
40
- # @return [MigrationPlan]
40
+ # @return [Pulp2to3MigrationMigrationPlan]
41
41
  describe 'create test' do
42
42
  it 'should work' do
43
43
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -78,7 +78,7 @@ describe 'MigrationPlansApi' do
78
78
  # @param [Hash] opts the optional parameters
79
79
  # @option opts [String] :fields A list of fields to include in the response.
80
80
  # @option opts [String] :exclude_fields A list of fields to exclude from the response.
81
- # @return [MigrationPlan]
81
+ # @return [Pulp2to3MigrationMigrationPlan]
82
82
  describe 'read test' do
83
83
  it 'should work' do
84
84
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -65,7 +65,7 @@ describe 'Pulp2contentApi' do
65
65
  # @param [Hash] opts the optional parameters
66
66
  # @option opts [String] :fields A list of fields to include in the response.
67
67
  # @option opts [String] :exclude_fields A list of fields to exclude from the response.
68
- # @return [Pulp2Content]
68
+ # @return [Pulp2to3MigrationPulp2Content]
69
69
  describe 'read test' do
70
70
  it 'should work' do
71
71
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers