pulp_container_client 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -8
  3. data/docs/{ContainerBlob.md → ContainerBlobRead.md} +2 -2
  4. data/docs/ContainerContainerDistribution.md +9 -9
  5. data/docs/ContainerContainerDistributionRead.md +31 -0
  6. data/docs/ContainerContainerRemote.md +7 -3
  7. data/docs/ContainerContainerRemoteRead.md +47 -0
  8. data/docs/ContainerContainerRepositoryRead.md +27 -0
  9. data/docs/{ContainerManifest.md → ContainerManifestRead.md} +2 -2
  10. data/docs/{ContainerTag.md → ContainerTagRead.md} +2 -2
  11. data/docs/ContentBlobsApi.md +3 -3
  12. data/docs/ContentManifestsApi.md +3 -3
  13. data/docs/ContentTagsApi.md +3 -3
  14. data/docs/DistributionsContainerApi.md +3 -3
  15. data/docs/InlineResponse200.md +1 -1
  16. data/docs/InlineResponse2001.md +1 -1
  17. data/docs/InlineResponse2002.md +1 -1
  18. data/docs/InlineResponse2003.md +1 -1
  19. data/docs/InlineResponse2004.md +1 -1
  20. data/docs/InlineResponse2005.md +1 -1
  21. data/docs/InlineResponse2006.md +1 -1
  22. data/docs/RemotesContainerApi.md +5 -5
  23. data/docs/RepositoriesContainerApi.md +10 -10
  24. data/docs/RepositoriesContainerVersionsApi.md +3 -3
  25. data/docs/RepositoryVersionRead.md +25 -0
  26. data/lib/pulp_container_client/api/content_blobs_api.rb +3 -3
  27. data/lib/pulp_container_client/api/content_manifests_api.rb +3 -3
  28. data/lib/pulp_container_client/api/content_tags_api.rb +3 -3
  29. data/lib/pulp_container_client/api/distributions_container_api.rb +3 -3
  30. data/lib/pulp_container_client/api/remotes_container_api.rb +6 -6
  31. data/lib/pulp_container_client/api/repositories_container_api.rb +15 -15
  32. data/lib/pulp_container_client/api/repositories_container_versions_api.rb +3 -3
  33. data/lib/pulp_container_client/configuration.rb +2 -2
  34. data/lib/pulp_container_client/models/{container_blob.rb → container_blob_read.rb} +3 -3
  35. data/lib/pulp_container_client/models/container_container_distribution.rb +60 -60
  36. data/lib/pulp_container_client/models/container_container_distribution_read.rb +342 -0
  37. data/lib/pulp_container_client/models/container_container_remote.rb +56 -4
  38. data/lib/pulp_container_client/models/container_container_remote_read.rb +578 -0
  39. data/lib/pulp_container_client/models/container_container_repository_read.rb +294 -0
  40. data/lib/pulp_container_client/models/{container_manifest.rb → container_manifest_read.rb} +3 -3
  41. data/lib/pulp_container_client/models/{container_tag.rb → container_tag_read.rb} +3 -3
  42. data/lib/pulp_container_client/models/inline_response200.rb +1 -1
  43. data/lib/pulp_container_client/models/inline_response2001.rb +1 -1
  44. data/lib/pulp_container_client/models/inline_response2002.rb +1 -1
  45. data/lib/pulp_container_client/models/inline_response2003.rb +1 -1
  46. data/lib/pulp_container_client/models/inline_response2004.rb +1 -1
  47. data/lib/pulp_container_client/models/inline_response2005.rb +1 -1
  48. data/lib/pulp_container_client/models/inline_response2006.rb +1 -1
  49. data/lib/pulp_container_client/models/repository_version_read.rb +244 -0
  50. data/lib/pulp_container_client/version.rb +1 -1
  51. data/lib/pulp_container_client.rb +7 -3
  52. data/spec/api/content_blobs_api_spec.rb +1 -1
  53. data/spec/api/content_manifests_api_spec.rb +1 -1
  54. data/spec/api/content_tags_api_spec.rb +1 -1
  55. data/spec/api/distributions_container_api_spec.rb +1 -1
  56. data/spec/api/remotes_container_api_spec.rb +2 -2
  57. data/spec/api/repositories_container_api_spec.rb +6 -6
  58. data/spec/api/repositories_container_versions_api_spec.rb +1 -1
  59. data/spec/configuration_spec.rb +3 -3
  60. data/spec/models/{container_blob_spec.rb → container_blob_read_spec.rb} +6 -6
  61. data/spec/models/container_container_distribution_read_spec.rb +83 -0
  62. data/spec/models/container_container_distribution_spec.rb +7 -7
  63. data/spec/models/container_container_remote_read_spec.rb +135 -0
  64. data/spec/models/container_container_remote_spec.rb +12 -0
  65. data/spec/models/container_container_repository_read_spec.rb +71 -0
  66. data/spec/models/{container_manifest_spec.rb → container_manifest_read_spec.rb} +6 -6
  67. data/spec/models/{container_tag_spec.rb → container_tag_read_spec.rb} +6 -6
  68. data/spec/models/repository_version_read_spec.rb +65 -0
  69. metadata +30 -14
