pulp_docker_client 4.0.0b5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +79 -0
- data/README.md +131 -0
- data/Rakefile +10 -0
- data/docs/AsyncOperationResponse.md +17 -0
- data/docs/Blob.md +29 -0
- data/docs/ContentBlobsApi.md +182 -0
- data/docs/ContentManifestTagsApi.md +182 -0
- data/docs/ContentManifestsApi.md +180 -0
- data/docs/DistributionsDockerApi.md +352 -0
- data/docs/DockerDistribution.md +31 -0
- data/docs/DockerRemote.md +49 -0
- data/docs/InlineResponse200.md +23 -0
- data/docs/InlineResponse2001.md +23 -0
- data/docs/InlineResponse2002.md +23 -0
- data/docs/InlineResponse2003.md +23 -0
- data/docs/InlineResponse2004.md +23 -0
- data/docs/Manifest.md +37 -0
- data/docs/ManifestTag.md +29 -0
- data/docs/RemotesDockerApi.md +411 -0
- data/docs/RepositorySyncURL.md +19 -0
- data/git_push.sh +55 -0
- data/lib/pulp_docker_client/api/content_blobs_api.rb +222 -0
- data/lib/pulp_docker_client/api/content_manifest_tags_api.rb +222 -0
- data/lib/pulp_docker_client/api/content_manifests_api.rb +219 -0
- data/lib/pulp_docker_client/api/distributions_docker_api.rb +430 -0
- data/lib/pulp_docker_client/api/remotes_docker_api.rb +504 -0
- data/lib/pulp_docker_client/api_client.rb +387 -0
- data/lib/pulp_docker_client/api_error.rb +57 -0
- data/lib/pulp_docker_client/configuration.rb +251 -0
- data/lib/pulp_docker_client/models/async_operation_response.rb +202 -0
- data/lib/pulp_docker_client/models/blob.rb +347 -0
- data/lib/pulp_docker_client/models/docker_distribution.rb +347 -0
- data/lib/pulp_docker_client/models/docker_remote.rb +598 -0
- data/lib/pulp_docker_client/models/inline_response200.rb +235 -0
- data/lib/pulp_docker_client/models/inline_response2001.rb +235 -0
- data/lib/pulp_docker_client/models/inline_response2002.rb +235 -0
- data/lib/pulp_docker_client/models/inline_response2003.rb +235 -0
- data/lib/pulp_docker_client/models/inline_response2004.rb +235 -0
- data/lib/pulp_docker_client/models/manifest.rb +411 -0
- data/lib/pulp_docker_client/models/manifest_tag.rb +328 -0
- data/lib/pulp_docker_client/models/repository_sync_url.rb +214 -0
- data/lib/pulp_docker_client/version.rb +15 -0
- data/lib/pulp_docker_client.rb +56 -0
- data/pulp_docker_client.gemspec +45 -0
- data/spec/api/content_blobs_api_spec.rb +76 -0
- data/spec/api/content_manifest_tags_api_spec.rb +76 -0
- data/spec/api/content_manifests_api_spec.rb +75 -0
- data/spec/api/distributions_docker_api_spec.rb +116 -0
- data/spec/api/remotes_docker_api_spec.rb +130 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/async_operation_response_spec.rb +41 -0
- data/spec/models/blob_spec.rb +77 -0
- data/spec/models/docker_distribution_spec.rb +83 -0
- data/spec/models/docker_remote_spec.rb +141 -0
- data/spec/models/inline_response2001_spec.rb +59 -0
- data/spec/models/inline_response2002_spec.rb +59 -0
- data/spec/models/inline_response2003_spec.rb +59 -0
- data/spec/models/inline_response2004_spec.rb +59 -0
- data/spec/models/inline_response200_spec.rb +59 -0
- data/spec/models/manifest_spec.rb +101 -0
- data/spec/models/manifest_tag_spec.rb +77 -0
- data/spec/models/repository_sync_url_spec.rb +47 -0
- data/spec/spec_helper.rb +111 -0
- metadata +309 -0
@@ -0,0 +1,411 @@
|
|
1
|
+
=begin
|
2
|
+
#Pulp 3 API
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v3
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.0.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module PulpDockerClient
|
16
|
+
class Manifest
|
17
|
+
attr_accessor :_href
|
18
|
+
|
19
|
+
# Timestamp of creation.
|
20
|
+
attr_accessor :_created
|
21
|
+
|
22
|
+
attr_accessor :_type
|
23
|
+
|
24
|
+
# Artifact file representing the physical content
|
25
|
+
attr_accessor :_artifact
|
26
|
+
|
27
|
+
# Path where the artifact is located relative to distributions base_path
|
28
|
+
attr_accessor :_relative_path
|
29
|
+
|
30
|
+
# sha256 of the Manifest file
|
31
|
+
attr_accessor :digest
|
32
|
+
|
33
|
+
# Docker schema version
|
34
|
+
attr_accessor :schema_version
|
35
|
+
|
36
|
+
# Docker media type of the file
|
37
|
+
attr_accessor :media_type
|
38
|
+
|
39
|
+
# Manifests that are referenced by this Manifest List
|
40
|
+
attr_accessor :listed_manifests
|
41
|
+
|
42
|
+
# Blob that contains configuration for this Manifest
|
43
|
+
attr_accessor :config_blob
|
44
|
+
|
45
|
+
# Blobs that are referenced by this Manifest
|
46
|
+
attr_accessor :blobs
|
47
|
+
|
48
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
49
|
+
def self.attribute_map
|
50
|
+
{
|
51
|
+
:'_href' => :'_href',
|
52
|
+
:'_created' => :'_created',
|
53
|
+
:'_type' => :'_type',
|
54
|
+
:'_artifact' => :'_artifact',
|
55
|
+
:'_relative_path' => :'_relative_path',
|
56
|
+
:'digest' => :'digest',
|
57
|
+
:'schema_version' => :'schema_version',
|
58
|
+
:'media_type' => :'media_type',
|
59
|
+
:'listed_manifests' => :'listed_manifests',
|
60
|
+
:'config_blob' => :'config_blob',
|
61
|
+
:'blobs' => :'blobs'
|
62
|
+
}
|
63
|
+
end
|
64
|
+
|
65
|
+
# Attribute type mapping.
|
66
|
+
def self.openapi_types
|
67
|
+
{
|
68
|
+
:'_href' => :'String',
|
69
|
+
:'_created' => :'DateTime',
|
70
|
+
:'_type' => :'String',
|
71
|
+
:'_artifact' => :'String',
|
72
|
+
:'_relative_path' => :'String',
|
73
|
+
:'digest' => :'String',
|
74
|
+
:'schema_version' => :'Integer',
|
75
|
+
:'media_type' => :'String',
|
76
|
+
:'listed_manifests' => :'Array<String>',
|
77
|
+
:'config_blob' => :'String',
|
78
|
+
:'blobs' => :'Array<String>'
|
79
|
+
}
|
80
|
+
end
|
81
|
+
|
82
|
+
# Initializes the object
|
83
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
84
|
+
def initialize(attributes = {})
|
85
|
+
if (!attributes.is_a?(Hash))
|
86
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpDockerClient::Manifest` initialize method"
|
87
|
+
end
|
88
|
+
|
89
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
90
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
91
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
92
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpDockerClient::Manifest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
93
|
+
end
|
94
|
+
h[k.to_sym] = v
|
95
|
+
}
|
96
|
+
|
97
|
+
if attributes.key?(:'_href')
|
98
|
+
self._href = attributes[:'_href']
|
99
|
+
end
|
100
|
+
|
101
|
+
if attributes.key?(:'_created')
|
102
|
+
self._created = attributes[:'_created']
|
103
|
+
end
|
104
|
+
|
105
|
+
if attributes.key?(:'_type')
|
106
|
+
self._type = attributes[:'_type']
|
107
|
+
end
|
108
|
+
|
109
|
+
if attributes.key?(:'_artifact')
|
110
|
+
self._artifact = attributes[:'_artifact']
|
111
|
+
end
|
112
|
+
|
113
|
+
if attributes.key?(:'_relative_path')
|
114
|
+
self._relative_path = attributes[:'_relative_path']
|
115
|
+
end
|
116
|
+
|
117
|
+
if attributes.key?(:'digest')
|
118
|
+
self.digest = attributes[:'digest']
|
119
|
+
end
|
120
|
+
|
121
|
+
if attributes.key?(:'schema_version')
|
122
|
+
self.schema_version = attributes[:'schema_version']
|
123
|
+
end
|
124
|
+
|
125
|
+
if attributes.key?(:'media_type')
|
126
|
+
self.media_type = attributes[:'media_type']
|
127
|
+
end
|
128
|
+
|
129
|
+
if attributes.key?(:'listed_manifests')
|
130
|
+
if (value = attributes[:'listed_manifests']).is_a?(Array)
|
131
|
+
self.listed_manifests = value
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
if attributes.key?(:'config_blob')
|
136
|
+
self.config_blob = attributes[:'config_blob']
|
137
|
+
end
|
138
|
+
|
139
|
+
if attributes.key?(:'blobs')
|
140
|
+
if (value = attributes[:'blobs']).is_a?(Array)
|
141
|
+
self.blobs = value
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
147
|
+
# @return Array for valid properties with the reasons
|
148
|
+
def list_invalid_properties
|
149
|
+
invalid_properties = Array.new
|
150
|
+
if !@_type.nil? && @_type.to_s.length < 1
|
151
|
+
invalid_properties.push('invalid value for "_type", the character length must be great than or equal to 1.')
|
152
|
+
end
|
153
|
+
|
154
|
+
if @_artifact.nil?
|
155
|
+
invalid_properties.push('invalid value for "_artifact", _artifact cannot be nil.')
|
156
|
+
end
|
157
|
+
|
158
|
+
if @_relative_path.nil?
|
159
|
+
invalid_properties.push('invalid value for "_relative_path", _relative_path cannot be nil.')
|
160
|
+
end
|
161
|
+
|
162
|
+
if @_relative_path.to_s.length < 1
|
163
|
+
invalid_properties.push('invalid value for "_relative_path", the character length must be great than or equal to 1.')
|
164
|
+
end
|
165
|
+
|
166
|
+
if @digest.nil?
|
167
|
+
invalid_properties.push('invalid value for "digest", digest cannot be nil.')
|
168
|
+
end
|
169
|
+
|
170
|
+
if @digest.to_s.length < 1
|
171
|
+
invalid_properties.push('invalid value for "digest", the character length must be great than or equal to 1.')
|
172
|
+
end
|
173
|
+
|
174
|
+
if @schema_version.nil?
|
175
|
+
invalid_properties.push('invalid value for "schema_version", schema_version cannot be nil.')
|
176
|
+
end
|
177
|
+
|
178
|
+
if @media_type.nil?
|
179
|
+
invalid_properties.push('invalid value for "media_type", media_type cannot be nil.')
|
180
|
+
end
|
181
|
+
|
182
|
+
if @media_type.to_s.length < 1
|
183
|
+
invalid_properties.push('invalid value for "media_type", the character length must be great than or equal to 1.')
|
184
|
+
end
|
185
|
+
|
186
|
+
if @listed_manifests.nil?
|
187
|
+
invalid_properties.push('invalid value for "listed_manifests", listed_manifests cannot be nil.')
|
188
|
+
end
|
189
|
+
|
190
|
+
if @config_blob.nil?
|
191
|
+
invalid_properties.push('invalid value for "config_blob", config_blob cannot be nil.')
|
192
|
+
end
|
193
|
+
|
194
|
+
if @blobs.nil?
|
195
|
+
invalid_properties.push('invalid value for "blobs", blobs cannot be nil.')
|
196
|
+
end
|
197
|
+
|
198
|
+
invalid_properties
|
199
|
+
end
|
200
|
+
|
201
|
+
# Check to see if the all the properties in the model are valid
|
202
|
+
# @return true if the model is valid
|
203
|
+
def valid?
|
204
|
+
return false if !@_type.nil? && @_type.to_s.length < 1
|
205
|
+
return false if @_artifact.nil?
|
206
|
+
return false if @_relative_path.nil?
|
207
|
+
return false if @_relative_path.to_s.length < 1
|
208
|
+
return false if @digest.nil?
|
209
|
+
return false if @digest.to_s.length < 1
|
210
|
+
return false if @schema_version.nil?
|
211
|
+
return false if @media_type.nil?
|
212
|
+
return false if @media_type.to_s.length < 1
|
213
|
+
return false if @listed_manifests.nil?
|
214
|
+
return false if @config_blob.nil?
|
215
|
+
return false if @blobs.nil?
|
216
|
+
true
|
217
|
+
end
|
218
|
+
|
219
|
+
# Custom attribute writer method with validation
|
220
|
+
# @param [Object] _type Value to be assigned
|
221
|
+
def _type=(_type)
|
222
|
+
if !_type.nil? && _type.to_s.length < 1
|
223
|
+
fail ArgumentError, 'invalid value for "_type", the character length must be great than or equal to 1.'
|
224
|
+
end
|
225
|
+
|
226
|
+
@_type = _type
|
227
|
+
end
|
228
|
+
|
229
|
+
# Custom attribute writer method with validation
|
230
|
+
# @param [Object] _relative_path Value to be assigned
|
231
|
+
def _relative_path=(_relative_path)
|
232
|
+
if _relative_path.nil?
|
233
|
+
fail ArgumentError, '_relative_path cannot be nil'
|
234
|
+
end
|
235
|
+
|
236
|
+
if _relative_path.to_s.length < 1
|
237
|
+
fail ArgumentError, 'invalid value for "_relative_path", the character length must be great than or equal to 1.'
|
238
|
+
end
|
239
|
+
|
240
|
+
@_relative_path = _relative_path
|
241
|
+
end
|
242
|
+
|
243
|
+
# Custom attribute writer method with validation
|
244
|
+
# @param [Object] digest Value to be assigned
|
245
|
+
def digest=(digest)
|
246
|
+
if digest.nil?
|
247
|
+
fail ArgumentError, 'digest cannot be nil'
|
248
|
+
end
|
249
|
+
|
250
|
+
if digest.to_s.length < 1
|
251
|
+
fail ArgumentError, 'invalid value for "digest", the character length must be great than or equal to 1.'
|
252
|
+
end
|
253
|
+
|
254
|
+
@digest = digest
|
255
|
+
end
|
256
|
+
|
257
|
+
# Custom attribute writer method with validation
|
258
|
+
# @param [Object] media_type Value to be assigned
|
259
|
+
def media_type=(media_type)
|
260
|
+
if media_type.nil?
|
261
|
+
fail ArgumentError, 'media_type cannot be nil'
|
262
|
+
end
|
263
|
+
|
264
|
+
if media_type.to_s.length < 1
|
265
|
+
fail ArgumentError, 'invalid value for "media_type", the character length must be great than or equal to 1.'
|
266
|
+
end
|
267
|
+
|
268
|
+
@media_type = media_type
|
269
|
+
end
|
270
|
+
|
271
|
+
# Checks equality by comparing each attribute.
|
272
|
+
# @param [Object] Object to be compared
|
273
|
+
def ==(o)
|
274
|
+
return true if self.equal?(o)
|
275
|
+
self.class == o.class &&
|
276
|
+
_href == o._href &&
|
277
|
+
_created == o._created &&
|
278
|
+
_type == o._type &&
|
279
|
+
_artifact == o._artifact &&
|
280
|
+
_relative_path == o._relative_path &&
|
281
|
+
digest == o.digest &&
|
282
|
+
schema_version == o.schema_version &&
|
283
|
+
media_type == o.media_type &&
|
284
|
+
listed_manifests == o.listed_manifests &&
|
285
|
+
config_blob == o.config_blob &&
|
286
|
+
blobs == o.blobs
|
287
|
+
end
|
288
|
+
|
289
|
+
# @see the `==` method
|
290
|
+
# @param [Object] Object to be compared
|
291
|
+
def eql?(o)
|
292
|
+
self == o
|
293
|
+
end
|
294
|
+
|
295
|
+
# Calculates hash code according to all attributes.
|
296
|
+
# @return [Integer] Hash code
|
297
|
+
def hash
|
298
|
+
[_href, _created, _type, _artifact, _relative_path, digest, schema_version, media_type, listed_manifests, config_blob, blobs].hash
|
299
|
+
end
|
300
|
+
|
301
|
+
# Builds the object from hash
|
302
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
303
|
+
# @return [Object] Returns the model itself
|
304
|
+
def self.build_from_hash(attributes)
|
305
|
+
new.build_from_hash(attributes)
|
306
|
+
end
|
307
|
+
|
308
|
+
# Builds the object from hash
|
309
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
310
|
+
# @return [Object] Returns the model itself
|
311
|
+
def build_from_hash(attributes)
|
312
|
+
return nil unless attributes.is_a?(Hash)
|
313
|
+
self.class.openapi_types.each_pair do |key, type|
|
314
|
+
if type =~ /\AArray<(.*)>/i
|
315
|
+
# check to ensure the input is an array given that the attribute
|
316
|
+
# is documented as an array but the input is not
|
317
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
318
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
319
|
+
end
|
320
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
321
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
322
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
323
|
+
end
|
324
|
+
|
325
|
+
self
|
326
|
+
end
|
327
|
+
|
328
|
+
# Deserializes the data based on type
|
329
|
+
# @param string type Data type
|
330
|
+
# @param string value Value to be deserialized
|
331
|
+
# @return [Object] Deserialized data
|
332
|
+
def _deserialize(type, value)
|
333
|
+
case type.to_sym
|
334
|
+
when :DateTime
|
335
|
+
DateTime.parse(value)
|
336
|
+
when :Date
|
337
|
+
Date.parse(value)
|
338
|
+
when :String
|
339
|
+
value.to_s
|
340
|
+
when :Integer
|
341
|
+
value.to_i
|
342
|
+
when :Float
|
343
|
+
value.to_f
|
344
|
+
when :Boolean
|
345
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
346
|
+
true
|
347
|
+
else
|
348
|
+
false
|
349
|
+
end
|
350
|
+
when :Object
|
351
|
+
# generic object (usually a Hash), return directly
|
352
|
+
value
|
353
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
354
|
+
inner_type = Regexp.last_match[:inner_type]
|
355
|
+
value.map { |v| _deserialize(inner_type, v) }
|
356
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
357
|
+
k_type = Regexp.last_match[:k_type]
|
358
|
+
v_type = Regexp.last_match[:v_type]
|
359
|
+
{}.tap do |hash|
|
360
|
+
value.each do |k, v|
|
361
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
362
|
+
end
|
363
|
+
end
|
364
|
+
else # model
|
365
|
+
PulpDockerClient.const_get(type).build_from_hash(value)
|
366
|
+
end
|
367
|
+
end
|
368
|
+
|
369
|
+
# Returns the string representation of the object
|
370
|
+
# @return [String] String presentation of the object
|
371
|
+
def to_s
|
372
|
+
to_hash.to_s
|
373
|
+
end
|
374
|
+
|
375
|
+
# to_body is an alias to to_hash (backward compatibility)
|
376
|
+
# @return [Hash] Returns the object in the form of hash
|
377
|
+
def to_body
|
378
|
+
to_hash
|
379
|
+
end
|
380
|
+
|
381
|
+
# Returns the object in the form of hash
|
382
|
+
# @return [Hash] Returns the object in the form of hash
|
383
|
+
def to_hash
|
384
|
+
hash = {}
|
385
|
+
self.class.attribute_map.each_pair do |attr, param|
|
386
|
+
value = self.send(attr)
|
387
|
+
next if value.nil?
|
388
|
+
hash[param] = _to_hash(value)
|
389
|
+
end
|
390
|
+
hash
|
391
|
+
end
|
392
|
+
|
393
|
+
# Outputs non-array value in the form of hash
|
394
|
+
# For object, use to_hash. Otherwise, just return the value
|
395
|
+
# @param [Object] value Any valid value
|
396
|
+
# @return [Hash] Returns the value in the form of hash
|
397
|
+
def _to_hash(value)
|
398
|
+
if value.is_a?(Array)
|
399
|
+
value.compact.map { |v| _to_hash(v) }
|
400
|
+
elsif value.is_a?(Hash)
|
401
|
+
{}.tap do |hash|
|
402
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
403
|
+
end
|
404
|
+
elsif value.respond_to? :to_hash
|
405
|
+
value.to_hash
|
406
|
+
else
|
407
|
+
value
|
408
|
+
end
|
409
|
+
end
|
410
|
+
end
|
411
|
+
end
|