pulpcore_client 3.4.1 → 3.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -15
- data/docs/{ArtifactRead.md → Artifact.md} +2 -2
- data/docs/ArtifactsApi.md +10 -10
- data/docs/ExportersCoreExportsApi.md +2 -2
- data/docs/ExportersPulpApi.md +8 -8
- data/docs/GroupProgressReport.md +25 -0
- data/docs/{ImportRead.md → Import.md} +2 -2
- data/docs/ImportersCoreImportsApi.md +2 -2
- data/docs/ImportersPulpApi.md +8 -8
- data/docs/InlineResponse200.md +1 -1
- data/docs/InlineResponse2001.md +1 -1
- data/docs/InlineResponse2002.md +1 -1
- data/docs/InlineResponse2003.md +1 -1
- data/docs/InlineResponse2004.md +1 -1
- data/docs/InlineResponse2005.md +1 -1
- data/docs/InlineResponse2006.md +1 -1
- data/docs/InlineResponse2007.md +1 -1
- data/docs/InlineResponse2008.md +1 -1
- data/docs/InlineResponse2009.md +1 -1
- data/docs/PulpExport.md +0 -8
- data/docs/{SigningServiceRead.md → SigningService.md} +2 -2
- data/docs/SigningServicesApi.md +2 -2
- data/docs/{TaskGroupRead.md → TaskGroup.md} +5 -3
- data/docs/TaskGroupsApi.md +2 -2
- data/docs/TasksApi.md +2 -2
- data/docs/{UploadDetailRead.md → UploadDetail.md} +2 -2
- data/docs/UploadsApi.md +4 -6
- data/docs/WorkersApi.md +4 -4
- data/lib/pulpcore_client/api/artifacts_api.rb +15 -15
- data/lib/pulpcore_client/api/exporters_core_exports_api.rb +3 -3
- data/lib/pulpcore_client/api/exporters_pulp_api.rb +12 -12
- data/lib/pulpcore_client/api/importers_core_imports_api.rb +3 -3
- data/lib/pulpcore_client/api/importers_pulp_api.rb +12 -12
- data/lib/pulpcore_client/api/signing_services_api.rb +3 -3
- data/lib/pulpcore_client/api/task_groups_api.rb +3 -3
- data/lib/pulpcore_client/api/tasks_api.rb +3 -3
- data/lib/pulpcore_client/api/uploads_api.rb +6 -9
- data/lib/pulpcore_client/api/workers_api.rb +6 -6
- data/lib/pulpcore_client/models/{artifact_read.rb → artifact.rb} +3 -3
- data/lib/pulpcore_client/models/{pulp_importer_read.rb → group_progress_report.rb} +77 -46
- data/lib/pulpcore_client/models/{import_read.rb → import.rb} +3 -3
- data/lib/pulpcore_client/models/inline_response200.rb +1 -1
- data/lib/pulpcore_client/models/inline_response2001.rb +1 -1
- data/lib/pulpcore_client/models/inline_response2002.rb +1 -1
- data/lib/pulpcore_client/models/inline_response2003.rb +1 -1
- data/lib/pulpcore_client/models/inline_response2004.rb +1 -1
- data/lib/pulpcore_client/models/inline_response2005.rb +1 -1
- data/lib/pulpcore_client/models/inline_response2006.rb +1 -1
- data/lib/pulpcore_client/models/inline_response2007.rb +1 -1
- data/lib/pulpcore_client/models/inline_response2008.rb +1 -1
- data/lib/pulpcore_client/models/inline_response2009.rb +1 -1
- data/lib/pulpcore_client/models/pulp_export.rb +1 -62
- data/lib/pulpcore_client/models/{signing_service_read.rb → signing_service.rb} +3 -3
- data/lib/pulpcore_client/models/{task_group_read.rb → task_group.rb} +18 -7
- data/lib/pulpcore_client/models/{upload_detail_read.rb → upload_detail.rb} +3 -3
- data/lib/pulpcore_client/version.rb +1 -1
- data/lib/pulpcore_client.rb +6 -11
- data/spec/api/artifacts_api_spec.rb +5 -5
- data/spec/api/exporters_core_exports_api_spec.rb +1 -1
- data/spec/api/exporters_pulp_api_spec.rb +4 -4
- data/spec/api/importers_core_imports_api_spec.rb +1 -1
- data/spec/api/importers_pulp_api_spec.rb +4 -4
- data/spec/api/signing_services_api_spec.rb +1 -1
- data/spec/api/task_groups_api_spec.rb +1 -1
- data/spec/api/tasks_api_spec.rb +1 -1
- data/spec/api/uploads_api_spec.rb +2 -3
- data/spec/api/workers_api_spec.rb +2 -2
- data/spec/models/{artifact_read_spec.rb → artifact_spec.rb} +6 -6
- data/spec/models/{pulp_exporter_read_spec.rb → group_progress_report_spec.rb} +11 -17
- data/spec/models/{import_read_spec.rb → import_spec.rb} +6 -6
- data/spec/models/pulp_export_spec.rb +0 -24
- data/spec/models/{signing_service_read_spec.rb → signing_service_spec.rb} +6 -6
- data/spec/models/{task_group_read_spec.rb → task_group_spec.rb} +12 -6
- data/spec/models/{upload_detail_read_spec.rb → upload_detail_spec.rb} +6 -6
- metadata +26 -46
- data/docs/PulpExportRead.md +0 -27
- data/docs/PulpExporterRead.md +0 -27
- data/docs/PulpImporterRead.md +0 -23
- data/docs/TaskRead.md +0 -43
- data/docs/UploadRead.md +0 -23
- data/docs/WorkerRead.md +0 -23
- data/lib/pulpcore_client/models/pulp_export_read.rb +0 -259
- data/lib/pulpcore_client/models/pulp_exporter_read.rb +0 -311
- data/lib/pulpcore_client/models/task_read.rb +0 -383
- data/lib/pulpcore_client/models/upload_read.rb +0 -241
- data/lib/pulpcore_client/models/worker_read.rb +0 -251
- data/spec/models/pulp_export_read_spec.rb +0 -71
- data/spec/models/pulp_importer_read_spec.rb +0 -59
- data/spec/models/task_read_spec.rb +0 -119
- data/spec/models/upload_read_spec.rb +0 -59
- data/spec/models/worker_read_spec.rb +0 -59
@@ -1,311 +0,0 @@
|
|
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 PulpExporterRead
|
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
|
-
:'last_export'
|
61
|
-
])
|
62
|
-
end
|
63
|
-
|
64
|
-
# Initializes the object
|
65
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
66
|
-
def initialize(attributes = {})
|
67
|
-
if (!attributes.is_a?(Hash))
|
68
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpcoreClient::PulpExporterRead` initialize method"
|
69
|
-
end
|
70
|
-
|
71
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
72
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
73
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
74
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpcoreClient::PulpExporterRead`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
75
|
-
end
|
76
|
-
h[k.to_sym] = v
|
77
|
-
}
|
78
|
-
|
79
|
-
if attributes.key?(:'pulp_href')
|
80
|
-
self.pulp_href = attributes[:'pulp_href']
|
81
|
-
end
|
82
|
-
|
83
|
-
if attributes.key?(:'pulp_created')
|
84
|
-
self.pulp_created = attributes[:'pulp_created']
|
85
|
-
end
|
86
|
-
|
87
|
-
if attributes.key?(:'name')
|
88
|
-
self.name = attributes[:'name']
|
89
|
-
end
|
90
|
-
|
91
|
-
if attributes.key?(:'path')
|
92
|
-
self.path = attributes[:'path']
|
93
|
-
end
|
94
|
-
|
95
|
-
if attributes.key?(:'repositories')
|
96
|
-
if (value = attributes[:'repositories']).is_a?(Array)
|
97
|
-
self.repositories = value
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
if attributes.key?(:'last_export')
|
102
|
-
self.last_export = attributes[:'last_export']
|
103
|
-
end
|
104
|
-
end
|
105
|
-
|
106
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
107
|
-
# @return Array for valid properties with the reasons
|
108
|
-
def list_invalid_properties
|
109
|
-
invalid_properties = Array.new
|
110
|
-
if @name.nil?
|
111
|
-
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
112
|
-
end
|
113
|
-
|
114
|
-
if @name.to_s.length < 1
|
115
|
-
invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
|
116
|
-
end
|
117
|
-
|
118
|
-
if @path.nil?
|
119
|
-
invalid_properties.push('invalid value for "path", path cannot be nil.')
|
120
|
-
end
|
121
|
-
|
122
|
-
if @path.to_s.length < 1
|
123
|
-
invalid_properties.push('invalid value for "path", the character length must be great than or equal to 1.')
|
124
|
-
end
|
125
|
-
|
126
|
-
if @repositories.nil?
|
127
|
-
invalid_properties.push('invalid value for "repositories", repositories cannot be nil.')
|
128
|
-
end
|
129
|
-
|
130
|
-
invalid_properties
|
131
|
-
end
|
132
|
-
|
133
|
-
# Check to see if the all the properties in the model are valid
|
134
|
-
# @return true if the model is valid
|
135
|
-
def valid?
|
136
|
-
return false if @name.nil?
|
137
|
-
return false if @name.to_s.length < 1
|
138
|
-
return false if @path.nil?
|
139
|
-
return false if @path.to_s.length < 1
|
140
|
-
return false if @repositories.nil?
|
141
|
-
true
|
142
|
-
end
|
143
|
-
|
144
|
-
# Custom attribute writer method with validation
|
145
|
-
# @param [Object] name Value to be assigned
|
146
|
-
def name=(name)
|
147
|
-
if name.nil?
|
148
|
-
fail ArgumentError, 'name cannot be nil'
|
149
|
-
end
|
150
|
-
|
151
|
-
if name.to_s.length < 1
|
152
|
-
fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
|
153
|
-
end
|
154
|
-
|
155
|
-
@name = name
|
156
|
-
end
|
157
|
-
|
158
|
-
# Custom attribute writer method with validation
|
159
|
-
# @param [Object] path Value to be assigned
|
160
|
-
def path=(path)
|
161
|
-
if path.nil?
|
162
|
-
fail ArgumentError, 'path cannot be nil'
|
163
|
-
end
|
164
|
-
|
165
|
-
if path.to_s.length < 1
|
166
|
-
fail ArgumentError, 'invalid value for "path", the character length must be great than or equal to 1.'
|
167
|
-
end
|
168
|
-
|
169
|
-
@path = path
|
170
|
-
end
|
171
|
-
|
172
|
-
# Checks equality by comparing each attribute.
|
173
|
-
# @param [Object] Object to be compared
|
174
|
-
def ==(o)
|
175
|
-
return true if self.equal?(o)
|
176
|
-
self.class == o.class &&
|
177
|
-
pulp_href == o.pulp_href &&
|
178
|
-
pulp_created == o.pulp_created &&
|
179
|
-
name == o.name &&
|
180
|
-
path == o.path &&
|
181
|
-
repositories == o.repositories &&
|
182
|
-
last_export == o.last_export
|
183
|
-
end
|
184
|
-
|
185
|
-
# @see the `==` method
|
186
|
-
# @param [Object] Object to be compared
|
187
|
-
def eql?(o)
|
188
|
-
self == o
|
189
|
-
end
|
190
|
-
|
191
|
-
# Calculates hash code according to all attributes.
|
192
|
-
# @return [Integer] Hash code
|
193
|
-
def hash
|
194
|
-
[pulp_href, pulp_created, name, path, repositories, last_export].hash
|
195
|
-
end
|
196
|
-
|
197
|
-
# Builds the object from hash
|
198
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
199
|
-
# @return [Object] Returns the model itself
|
200
|
-
def self.build_from_hash(attributes)
|
201
|
-
new.build_from_hash(attributes)
|
202
|
-
end
|
203
|
-
|
204
|
-
# Builds the object from hash
|
205
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
206
|
-
# @return [Object] Returns the model itself
|
207
|
-
def build_from_hash(attributes)
|
208
|
-
return nil unless attributes.is_a?(Hash)
|
209
|
-
self.class.openapi_types.each_pair do |key, type|
|
210
|
-
if type =~ /\AArray<(.*)>/i
|
211
|
-
# check to ensure the input is an array given that the attribute
|
212
|
-
# is documented as an array but the input is not
|
213
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
214
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
215
|
-
end
|
216
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
217
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
218
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
219
|
-
end
|
220
|
-
|
221
|
-
self
|
222
|
-
end
|
223
|
-
|
224
|
-
# Deserializes the data based on type
|
225
|
-
# @param string type Data type
|
226
|
-
# @param string value Value to be deserialized
|
227
|
-
# @return [Object] Deserialized data
|
228
|
-
def _deserialize(type, value)
|
229
|
-
case type.to_sym
|
230
|
-
when :DateTime
|
231
|
-
DateTime.parse(value)
|
232
|
-
when :Date
|
233
|
-
Date.parse(value)
|
234
|
-
when :String
|
235
|
-
value.to_s
|
236
|
-
when :Integer
|
237
|
-
value.to_i
|
238
|
-
when :Float
|
239
|
-
value.to_f
|
240
|
-
when :Boolean
|
241
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
242
|
-
true
|
243
|
-
else
|
244
|
-
false
|
245
|
-
end
|
246
|
-
when :Object
|
247
|
-
# generic object (usually a Hash), return directly
|
248
|
-
value
|
249
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
250
|
-
inner_type = Regexp.last_match[:inner_type]
|
251
|
-
value.map { |v| _deserialize(inner_type, v) }
|
252
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
253
|
-
k_type = Regexp.last_match[:k_type]
|
254
|
-
v_type = Regexp.last_match[:v_type]
|
255
|
-
{}.tap do |hash|
|
256
|
-
value.each do |k, v|
|
257
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
258
|
-
end
|
259
|
-
end
|
260
|
-
else # model
|
261
|
-
PulpcoreClient.const_get(type).build_from_hash(value)
|
262
|
-
end
|
263
|
-
end
|
264
|
-
|
265
|
-
# Returns the string representation of the object
|
266
|
-
# @return [String] String presentation of the object
|
267
|
-
def to_s
|
268
|
-
to_hash.to_s
|
269
|
-
end
|
270
|
-
|
271
|
-
# to_body is an alias to to_hash (backward compatibility)
|
272
|
-
# @return [Hash] Returns the object in the form of hash
|
273
|
-
def to_body
|
274
|
-
to_hash
|
275
|
-
end
|
276
|
-
|
277
|
-
# Returns the object in the form of hash
|
278
|
-
# @return [Hash] Returns the object in the form of hash
|
279
|
-
def to_hash
|
280
|
-
hash = {}
|
281
|
-
self.class.attribute_map.each_pair do |attr, param|
|
282
|
-
value = self.send(attr)
|
283
|
-
if value.nil?
|
284
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
285
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
286
|
-
end
|
287
|
-
|
288
|
-
hash[param] = _to_hash(value)
|
289
|
-
end
|
290
|
-
hash
|
291
|
-
end
|
292
|
-
|
293
|
-
# Outputs non-array value in the form of hash
|
294
|
-
# For object, use to_hash. Otherwise, just return the value
|
295
|
-
# @param [Object] value Any valid value
|
296
|
-
# @return [Hash] Returns the value in the form of hash
|
297
|
-
def _to_hash(value)
|
298
|
-
if value.is_a?(Array)
|
299
|
-
value.compact.map { |v| _to_hash(v) }
|
300
|
-
elsif value.is_a?(Hash)
|
301
|
-
{}.tap do |hash|
|
302
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
303
|
-
end
|
304
|
-
elsif value.respond_to? :to_hash
|
305
|
-
value.to_hash
|
306
|
-
else
|
307
|
-
value
|
308
|
-
end
|
309
|
-
end
|
310
|
-
end
|
311
|
-
end
|
@@ -1,383 +0,0 @@
|
|
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 TaskRead
|
17
|
-
attr_accessor :pulp_href
|
18
|
-
|
19
|
-
# Timestamp of creation.
|
20
|
-
attr_accessor :pulp_created
|
21
|
-
|
22
|
-
# The current state of the task. The possible values include: 'waiting', 'skipped', 'running', 'completed', 'failed' and 'canceled'.
|
23
|
-
attr_accessor :state
|
24
|
-
|
25
|
-
# The name of task.
|
26
|
-
attr_accessor :name
|
27
|
-
|
28
|
-
# Timestamp of the when this task started execution.
|
29
|
-
attr_accessor :started_at
|
30
|
-
|
31
|
-
# Timestamp of the when this task stopped execution.
|
32
|
-
attr_accessor :finished_at
|
33
|
-
|
34
|
-
# A JSON Object of a fatal error encountered during the execution of this task.
|
35
|
-
attr_accessor :error
|
36
|
-
|
37
|
-
# The worker associated with this task. This field is empty if a worker is not yet assigned.
|
38
|
-
attr_accessor :worker
|
39
|
-
|
40
|
-
# The parent task that spawned this task.
|
41
|
-
attr_accessor :parent_task
|
42
|
-
|
43
|
-
# Any tasks spawned by this task.
|
44
|
-
attr_accessor :child_tasks
|
45
|
-
|
46
|
-
# The task group that this task is a member of.
|
47
|
-
attr_accessor :task_group
|
48
|
-
|
49
|
-
attr_accessor :progress_reports
|
50
|
-
|
51
|
-
# Resources created by this task.
|
52
|
-
attr_accessor :created_resources
|
53
|
-
|
54
|
-
attr_accessor :reserved_resources_record
|
55
|
-
|
56
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
57
|
-
def self.attribute_map
|
58
|
-
{
|
59
|
-
:'pulp_href' => :'pulp_href',
|
60
|
-
:'pulp_created' => :'pulp_created',
|
61
|
-
:'state' => :'state',
|
62
|
-
:'name' => :'name',
|
63
|
-
:'started_at' => :'started_at',
|
64
|
-
:'finished_at' => :'finished_at',
|
65
|
-
:'error' => :'error',
|
66
|
-
:'worker' => :'worker',
|
67
|
-
:'parent_task' => :'parent_task',
|
68
|
-
:'child_tasks' => :'child_tasks',
|
69
|
-
:'task_group' => :'task_group',
|
70
|
-
:'progress_reports' => :'progress_reports',
|
71
|
-
:'created_resources' => :'created_resources',
|
72
|
-
:'reserved_resources_record' => :'reserved_resources_record'
|
73
|
-
}
|
74
|
-
end
|
75
|
-
|
76
|
-
# Attribute type mapping.
|
77
|
-
def self.openapi_types
|
78
|
-
{
|
79
|
-
:'pulp_href' => :'String',
|
80
|
-
:'pulp_created' => :'DateTime',
|
81
|
-
:'state' => :'String',
|
82
|
-
:'name' => :'String',
|
83
|
-
:'started_at' => :'DateTime',
|
84
|
-
:'finished_at' => :'DateTime',
|
85
|
-
:'error' => :'Hash<String, Object>',
|
86
|
-
:'worker' => :'String',
|
87
|
-
:'parent_task' => :'String',
|
88
|
-
:'child_tasks' => :'Array<String>',
|
89
|
-
:'task_group' => :'String',
|
90
|
-
:'progress_reports' => :'Array<ProgressReport>',
|
91
|
-
:'created_resources' => :'Array<String>',
|
92
|
-
:'reserved_resources_record' => :'Array<Object>'
|
93
|
-
}
|
94
|
-
end
|
95
|
-
|
96
|
-
# List of attributes with nullable: true
|
97
|
-
def self.openapi_nullable
|
98
|
-
Set.new([
|
99
|
-
])
|
100
|
-
end
|
101
|
-
|
102
|
-
# Initializes the object
|
103
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
104
|
-
def initialize(attributes = {})
|
105
|
-
if (!attributes.is_a?(Hash))
|
106
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpcoreClient::TaskRead` initialize method"
|
107
|
-
end
|
108
|
-
|
109
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
110
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
111
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
112
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpcoreClient::TaskRead`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
113
|
-
end
|
114
|
-
h[k.to_sym] = v
|
115
|
-
}
|
116
|
-
|
117
|
-
if attributes.key?(:'pulp_href')
|
118
|
-
self.pulp_href = attributes[:'pulp_href']
|
119
|
-
end
|
120
|
-
|
121
|
-
if attributes.key?(:'pulp_created')
|
122
|
-
self.pulp_created = attributes[:'pulp_created']
|
123
|
-
end
|
124
|
-
|
125
|
-
if attributes.key?(:'state')
|
126
|
-
self.state = attributes[:'state']
|
127
|
-
end
|
128
|
-
|
129
|
-
if attributes.key?(:'name')
|
130
|
-
self.name = attributes[:'name']
|
131
|
-
end
|
132
|
-
|
133
|
-
if attributes.key?(:'started_at')
|
134
|
-
self.started_at = attributes[:'started_at']
|
135
|
-
end
|
136
|
-
|
137
|
-
if attributes.key?(:'finished_at')
|
138
|
-
self.finished_at = attributes[:'finished_at']
|
139
|
-
end
|
140
|
-
|
141
|
-
if attributes.key?(:'error')
|
142
|
-
if (value = attributes[:'error']).is_a?(Hash)
|
143
|
-
self.error = value
|
144
|
-
end
|
145
|
-
end
|
146
|
-
|
147
|
-
if attributes.key?(:'worker')
|
148
|
-
self.worker = attributes[:'worker']
|
149
|
-
end
|
150
|
-
|
151
|
-
if attributes.key?(:'parent_task')
|
152
|
-
self.parent_task = attributes[:'parent_task']
|
153
|
-
end
|
154
|
-
|
155
|
-
if attributes.key?(:'child_tasks')
|
156
|
-
if (value = attributes[:'child_tasks']).is_a?(Array)
|
157
|
-
self.child_tasks = value
|
158
|
-
end
|
159
|
-
end
|
160
|
-
|
161
|
-
if attributes.key?(:'task_group')
|
162
|
-
self.task_group = attributes[:'task_group']
|
163
|
-
end
|
164
|
-
|
165
|
-
if attributes.key?(:'progress_reports')
|
166
|
-
if (value = attributes[:'progress_reports']).is_a?(Array)
|
167
|
-
self.progress_reports = value
|
168
|
-
end
|
169
|
-
end
|
170
|
-
|
171
|
-
if attributes.key?(:'created_resources')
|
172
|
-
if (value = attributes[:'created_resources']).is_a?(Array)
|
173
|
-
self.created_resources = value
|
174
|
-
end
|
175
|
-
end
|
176
|
-
|
177
|
-
if attributes.key?(:'reserved_resources_record')
|
178
|
-
if (value = attributes[:'reserved_resources_record']).is_a?(Array)
|
179
|
-
self.reserved_resources_record = value
|
180
|
-
end
|
181
|
-
end
|
182
|
-
end
|
183
|
-
|
184
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
185
|
-
# @return Array for valid properties with the reasons
|
186
|
-
def list_invalid_properties
|
187
|
-
invalid_properties = Array.new
|
188
|
-
if !@state.nil? && @state.to_s.length < 1
|
189
|
-
invalid_properties.push('invalid value for "state", the character length must be great than or equal to 1.')
|
190
|
-
end
|
191
|
-
|
192
|
-
if @name.nil?
|
193
|
-
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
194
|
-
end
|
195
|
-
|
196
|
-
if @name.to_s.length < 1
|
197
|
-
invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
|
198
|
-
end
|
199
|
-
|
200
|
-
invalid_properties
|
201
|
-
end
|
202
|
-
|
203
|
-
# Check to see if the all the properties in the model are valid
|
204
|
-
# @return true if the model is valid
|
205
|
-
def valid?
|
206
|
-
return false if !@state.nil? && @state.to_s.length < 1
|
207
|
-
return false if @name.nil?
|
208
|
-
return false if @name.to_s.length < 1
|
209
|
-
true
|
210
|
-
end
|
211
|
-
|
212
|
-
# Custom attribute writer method with validation
|
213
|
-
# @param [Object] state Value to be assigned
|
214
|
-
def state=(state)
|
215
|
-
if !state.nil? && state.to_s.length < 1
|
216
|
-
fail ArgumentError, 'invalid value for "state", the character length must be great than or equal to 1.'
|
217
|
-
end
|
218
|
-
|
219
|
-
@state = state
|
220
|
-
end
|
221
|
-
|
222
|
-
# Custom attribute writer method with validation
|
223
|
-
# @param [Object] name Value to be assigned
|
224
|
-
def name=(name)
|
225
|
-
if name.nil?
|
226
|
-
fail ArgumentError, 'name cannot be nil'
|
227
|
-
end
|
228
|
-
|
229
|
-
if name.to_s.length < 1
|
230
|
-
fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
|
231
|
-
end
|
232
|
-
|
233
|
-
@name = name
|
234
|
-
end
|
235
|
-
|
236
|
-
# Checks equality by comparing each attribute.
|
237
|
-
# @param [Object] Object to be compared
|
238
|
-
def ==(o)
|
239
|
-
return true if self.equal?(o)
|
240
|
-
self.class == o.class &&
|
241
|
-
pulp_href == o.pulp_href &&
|
242
|
-
pulp_created == o.pulp_created &&
|
243
|
-
state == o.state &&
|
244
|
-
name == o.name &&
|
245
|
-
started_at == o.started_at &&
|
246
|
-
finished_at == o.finished_at &&
|
247
|
-
error == o.error &&
|
248
|
-
worker == o.worker &&
|
249
|
-
parent_task == o.parent_task &&
|
250
|
-
child_tasks == o.child_tasks &&
|
251
|
-
task_group == o.task_group &&
|
252
|
-
progress_reports == o.progress_reports &&
|
253
|
-
created_resources == o.created_resources &&
|
254
|
-
reserved_resources_record == o.reserved_resources_record
|
255
|
-
end
|
256
|
-
|
257
|
-
# @see the `==` method
|
258
|
-
# @param [Object] Object to be compared
|
259
|
-
def eql?(o)
|
260
|
-
self == o
|
261
|
-
end
|
262
|
-
|
263
|
-
# Calculates hash code according to all attributes.
|
264
|
-
# @return [Integer] Hash code
|
265
|
-
def hash
|
266
|
-
[pulp_href, pulp_created, state, name, started_at, finished_at, error, worker, parent_task, child_tasks, task_group, progress_reports, created_resources, reserved_resources_record].hash
|
267
|
-
end
|
268
|
-
|
269
|
-
# Builds the object from hash
|
270
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
271
|
-
# @return [Object] Returns the model itself
|
272
|
-
def self.build_from_hash(attributes)
|
273
|
-
new.build_from_hash(attributes)
|
274
|
-
end
|
275
|
-
|
276
|
-
# Builds the object from hash
|
277
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
278
|
-
# @return [Object] Returns the model itself
|
279
|
-
def build_from_hash(attributes)
|
280
|
-
return nil unless attributes.is_a?(Hash)
|
281
|
-
self.class.openapi_types.each_pair do |key, type|
|
282
|
-
if type =~ /\AArray<(.*)>/i
|
283
|
-
# check to ensure the input is an array given that the attribute
|
284
|
-
# is documented as an array but the input is not
|
285
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
286
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
287
|
-
end
|
288
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
289
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
290
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
291
|
-
end
|
292
|
-
|
293
|
-
self
|
294
|
-
end
|
295
|
-
|
296
|
-
# Deserializes the data based on type
|
297
|
-
# @param string type Data type
|
298
|
-
# @param string value Value to be deserialized
|
299
|
-
# @return [Object] Deserialized data
|
300
|
-
def _deserialize(type, value)
|
301
|
-
case type.to_sym
|
302
|
-
when :DateTime
|
303
|
-
DateTime.parse(value)
|
304
|
-
when :Date
|
305
|
-
Date.parse(value)
|
306
|
-
when :String
|
307
|
-
value.to_s
|
308
|
-
when :Integer
|
309
|
-
value.to_i
|
310
|
-
when :Float
|
311
|
-
value.to_f
|
312
|
-
when :Boolean
|
313
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
314
|
-
true
|
315
|
-
else
|
316
|
-
false
|
317
|
-
end
|
318
|
-
when :Object
|
319
|
-
# generic object (usually a Hash), return directly
|
320
|
-
value
|
321
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
322
|
-
inner_type = Regexp.last_match[:inner_type]
|
323
|
-
value.map { |v| _deserialize(inner_type, v) }
|
324
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
325
|
-
k_type = Regexp.last_match[:k_type]
|
326
|
-
v_type = Regexp.last_match[:v_type]
|
327
|
-
{}.tap do |hash|
|
328
|
-
value.each do |k, v|
|
329
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
330
|
-
end
|
331
|
-
end
|
332
|
-
else # model
|
333
|
-
PulpcoreClient.const_get(type).build_from_hash(value)
|
334
|
-
end
|
335
|
-
end
|
336
|
-
|
337
|
-
# Returns the string representation of the object
|
338
|
-
# @return [String] String presentation of the object
|
339
|
-
def to_s
|
340
|
-
to_hash.to_s
|
341
|
-
end
|
342
|
-
|
343
|
-
# to_body is an alias to to_hash (backward compatibility)
|
344
|
-
# @return [Hash] Returns the object in the form of hash
|
345
|
-
def to_body
|
346
|
-
to_hash
|
347
|
-
end
|
348
|
-
|
349
|
-
# Returns the object in the form of hash
|
350
|
-
# @return [Hash] Returns the object in the form of hash
|
351
|
-
def to_hash
|
352
|
-
hash = {}
|
353
|
-
self.class.attribute_map.each_pair do |attr, param|
|
354
|
-
value = self.send(attr)
|
355
|
-
if value.nil?
|
356
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
357
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
358
|
-
end
|
359
|
-
|
360
|
-
hash[param] = _to_hash(value)
|
361
|
-
end
|
362
|
-
hash
|
363
|
-
end
|
364
|
-
|
365
|
-
# Outputs non-array value in the form of hash
|
366
|
-
# For object, use to_hash. Otherwise, just return the value
|
367
|
-
# @param [Object] value Any valid value
|
368
|
-
# @return [Hash] Returns the value in the form of hash
|
369
|
-
def _to_hash(value)
|
370
|
-
if value.is_a?(Array)
|
371
|
-
value.compact.map { |v| _to_hash(v) }
|
372
|
-
elsif value.is_a?(Hash)
|
373
|
-
{}.tap do |hash|
|
374
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
375
|
-
end
|
376
|
-
elsif value.respond_to? :to_hash
|
377
|
-
value.to_hash
|
378
|
-
else
|
379
|
-
value
|
380
|
-
end
|
381
|
-
end
|
382
|
-
end
|
383
|
-
end
|