@@ -0,0 +1,342 @@
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 PulpContainerClient
16
+ class ContainerContainerDistributionRead
17
+ # The latest RepositoryVersion for this Repository will be served.
18
+ attr_accessor :repository
19
+
20
+ # Timestamp of creation.
21
+ attr_accessor :pulp_created
22
+
23
+ attr_accessor :pulp_href
24
+
25
+ # A unique name. Ex, `rawhide` and `stable`.
26
+ attr_accessor :name
27
+
28
+ # An optional content-guard.
29
+ attr_accessor :content_guard
30
+
31
+ # The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")
32
+ attr_accessor :base_path
33
+
34
+ # RepositoryVersion to be served
35
+ attr_accessor :repository_version
36
+
37
+ # The Registry hostame/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' => :'repository',
44
+ :'pulp_created' => :'pulp_created',
45
+ :'pulp_href' => :'pulp_href',
46
+ :'name' => :'name',
47
+ :'content_guard' => :'content_guard',
48
+ :'base_path' => :'base_path',
49
+ :'repository_version' => :'repository_version',
50
+ :'registry_path' => :'registry_path'
51
+ }
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.openapi_types
56
+ {
57
+ :'repository' => :'String',
58
+ :'pulp_created' => :'DateTime',
59
+ :'pulp_href' => :'String',
60
+ :'name' => :'String',
61
+ :'content_guard' => :'String',
62
+ :'base_path' => :'String',
63
+ :'repository_version' => :'String',
64
+ :'registry_path' => :'String'
65
+ }
66
+ end
67
+
68
+ # List of attributes with nullable: true
69
+ def self.openapi_nullable
70
+ Set.new([
71
+ :'repository',
72
+ :'content_guard',
73
+ :'repository_version',
74
+ ])
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpContainerClient::ContainerContainerDistributionRead` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!self.class.attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpContainerClient::ContainerContainerDistributionRead`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
91
+
92
+ if attributes.key?(:'repository')
93
+ self.repository = attributes[:'repository']
94
+ end
95
+
96
+ if attributes.key?(:'pulp_created')
97
+ self.pulp_created = attributes[:'pulp_created']
98
+ end
99
+
100
+ if attributes.key?(:'pulp_href')
101
+ self.pulp_href = attributes[:'pulp_href']
102
+ end
103
+
104
+ if attributes.key?(:'name')
105
+ self.name = attributes[:'name']
106
+ end
107
+
108
+ if attributes.key?(:'content_guard')
109
+ self.content_guard = attributes[:'content_guard']
110
+ end
111
+
112
+ if attributes.key?(:'base_path')
113
+ self.base_path = attributes[:'base_path']
114
+ end
115
+
116
+ if attributes.key?(:'repository_version')
117
+ self.repository_version = attributes[:'repository_version']
118
+ end
119
+
120
+ if attributes.key?(:'registry_path')
121
+ self.registry_path = attributes[:'registry_path']
122
+ end
123
+ end
124
+
125
+ # Show invalid properties with the reasons. Usually used together with valid?
126
+ # @return Array for valid properties with the reasons
127
+ def list_invalid_properties
128
+ invalid_properties = Array.new
129
+ if @name.nil?
130
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
131
+ end
132
+
133
+ if @name.to_s.length < 1
134
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
135
+ end
136
+
137
+ if @base_path.nil?
138
+ invalid_properties.push('invalid value for "base_path", base_path cannot be nil.')
139
+ end
140
+
141
+ if @base_path.to_s.length < 1
142
+ invalid_properties.push('invalid value for "base_path", the character length must be great than or equal to 1.')
143
+ end
144
+
145
+ if !@registry_path.nil? && @registry_path.to_s.length < 1
146
+ invalid_properties.push('invalid value for "registry_path", the character length must be great than or equal to 1.')
147
+ end
148
+
149
+ invalid_properties
150
+ end
151
+
152
+ # Check to see if the all the properties in the model are valid
153
+ # @return true if the model is valid
154
+ def valid?
155
+ return false if @name.nil?
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 < 1
159
+ return false if !@registry_path.nil? && @registry_path.to_s.length < 1
160
+ true
161
+ end
162
+
163
+ # Custom attribute writer method with validation
164
+ # @param [Object] name Value to be assigned
165
+ def name=(name)
166
+ if name.nil?
167
+ fail ArgumentError, 'name cannot be nil'
168
+ end
169
+
170
+ if name.to_s.length < 1
171
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
172
+ end
173
+
174
+ @name = name
175
+ end
176
+
177
+ # Custom attribute writer method with validation
178
+ # @param [Object] base_path Value to be assigned
179
+ def base_path=(base_path)
180
+ if base_path.nil?
181
+ fail ArgumentError, 'base_path cannot be nil'
182
+ end
183
+
184
+ if base_path.to_s.length < 1
185
+ fail ArgumentError, 'invalid value for "base_path", the character length must be great than or equal to 1.'
186
+ end
187
+
188
+ @base_path = base_path
189
+ end
190
+
191
+ # Custom attribute writer method with validation
192
+ # @param [Object] registry_path Value to be assigned
193
+ def registry_path=(registry_path)
194
+ if !registry_path.nil? && registry_path.to_s.length < 1
195
+ fail ArgumentError, 'invalid value for "registry_path", the character length must be great than or equal to 1.'
196
+ end
197
+
198
+ @registry_path = registry_path
199
+ end
200
+
201
+ # Checks equality by comparing each attribute.
202
+ # @param [Object] Object to be compared
203
+ def ==(o)
204
+ return true if self.equal?(o)
205
+ self.class == o.class &&
206
+ repository == o.repository &&
207
+ pulp_created == o.pulp_created &&
208
+ pulp_href == o.pulp_href &&
209
+ name == o.name &&
210
+ content_guard == o.content_guard &&
211
+ base_path == o.base_path &&
212
+ repository_version == o.repository_version &&
213
+ registry_path == o.registry_path
214
+ end
215
+
216
+ # @see the `==` method
217
+ # @param [Object] Object to be compared
218
+ def eql?(o)
219
+ self == o
220
+ end
221
+
222
+ # Calculates hash code according to all attributes.
223
+ # @return [Integer] Hash code
224
+ def hash
225
+ [repository, pulp_created, pulp_href, name, content_guard, base_path, repository_version, registry_path].hash
226
+ end
227
+
228
+ # Builds the object from hash
229
+ # @param [Hash] attributes Model attributes in the form of hash
230
+ # @return [Object] Returns the model itself
231
+ def self.build_from_hash(attributes)
232
+ new.build_from_hash(attributes)
233
+ end
234
+
235
+ # Builds the object from hash
236
+ # @param [Hash] attributes Model attributes in the form of hash
237
+ # @return [Object] Returns the model itself
238
+ def build_from_hash(attributes)
239
+ return nil unless attributes.is_a?(Hash)
240
+ self.class.openapi_types.each_pair do |key, type|
241
+ if type =~ /\AArray<(.*)>/i
242
+ # check to ensure the input is an array given that the attribute
243
+ # is documented as an array but the input is not
244
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
245
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
246
+ end
247
+ elsif !attributes[self.class.attribute_map[key]].nil?
248
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
249
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
250
+ end
251
+
252
+ self
253
+ end
254
+
255
+ # Deserializes the data based on type
256
+ # @param string type Data type
257
+ # @param string value Value to be deserialized
258
+ # @return [Object] Deserialized data
259
+ def _deserialize(type, value)
260
+ case type.to_sym
261
+ when :DateTime
262
+ DateTime.parse(value)
263
+ when :Date
264
+ Date.parse(value)
265
+ when :String
266
+ value.to_s
267
+ when :Integer
268
+ value.to_i
269
+ when :Float
270
+ value.to_f
271
+ when :Boolean
272
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
273
+ true
274
+ else
275
+ false
276
+ end
277
+ when :Object
278
+ # generic object (usually a Hash), return directly
279
+ value
280
+ when /\AArray<(?<inner_type>.+)>\z/
281
+ inner_type = Regexp.last_match[:inner_type]
282
+ value.map { |v| _deserialize(inner_type, v) }
283
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
284
+ k_type = Regexp.last_match[:k_type]
285
+ v_type = Regexp.last_match[:v_type]
286
+ {}.tap do |hash|
287
+ value.each do |k, v|
288
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
289
+ end
290
+ end
291
+ else # model
292
+ PulpContainerClient.const_get(type).build_from_hash(value)
293
+ end
294
+ end
295
+
296
+ # Returns the string representation of the object
297
+ # @return [String] String presentation of the object
298
+ def to_s
299
+ to_hash.to_s
300
+ end
301
+
302
+ # to_body is an alias to to_hash (backward compatibility)
303
+ # @return [Hash] Returns the object in the form of hash
304
+ def to_body
305
+ to_hash
306
+ end
307
+
308
+ # Returns the object in the form of hash
309
+ # @return [Hash] Returns the object in the form of hash
310
+ def to_hash
311
+ hash = {}
312
+ self.class.attribute_map.each_pair do |attr, param|
313
+ value = self.send(attr)
314
+ if value.nil?
315
+ is_nullable = self.class.openapi_nullable.include?(attr)
316
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
317
+ end
318
+
319
+ hash[param] = _to_hash(value)
320
+ end
321
+ hash
322
+ end
323
+
324
+ # Outputs non-array value in the form of hash
325
+ # For object, use to_hash. Otherwise, just return the value
326
+ # @param [Object] value Any valid value
327
+ # @return [Hash] Returns the value in the form of hash
328
+ def _to_hash(value)
329
+ if value.is_a?(Array)
330
+ value.compact.map { |v| _to_hash(v) }
331
+ elsif value.is_a?(Hash)
332
+ {}.tap do |hash|
333
+ value.each { |k, v| hash[k] = _to_hash(v) }
334
+ end
335
+ elsif value.respond_to? :to_hash
336
+ value.to_hash
337
+ else
338
+ value
339
+ end
340
+ end
341
+ end
342
+ end
@@ -25,13 +25,13 @@ module PulpContainerClient
25
25
  # The URL of an external content source.
