pulpcore_client 3.2.1 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +37 -4
  3. data/docs/ArtifactsApi.md +2 -0
  4. data/docs/ExportersCoreExportsApi.md +243 -0
  5. data/docs/ExportersPulpApi.md +355 -0
  6. data/docs/Import.md +23 -0
  7. data/docs/ImportersCoreImportsApi.md +243 -0
  8. data/docs/ImportersPulpApi.md +355 -0
  9. data/docs/InlineResponse2001.md +1 -1
  10. data/docs/InlineResponse2002.md +1 -1
  11. data/docs/InlineResponse2003.md +1 -1
  12. data/docs/InlineResponse2004.md +1 -1
  13. data/docs/InlineResponse2005.md +23 -0
  14. data/docs/InlineResponse2006.md +23 -0
  15. data/docs/InlineResponse2007.md +23 -0
  16. data/docs/InlineResponse2008.md +23 -0
  17. data/docs/InlineResponse2009.md +23 -0
  18. data/docs/PulpExport.md +29 -0
  19. data/docs/PulpExporter.md +27 -0
  20. data/docs/PulpImport.md +17 -0
  21. data/docs/PulpImporter.md +23 -0
  22. data/docs/SigningServicesApi.md +6 -2
  23. data/docs/Task.md +6 -0
  24. data/docs/TaskGroup.md +29 -0
  25. data/docs/TaskGroupsApi.md +128 -0
  26. data/docs/TasksApi.md +10 -6
  27. data/docs/UploadsApi.md +4 -2
  28. data/docs/WorkersApi.md +4 -2
  29. data/lib/pulpcore_client/api/artifacts_api.rb +3 -0
  30. data/lib/pulpcore_client/api/exporters_core_exports_api.rb +297 -0
  31. data/lib/pulpcore_client/api/exporters_pulp_api.rb +431 -0
  32. data/lib/pulpcore_client/api/importers_core_imports_api.rb +297 -0
  33. data/lib/pulpcore_client/api/importers_pulp_api.rb +431 -0
  34. data/lib/pulpcore_client/api/signing_services_api.rb +9 -3
  35. data/lib/pulpcore_client/api/task_groups_api.rb +157 -0
  36. data/lib/pulpcore_client/api/tasks_api.rb +15 -9
  37. data/lib/pulpcore_client/api/uploads_api.rb +6 -3
  38. data/lib/pulpcore_client/api/workers_api.rb +6 -3
  39. data/lib/pulpcore_client/models/import.rb +246 -0
  40. data/lib/pulpcore_client/models/inline_response2001.rb +1 -1
  41. data/lib/pulpcore_client/models/inline_response2002.rb +1 -1
  42. data/lib/pulpcore_client/models/inline_response2003.rb +1 -1
  43. data/lib/pulpcore_client/models/inline_response2004.rb +1 -1
  44. data/lib/pulpcore_client/models/inline_response2005.rb +247 -0
  45. data/lib/pulpcore_client/models/inline_response2006.rb +247 -0
  46. data/lib/pulpcore_client/models/inline_response2007.rb +247 -0
  47. data/lib/pulpcore_client/models/inline_response2008.rb +247 -0
  48. data/lib/pulpcore_client/models/inline_response2009.rb +247 -0
  49. data/lib/pulpcore_client/models/pulp_export.rb +310 -0
  50. data/lib/pulpcore_client/models/pulp_exporter.rb +310 -0
  51. data/lib/pulpcore_client/models/pulp_import.rb +231 -0
  52. data/lib/pulpcore_client/models/pulp_importer.rb +262 -0
  53. data/lib/pulpcore_client/models/task.rb +33 -1
  54. data/lib/pulpcore_client/models/task_group.rb +291 -0
  55. data/lib/pulpcore_client/version.rb +1 -1
  56. data/lib/pulpcore_client.rb +16 -0
  57. data/spec/api/artifacts_api_spec.rb +1 -0
  58. data/spec/api/exporters_core_exports_api_spec.rb +91 -0
  59. data/spec/api/exporters_pulp_api_spec.rb +117 -0
  60. data/spec/api/importers_core_imports_api_spec.rb +91 -0
  61. data/spec/api/importers_pulp_api_spec.rb +117 -0
  62. data/spec/api/signing_services_api_spec.rb +3 -1
  63. data/spec/api/task_groups_api_spec.rb +63 -0
  64. data/spec/api/tasks_api_spec.rb +5 -3
  65. data/spec/api/uploads_api_spec.rb +2 -1
  66. data/spec/api/workers_api_spec.rb +2 -1
  67. data/spec/models/import_spec.rb +59 -0
  68. data/spec/models/inline_response2005_spec.rb +59 -0
  69. data/spec/models/inline_response2006_spec.rb +59 -0
  70. data/spec/models/inline_response2007_spec.rb +59 -0
  71. data/spec/models/inline_response2008_spec.rb +59 -0
  72. data/spec/models/inline_response2009_spec.rb +59 -0
  73. data/spec/models/pulp_export_spec.rb +77 -0
  74. data/spec/models/pulp_exporter_spec.rb +71 -0
  75. data/spec/models/pulp_import_spec.rb +41 -0
  76. data/spec/models/pulp_importer_spec.rb +59 -0
  77. data/spec/models/task_group_spec.rb +77 -0
  78. data/spec/models/task_spec.rb +18 -0
  79. metadata +66 -2
