pulp_docker_client 4.0.0b5

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