26
26
  attr_accessor :url
27
27
 
28
- # A string containing the PEM encoded CA certificate used to validate the server certificate presented by the remote server. All new line characters must be escaped. Returns SHA256 checksum of the certificate file on GET.
28
+ # A string containing the PEM encoded CA certificate used to validate the server certificate presented by the remote server. All new line characters must be escaped.
29
29
  attr_accessor :ca_cert
30
30
 
31
- # A string containing the PEM encoded client certificate used for authentication. All new line characters must be escaped. Returns SHA256 checksum of the certificate file on GET.
31
+ # A string containing the PEM encoded client certificate used for authentication. All new line characters must be escaped.
32
32
  attr_accessor :client_cert
33
33
 
34
- # A PEM encoded private key used for authentication. Returns SHA256 checksum of the certificate file on GET.
34
+ # A PEM encoded private key used for authentication.
35
35
  attr_accessor :client_key
36
36
 
37
37
  # If True, TLS peer validation must be performed.
@@ -40,6 +40,12 @@ module PulpContainerClient
40
40
  # The proxy URL. Format: scheme://user:password@host:port
41
41
  attr_accessor :proxy_url
42
42
 
43
+ # The username to be used for authentication when syncing.
44
+ attr_accessor :username
45
+
46
+ # The password to be used for authentication when syncing.
47
+ attr_accessor :password
48
+
43
49
  # Timestamp of the most recent update of the remote.