@@ -0,0 +1,310 @@
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 PulpcoreClient
16
+ class PulpExporter
17
+ attr_accessor :pulp_href
18
+
19
+ # Timestamp of creation.
20
+ attr_accessor :pulp_created
21
+
22
+ # Unique name of the file system exporter.
23
+ attr_accessor :name
24
+
25
+ # File system directory to store exported tar.gzs.
26
+ attr_accessor :path
27
+
28
+ attr_accessor :repositories
29
+
30
+ # Last attempted export for this PulpExporter
31
+ attr_accessor :last_export
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'pulp_href' => :'pulp_href',
37
+ :'pulp_created' => :'pulp_created',
38
+ :'name' => :'name',
39
+ :'path' => :'path',
40
+ :'repositories' => :'repositories',
41
+ :'last_export' => :'last_export'
42
+ }
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'pulp_href' => :'String',
49
+ :'pulp_created' => :'DateTime',
50
+ :'name' => :'String',
51
+ :'path' => :'String',
52
+ :'repositories' => :'Array<String>',
53
+ :'last_export' => :'String'
54
+ }
55
+ end
56
+
57
+ # List of attributes with nullable: true
58
+ def self.openapi_nullable
59
+ Set.new([
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 `PulpcoreClient::PulpExporter` 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 `PulpcoreClient::PulpExporter`. 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?(:'pulp_href')
79
+ self.pulp_href = attributes[:'pulp_href']
80
+ end
81
+
82
+ if attributes.key?(:'pulp_created')
83
+ self.pulp_created = attributes[:'pulp_created']
84
+ end
85
+
86
+ if attributes.key?(:'name')
87
+ self.name = attributes[:'name']
88
+ end
89
+
90
+ if attributes.key?(:'path')
91
+ self.path = attributes[:'path']
92
+ end
93
+
94
+ if attributes.key?(:'repositories')
95
+ if (value = attributes[:'repositories']).is_a?(Array)
96
+ self.repositories = value
97
+ end
98
+ end
99
+
100
+ if attributes.key?(:'last_export')
101
+ self.last_export = attributes[:'last_export']
102
+ end
103
+ end
104
+
105
+ # Show invalid properties with the reasons. Usually used together with valid?
106
+ # @return Array for valid properties with the reasons
107
+ def list_invalid_properties
108
+ invalid_properties = Array.new
109
+ if @name.nil?
110
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
111
+ end
112
+
113
+ if @name.to_s.length < 1
114
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
115
+ end
116
+
117
+ if @path.nil?
118
+ invalid_properties.push('invalid value for "path", path cannot be nil.')
119
+ end
120
+
121
+ if @path.to_s.length < 1
122
+ invalid_properties.push('invalid value for "path", the character length must be great than or equal to 1.')
123
+ end
124
+
125
+ if @repositories.nil?
126
+ invalid_properties.push('invalid value for "repositories", repositories cannot be nil.')
127
+ end
128
+
129
+ invalid_properties
130
+ end
131
+
132
+ # Check to see if the all the properties in the model are valid
133
+ # @return true if the model is valid
134
+ def valid?
135
+ return false if @name.nil?
136
+ return false if @name.to_s.length < 1
137
+ return false if @path.nil?
138
+ return false if @path.to_s.length < 1
139
+ return false if @repositories.nil?
140
+ true
141
+ end
142
+
143
+ # Custom attribute writer method with validation
144
+ # @param [Object] name Value to be assigned
145
+ def name=(name)
146
+ if name.nil?
147
+ fail ArgumentError, 'name cannot be nil'
148
+ end
149
+
150
+ if name.to_s.length < 1
151
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
152
+ end
153
+
154
+ @name = name
155
+ end
156
+
157
+ # Custom attribute writer method with validation
158
+ # @param [Object] path Value to be assigned
159
+ def path=(path)
160
+ if path.nil?
161
+ fail ArgumentError, 'path cannot be nil'
162
+ end
163
+
164
+ if path.to_s.length < 1
165
+ fail ArgumentError, 'invalid value for "path", the character length must be great than or equal to 1.'
166
+ end
167
+
168
+ @path = path
169
+ end
170
+
171
+ # Checks equality by comparing each attribute.
172
+ # @param [Object] Object to be compared
173
+ def ==(o)
174
+ return true if self.equal?(o)
175
+ self.class == o.class &&
176
+ pulp_href == o.pulp_href &&
177
+ pulp_created == o.pulp_created &&
178
+ name == o.name &&
179
+ path == o.path &&
180
+ repositories == o.repositories &&
181
+ last_export == o.last_export
182
+ end
183
+
184
+ # @see the `==` method
185
+ # @param [Object] Object to be compared
186
+ def eql?(o)
187
+ self == o
188
+ end
189
+
190
+ # Calculates hash code according to all attributes.
191
+ # @return [Integer] Hash code
192
+ def hash
193
+ [pulp_href, pulp_created, name, path, repositories, last_export].hash
194
+ end
195
+
196
+ # Builds the object from hash
197
+ # @param [Hash] attributes Model attributes in the form of hash
198
+ # @return [Object] Returns the model itself
199
+ def self.build_from_hash(attributes)
200
+ new.build_from_hash(attributes)
201
+ end
202
+
203
+ # Builds the object from hash
204
+ # @param [Hash] attributes Model attributes in the form of hash
205
+ # @return [Object] Returns the model itself
206
+ def build_from_hash(attributes)
207
+ return nil unless attributes.is_a?(Hash)
208
+ self.class.openapi_types.each_pair do |key, type|
209
+ if type =~ /\AArray<(.*)>/i
210
+ # check to ensure the input is an array given that the attribute
211
+ # is documented as an array but the input is not
212
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
213
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
214
+ end
215
+ elsif !attributes[self.class.attribute_map[key]].nil?
216
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
217
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
218
+ end
219
+
220
+ self
221
+ end
222
+
223
+ # Deserializes the data based on type
224
+ # @param string type Data type
225
+ # @param string value Value to be deserialized
226
+ # @return [Object] Deserialized data
227
+ def _deserialize(type, value)
228
+ case type.to_sym
229
+ when :DateTime
230
+ DateTime.parse(value)
231
+ when :Date
232
+ Date.parse(value)
233
+ when :String
234
+ value.to_s
235
+ when :Integer
236
+ value.to_i
237
+ when :Float
238
+ value.to_f
239
+ when :Boolean
240
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
241
+ true
242
+ else
243
+ false
244
+ end
245
+ when :Object
246
+ # generic object (usually a Hash), return directly
247
+ value
248
+ when /\AArray<(?<inner_type>.+)>\z/
249
+ inner_type = Regexp.last_match[:inner_type]
250
+ value.map { |v| _deserialize(inner_type, v) }
251
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
252
+ k_type = Regexp.last_match[:k_type]
253
+ v_type = Regexp.last_match[:v_type]
254
+ {}.tap do |hash|
255
+ value.each do |k, v|
256
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
257
+ end
258
+ end
259
+ else # model
260
+ PulpcoreClient.const_get(type).build_from_hash(value)
261
+ end
262
+ end
263
+
264
+ # Returns the string representation of the object
265
+ # @return [String] String presentation of the object
266
+ def to_s
267
+ to_hash.to_s
268
+ end
269
+
270
+ # to_body is an alias to to_hash (backward compatibility)
271
+ # @return [Hash] Returns the object in the form of hash
272
+ def to_body
273
+ to_hash
274
+ end
275
+
276
+ # Returns the object in the form of hash
277
+ # @return [Hash] Returns the object in the form of hash
278
+ def to_hash
279
+ hash = {}
280
+ self.class.attribute_map.each_pair do |attr, param|
281
+ value = self.send(attr)
282
+ if value.nil?
283
+ is_nullable = self.class.openapi_nullable.include?(attr)
284
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
285
+ end
286
+
287
+ hash[param] = _to_hash(value)
288
+ end
289
+ hash
290
+ end
291
+
292
+ # Outputs non-array value in the form of hash
293
+ # For object, use to_hash. Otherwise, just return the value
294
+ # @param [Object] value Any valid value
295
+ # @return [Hash] Returns the value in the form of hash
296
+ def _to_hash(value)
297
+ if value.is_a?(Array)
298
+ value.compact.map { |v| _to_hash(v) }
299
+ elsif value.is_a?(Hash)
300
+ {}.tap do |hash|
301
+ value.each { |k, v| hash[k] = _to_hash(v) }
302
+ end
303
+ elsif value.respond_to? :to_hash
304
+ value.to_hash
305
+ else
306
+ value
307
+ end
308
+ end
309
+ end
310
+ end
@@ -0,0 +1,231 @@
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 PulpcoreClient
16
+ class PulpImport
17
+ # Path to export that will be imported.
18
+ attr_accessor :path
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'path' => :'path'
24
+ }
25
+ end
26
+
27
+ # Attribute type mapping.
28
+ def self.openapi_types
29
+ {
30
+ :'path' => :'String'
31
+ }
32
+ end
33
+
34
+ # List of attributes with nullable: true
35
+ def self.openapi_nullable
36
+ Set.new([
37
+ ])
38
+ end
39
+
40
+ # Initializes the object
41
+ # @param [Hash] attributes Model attributes in the form of hash
42
+ def initialize(attributes = {})
43
+ if (!attributes.is_a?(Hash))
44
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpcoreClient::PulpImport` initialize method"
45
+ end
46
+
47
+ # check to see if the attribute exists and convert string to symbol for hash key
48
+ attributes = attributes.each_with_object({}) { |(k, v), h|
49
+ if (!self.class.attribute_map.key?(k.to_sym))
50
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpcoreClient::PulpImport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
51
+ end
52
+ h[k.to_sym] = v
53
+ }
54
+
55
+ if attributes.key?(:'path')
56
+ self.path = attributes[:'path']
57
+ end
58
+ end
59
+
60
+ # Show invalid properties with the reasons. Usually used together with valid?
61
+ # @return Array for valid properties with the reasons
62
+ def list_invalid_properties
63
+ invalid_properties = Array.new
64
+ if @path.nil?
65
+ invalid_properties.push('invalid value for "path", path cannot be nil.')
66
+ end
67
+
68
+ if @path.to_s.length < 1
69
+ invalid_properties.push('invalid value for "path", the character length must be great than or equal to 1.')
70
+ end
71
+
72
+ invalid_properties
73
+ end
74
+
75
+ # Check to see if the all the properties in the model are valid
76
+ # @return true if the model is valid
77
+ def valid?
78
+ return false if @path.nil?
79
+ return false if @path.to_s.length < 1
80
+ true
81
+ end
82
+
83
+ # Custom attribute writer method with validation
84
+ # @param [Object] path Value to be assigned
85
+ def path=(path)
86
+ if path.nil?
87
+ fail ArgumentError, 'path cannot be nil'
88
+ end
89
+
90
+ if path.to_s.length < 1
91
+ fail ArgumentError, 'invalid value for "path", the character length must be great than or equal to 1.'
92
+ end
93
+
94
+ @path = path
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ path == o.path
103
+ end
104
+
105
+ # @see the `==` method
106
+ # @param [Object] Object to be compared
107
+ def eql?(o)
108
+ self == o
109
+ end
110
+
111
+ # Calculates hash code according to all attributes.
112
+ # @return [Integer] Hash code
113
+ def hash
114
+ [path].hash
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def self.build_from_hash(attributes)
121
+ new.build_from_hash(attributes)
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ self.class.openapi_types.each_pair do |key, type|
130
+ if type =~ /\AArray<(.*)>/i
131
+ # check to ensure the input is an array given that the attribute
132
+ # is documented as an array but the input is not
133
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
134
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
135
+ end
136
+ elsif !attributes[self.class.attribute_map[key]].nil?
137
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
138
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
139
+ end
140
+
141
+ self
142
+ end
143
+
144
+ # Deserializes the data based on type
145
+ # @param string type Data type
146
+ # @param string value Value to be deserialized
147
+ # @return [Object] Deserialized data
148
+ def _deserialize(type, value)
149
+ case type.to_sym
150
+ when :DateTime
151
+ DateTime.parse(value)
152
+ when :Date
153
+ Date.parse(value)
154
+ when :String
155
+ value.to_s
156
+ when :Integer
157
+ value.to_i
158
+ when :Float
159
+ value.to_f
160
+ when :Boolean
161
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
162
+ true
163
+ else
164
+ false
165
+ end
166
+ when :Object
167
+ # generic object (usually a Hash), return directly
168
+ value
169
+ when /\AArray<(?<inner_type>.+)>\z/
170
+ inner_type = Regexp.last_match[:inner_type]
171
+ value.map { |v| _deserialize(inner_type, v) }
172
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
173
+ k_type = Regexp.last_match[:k_type]
174
+ v_type = Regexp.last_match[:v_type]
175
+ {}.tap do |hash|
176
+ value.each do |k, v|
177
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
178
+ end
179
+ end
180
+ else # model
181
+ PulpcoreClient.const_get(type).build_from_hash(value)
182
+ end
183
+ end
184
+
185
+ # Returns the string representation of the object
186
+ # @return [String] String presentation of the object
187
+ def to_s
188
+ to_hash.to_s
189
+ end
190
+
191
+ # to_body is an alias to to_hash (backward compatibility)
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_body
194
+ to_hash
195
+ end
196
+
197
+ # Returns the object in the form of hash
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_hash
200
+ hash = {}
201
+ self.class.attribute_map.each_pair do |attr, param|
202
+ value = self.send(attr)
203
+ if value.nil?
204
+ is_nullable = self.class.openapi_nullable.include?(attr)
205
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
206
+ end
207
+
208
+ hash[param] = _to_hash(value)
209
+ end
210
+ hash
211
+ end
212
+
213
+ # Outputs non-array value in the form of hash
214
+ # For object, use to_hash. Otherwise, just return the value
215
+ # @param [Object] value Any valid value
216
+ # @return [Hash] Returns the value in the form of hash
217
+ def _to_hash(value)
218
+ if value.is_a?(Array)
219
+ value.compact.map { |v| _to_hash(v) }
220
+ elsif value.is_a?(Hash)
221
+ {}.tap do |hash|
222
+ value.each { |k, v| hash[k] = _to_hash(v) }
223
+ end
224
+ elsif value.respond_to? :to_hash
225
+ value.to_hash
226
+ else
227
+ value
228
+ end
229
+ end
230
+ end
231
+ end