44
50
  attr_accessor :pulp_last_updated
45
51
 
@@ -89,6 +95,8 @@ module PulpContainerClient
89
95
  :'client_key' => :'client_key',
90
96
  :'tls_validation' => :'tls_validation',
91
97
  :'proxy_url' => :'proxy_url',
98
+ :'username' => :'username',
99
+ :'password' => :'password',
92
100
  :'pulp_last_updated' => :'pulp_last_updated',
93
101
  :'download_concurrency' => :'download_concurrency',
94
102
  :'policy' => :'policy',
@@ -109,6 +117,8 @@ module PulpContainerClient
109
117
  :'client_key' => :'String',
110
118
  :'tls_validation' => :'Boolean',
111
119
  :'proxy_url' => :'String',
120
+ :'username' => :'String',
121
+ :'password' => :'String',
112
122
  :'pulp_last_updated' => :'DateTime',
113
123
  :'download_concurrency' => :'Integer',
114
124
  :'policy' => :'String',
@@ -124,6 +134,8 @@ module PulpContainerClient
124
134
  :'client_cert',
125
135
  :'client_key',
126
136
  :'proxy_url',
137
+ :'username',
138
+ :'password',
127
139
  :'whitelist_tags'
128
140
  ])
129
141
  end
@@ -179,6 +191,14 @@ module PulpContainerClient
179
191
  self.proxy_url = attributes[:'proxy_url']
180
192
  end
181
193
 
194
+ if attributes.key?(:'username')
195
+ self.username = attributes[:'username']
196
+ end
197
+
198
+ if attributes.key?(:'password')
199
+ self.password = attributes[:'password']
200
+ end
201
+
182
202
  if attributes.key?(:'pulp_last_updated')
183
203
  self.pulp_last_updated = attributes[:'pulp_last_updated']
184
204
  end
@@ -240,6 +260,14 @@ module PulpContainerClient
240
260
  invalid_properties.push('invalid value for "proxy_url", the character length must be great than or equal to 1.')
241
261
  end
242
262
 
263
+ if !@username.nil? && @username.to_s.length < 1
264
+ invalid_properties.push('invalid value for "username", the character length must be great than or equal to 1.')
265
+ end
266
+
267
+ if !@password.nil? && @password.to_s.length < 1
268
+ invalid_properties.push('invalid value for "password", the character length must be great than or equal to 1.')
269
+ end
270
+
243
271
  if !@download_concurrency.nil? && @download_concurrency < 1
244
272
  invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
245
273
  end
@@ -266,6 +294,8 @@ module PulpContainerClient
266
294
  return false if !@client_cert.nil? && @client_cert.to_s.length < 1
267
295
  return false if !@client_key.nil? && @client_key.to_s.length < 1
268
296
  return false if !@proxy_url.nil? && @proxy_url.to_s.length < 1
297
+ return false if !@username.nil? && @username.to_s.length < 1
298
+ return false if !@password.nil? && @password.to_s.length < 1
269
299
  return false if !@download_concurrency.nil? && @download_concurrency < 1
270
300
  policy_validator = EnumAttributeValidator.new('String', ["immediate", "on_demand", "streamed"])
271
301
  return false unless policy_validator.valid?(@policy)
@@ -342,6 +372,26 @@ module PulpContainerClient
342
372
  @proxy_url = proxy_url
343
373
  end
344
374
 
375
+ # Custom attribute writer method with validation
376
+ # @param [Object] username Value to be assigned
377
+ def username=(username)
378
+ if !username.nil? && username.to_s.length < 1
379
+ fail ArgumentError, 'invalid value for "username", the character length must be great than or equal to 1.'
380
+ end
381
+
382
+ @username = username
383
+ end
384
+
385
+ # Custom attribute writer method with validation
386
+ # @param [Object] password Value to be assigned
387
+ def password=(password)
388
+ if !password.nil? && password.to_s.length < 1
389
+ fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 1.'
390
+ end
391
+
392
+ @password = password
393
+ end
394
+
345
395
  # Custom attribute writer method with validation
346
396
  # @param [Object] download_concurrency Value to be assigned
347
397
  def download_concurrency=(download_concurrency)
@@ -390,6 +440,8 @@ module PulpContainerClient
390
440
  client_key == o.client_key &&
391
441
  tls_validation == o.tls_validation &&
392
442
  proxy_url == o.proxy_url &&
443
+ username == o.username &&
444
+ password == o.password &&
393
445
  pulp_last_updated == o.pulp_last_updated &&
394
446
  download_concurrency == o.download_concurrency &&
395
447
  policy == o.policy &&
@@ -406,7 +458,7 @@ module PulpContainerClient
406
458
  # Calculates hash code according to all attributes.
407
459
  # @return [Integer] Hash code
408
460
  def hash
409
- [pulp_href, pulp_created, name, url, ca_cert, client_cert, client_key, tls_validation, proxy_url, pulp_last_updated, download_concurrency, policy, upstream_name, whitelist_tags].hash
461
+ [pulp_href, pulp_created, name, url, ca_cert, client_cert, client_key, tls_validation, proxy_url, username, password, pulp_last_updated, download_concurrency, policy, upstream_name, whitelist_tags].hash
410
462
  end
411
463
 
412
464
  # Builds the object from hash