pulp_container_client 2.16.4 → 2.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +40 -6
  3. data/docs/ContainerContainerDistribution.md +7 -7
  4. data/docs/ContainerContainerDistributionResponse.md +10 -8
  5. data/docs/ContainerContainerPullThroughDistribution.md +35 -0
  6. data/docs/ContainerContainerPullThroughDistributionResponse.md +41 -0
  7. data/docs/ContainerContainerPullThroughRemote.md +57 -0
  8. data/docs/ContainerContainerPullThroughRemoteResponse.md +55 -0
  9. data/docs/{ContainerContainerRemoteResponseHiddenFields.md → ContainerContainerPullThroughRemoteResponseHiddenFields.md} +2 -2
  10. data/docs/ContainerContainerPushRepository.md +5 -5
  11. data/docs/ContainerContainerPushRepositoryResponse.md +13 -13
  12. data/docs/ContainerContainerRemote.md +1 -1
  13. data/docs/ContainerContainerRemoteResponse.md +2 -2
  14. data/docs/ContentBlobsApi.md +2 -0
  15. data/docs/ContentManifestsApi.md +2 -0
  16. data/docs/ContentSignaturesApi.md +2 -0
  17. data/docs/ContentTagsApi.md +2 -0
  18. data/docs/DistributionsPullThroughApi.md +736 -0
  19. data/docs/PaginatedcontainerContainerPullThroughDistributionResponseList.md +23 -0
  20. data/docs/PaginatedcontainerContainerPullThroughRemoteResponseList.md +23 -0
  21. data/docs/PatchedcontainerContainerDistribution.md +7 -7
  22. data/docs/PatchedcontainerContainerPullThroughDistribution.md +35 -0
  23. data/docs/PatchedcontainerContainerPullThroughRemote.md +57 -0
  24. data/docs/PatchedcontainerContainerPushRepository.md +5 -5
  25. data/docs/PatchedcontainerContainerRemote.md +1 -1
  26. data/docs/{PolicyEnum.md → Policy762Enum.md} +2 -2
  27. data/docs/Policy8e2Enum.md +16 -0
  28. data/docs/RemotesPullThroughApi.md +734 -0
  29. data/lib/pulp_container_client/api/content_blobs_api.rb +3 -0
  30. data/lib/pulp_container_client/api/content_manifests_api.rb +3 -0
  31. data/lib/pulp_container_client/api/content_signatures_api.rb +3 -0
  32. data/lib/pulp_container_client/api/content_tags_api.rb +3 -0
  33. data/lib/pulp_container_client/api/distributions_pull_through_api.rb +907 -0
  34. data/lib/pulp_container_client/api/remotes_pull_through_api.rb +904 -0
  35. data/lib/pulp_container_client/models/container_container_distribution.rb +26 -26
  36. data/lib/pulp_container_client/models/container_container_distribution_response.rb +43 -33
  37. data/lib/pulp_container_client/models/container_container_pull_through_distribution.rb +373 -0
  38. data/lib/pulp_container_client/models/container_container_pull_through_distribution_response.rb +349 -0
  39. data/lib/pulp_container_client/models/container_container_pull_through_remote.rb +668 -0
  40. data/lib/pulp_container_client/models/container_container_pull_through_remote_response.rb +496 -0
  41. data/lib/pulp_container_client/models/{container_container_remote_response_hidden_fields.rb → container_container_pull_through_remote_response_hidden_fields.rb} +3 -3
  42. data/lib/pulp_container_client/models/container_container_push_repository.rb +47 -47
  43. data/lib/pulp_container_client/models/container_container_push_repository_response.rb +56 -56
  44. data/lib/pulp_container_client/models/container_container_remote.rb +1 -1
  45. data/lib/pulp_container_client/models/container_container_remote_response.rb +2 -2
  46. data/lib/pulp_container_client/models/paginatedcontainer_container_pull_through_distribution_response_list.rb +237 -0
  47. data/lib/pulp_container_client/models/paginatedcontainer_container_pull_through_remote_response_list.rb +237 -0
  48. data/lib/pulp_container_client/models/patchedcontainer_container_distribution.rb +26 -26
  49. data/lib/pulp_container_client/models/patchedcontainer_container_pull_through_distribution.rb +350 -0
  50. data/lib/pulp_container_client/models/patchedcontainer_container_pull_through_remote.rb +650 -0
  51. data/lib/pulp_container_client/models/patchedcontainer_container_push_repository.rb +39 -39
  52. data/lib/pulp_container_client/models/patchedcontainer_container_remote.rb +1 -1
  53. data/lib/pulp_container_client/models/{policy_enum.rb → policy762_enum.rb} +3 -3
  54. data/lib/pulp_container_client/models/policy8e2_enum.rb +35 -0
  55. data/lib/pulp_container_client/version.rb +1 -1
  56. data/lib/pulp_container_client.rb +13 -2
  57. data/spec/api/content_blobs_api_spec.rb +1 -0
  58. data/spec/api/content_manifests_api_spec.rb +1 -0
  59. data/spec/api/content_signatures_api_spec.rb +1 -0
  60. data/spec/api/content_tags_api_spec.rb +1 -0
  61. data/spec/api/distributions_pull_through_api_spec.rb +215 -0
  62. data/spec/api/remotes_pull_through_api_spec.rb +214 -0
  63. data/spec/models/container_container_distribution_response_spec.rb +12 -6
  64. data/spec/models/container_container_distribution_spec.rb +4 -4
  65. data/spec/models/container_container_pull_through_distribution_response_spec.rb +113 -0
  66. data/spec/models/container_container_pull_through_distribution_spec.rb +95 -0
  67. data/spec/models/{container_container_remote_response_hidden_fields_spec.rb → container_container_pull_through_remote_response_hidden_fields_spec.rb} +6 -6
  68. data/spec/models/container_container_pull_through_remote_response_spec.rb +155 -0
  69. data/spec/models/container_container_pull_through_remote_spec.rb +161 -0
  70. data/spec/models/container_container_push_repository_response_spec.rb +7 -7
  71. data/spec/models/container_container_push_repository_spec.rb +4 -4
  72. data/spec/models/paginatedcontainer_container_pull_through_distribution_response_list_spec.rb +59 -0
  73. data/spec/models/paginatedcontainer_container_pull_through_remote_response_list_spec.rb +59 -0
  74. data/spec/models/patchedcontainer_container_distribution_spec.rb +4 -4
  75. data/spec/models/patchedcontainer_container_pull_through_distribution_spec.rb +95 -0
  76. data/spec/models/patchedcontainer_container_pull_through_remote_spec.rb +161 -0
  77. data/spec/models/patchedcontainer_container_push_repository_spec.rb +4 -4
  78. data/spec/models/{policy_enum_spec.rb → policy762_enum_spec.rb} +6 -6
  79. data/spec/models/policy8e2_enum_spec.rb +35 -0
  80. metadata +103 -59
@@ -0,0 +1,668 @@
1
+ =begin
2
+ #Pulp 3 API
3
+
4
+ #Fetch, Upload, Organize, and Distribute Software Packages
5
+
6
+ The version of the OpenAPI document: v3
7
+ Contact: pulp-list@redhat.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpContainerClient
16
+ # A serializer for a remote used in the pull-through distribution.
17
+ class ContainerContainerPullThroughRemote
18
+ # A unique name for this remote.
19
+ attr_accessor :name
20
+
21
+ # The URL of an external content source.
22
+ attr_accessor :url
23
+
24
+ # A PEM encoded CA certificate used to validate the server certificate presented by the remote server.
25
+ attr_accessor :ca_cert
26
+
27
+ # A PEM encoded client certificate used for authentication.
28
+ attr_accessor :client_cert
29
+
30
+ # A PEM encoded private key used for authentication.
31
+ attr_accessor :client_key
32
+
33
+ # If True, TLS peer validation must be performed.
34
+ attr_accessor :tls_validation
35
+
36
+ # The proxy URL. Format: scheme://host:port
37
+ attr_accessor :proxy_url
38
+
39
+ # The username to authenticte to the proxy.
40
+ attr_accessor :proxy_username
41
+
42
+ # The password to authenticate to the proxy. Extra leading and trailing whitespace characters are not trimmed.
43
+ attr_accessor :proxy_password
44
+
45
+ # The username to be used for authentication when syncing.
46
+ attr_accessor :username
47
+
48
+ # The password to be used for authentication when syncing. Extra leading and trailing whitespace characters are not trimmed.
49
+ attr_accessor :password
50
+
51
+ attr_accessor :pulp_labels
52
+
53
+ # Total number of simultaneous connections. If not set then the default value will be used.
54
+ attr_accessor :download_concurrency
55
+
56
+ # Maximum number of retry attempts after a download failure. If not set then the default value (3) will be used.
57
+ attr_accessor :max_retries
58
+
59
+ attr_accessor :policy
60
+
61
+ # aiohttp.ClientTimeout.total (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
62
+ attr_accessor :total_timeout
63
+
64
+ # aiohttp.ClientTimeout.connect (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
65
+ attr_accessor :connect_timeout
66
+
67
+ # aiohttp.ClientTimeout.sock_connect (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
68
+ attr_accessor :sock_connect_timeout
69
+
70
+ # aiohttp.ClientTimeout.sock_read (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
71
+ attr_accessor :sock_read_timeout
72
+
73
+ # Headers for aiohttp.Clientsession
74
+ attr_accessor :headers
75
+
76
+ # Limits requests per second for each concurrent downloader
77
+ attr_accessor :rate_limit
78
+
79
+ # Attribute mapping from ruby-style variable name to JSON key.
80
+ def self.attribute_map
81
+ {
82
+ :'name' => :'name',
83
+ :'url' => :'url',
84
+ :'ca_cert' => :'ca_cert',
85
+ :'client_cert' => :'client_cert',
86
+ :'client_key' => :'client_key',
87
+ :'tls_validation' => :'tls_validation',
88
+ :'proxy_url' => :'proxy_url',
89
+ :'proxy_username' => :'proxy_username',
90
+ :'proxy_password' => :'proxy_password',
91
+ :'username' => :'username',
92
+ :'password' => :'password',
93
+ :'pulp_labels' => :'pulp_labels',
94
+ :'download_concurrency' => :'download_concurrency',
95
+ :'max_retries' => :'max_retries',
96
+ :'policy' => :'policy',
97
+ :'total_timeout' => :'total_timeout',
98
+ :'connect_timeout' => :'connect_timeout',
99
+ :'sock_connect_timeout' => :'sock_connect_timeout',
100
+ :'sock_read_timeout' => :'sock_read_timeout',
101
+ :'headers' => :'headers',
102
+ :'rate_limit' => :'rate_limit'
103
+ }
104
+ end
105
+
106
+ # Attribute type mapping.
107
+ def self.openapi_types
108
+ {
109
+ :'name' => :'String',
110
+ :'url' => :'String',
111
+ :'ca_cert' => :'String',
112
+ :'client_cert' => :'String',
113
+ :'client_key' => :'String',
114
+ :'tls_validation' => :'Boolean',
115
+ :'proxy_url' => :'String',
116
+ :'proxy_username' => :'String',
117
+ :'proxy_password' => :'String',
118
+ :'username' => :'String',
119
+ :'password' => :'String',
120
+ :'pulp_labels' => :'Hash<String, String>',
121
+ :'download_concurrency' => :'Integer',
122
+ :'max_retries' => :'Integer',
123
+ :'policy' => :'Policy8e2Enum',
124
+ :'total_timeout' => :'Float',
125
+ :'connect_timeout' => :'Float',
126
+ :'sock_connect_timeout' => :'Float',
127
+ :'sock_read_timeout' => :'Float',
128
+ :'headers' => :'Array<Object>',
129
+ :'rate_limit' => :'Integer'
130
+ }
131
+ end
132
+
133
+ # List of attributes with nullable: true
134
+ def self.openapi_nullable
135
+ Set.new([
136
+ :'ca_cert',
137
+ :'client_cert',
138
+ :'client_key',
139
+ :'proxy_url',
140
+ :'proxy_username',
141
+ :'proxy_password',
142
+ :'username',
143
+ :'password',
144
+ :'download_concurrency',
145
+ :'max_retries',
146
+ :'total_timeout',
147
+ :'connect_timeout',
148
+ :'sock_connect_timeout',
149
+ :'sock_read_timeout',
150
+ :'rate_limit'
151
+ ])
152
+ end
153
+
154
+ # Initializes the object
155
+ # @param [Hash] attributes Model attributes in the form of hash
156
+ def initialize(attributes = {})
157
+ if (!attributes.is_a?(Hash))
158
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpContainerClient::ContainerContainerPullThroughRemote` initialize method"
159
+ end
160
+
161
+ # check to see if the attribute exists and convert string to symbol for hash key
162
+ attributes = attributes.each_with_object({}) { |(k, v), h|
163
+ if (!self.class.attribute_map.key?(k.to_sym))
164
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpContainerClient::ContainerContainerPullThroughRemote`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
165
+ end
166
+ h[k.to_sym] = v
167
+ }
168
+
169
+ if attributes.key?(:'name')
170
+ self.name = attributes[:'name']
171
+ end
172
+
173
+ if attributes.key?(:'url')
174
+ self.url = attributes[:'url']
175
+ end
176
+
177
+ if attributes.key?(:'ca_cert')
178
+ self.ca_cert = attributes[:'ca_cert']
179
+ end
180
+
181
+ if attributes.key?(:'client_cert')
182
+ self.client_cert = attributes[:'client_cert']
183
+ end
184
+
185
+ if attributes.key?(:'client_key')
186
+ self.client_key = attributes[:'client_key']
187
+ end
188
+
189
+ if attributes.key?(:'tls_validation')
190
+ self.tls_validation = attributes[:'tls_validation']
191
+ end
192
+
193
+ if attributes.key?(:'proxy_url')
194
+ self.proxy_url = attributes[:'proxy_url']
195
+ end
196
+
197
+ if attributes.key?(:'proxy_username')
198
+ self.proxy_username = attributes[:'proxy_username']
199
+ end
200
+
201
+ if attributes.key?(:'proxy_password')
202
+ self.proxy_password = attributes[:'proxy_password']
203
+ end
204
+
205
+ if attributes.key?(:'username')
206
+ self.username = attributes[:'username']
207
+ end
208
+
209
+ if attributes.key?(:'password')
210
+ self.password = attributes[:'password']
211
+ end
212
+
213
+ if attributes.key?(:'pulp_labels')
214
+ if (value = attributes[:'pulp_labels']).is_a?(Hash)
215
+ self.pulp_labels = value
216
+ end
217
+ end
218
+
219
+ if attributes.key?(:'download_concurrency')
220
+ self.download_concurrency = attributes[:'download_concurrency']
221
+ end
222
+
223
+ if attributes.key?(:'max_retries')
224
+ self.max_retries = attributes[:'max_retries']
225
+ end
226
+
227
+ if attributes.key?(:'policy')
228
+ self.policy = attributes[:'policy']
229
+ end
230
+
231
+ if attributes.key?(:'total_timeout')
232
+ self.total_timeout = attributes[:'total_timeout']
233
+ end
234
+
235
+ if attributes.key?(:'connect_timeout')
236
+ self.connect_timeout = attributes[:'connect_timeout']
237
+ end
238
+
239
+ if attributes.key?(:'sock_connect_timeout')
240
+ self.sock_connect_timeout = attributes[:'sock_connect_timeout']
241
+ end
242
+
243
+ if attributes.key?(:'sock_read_timeout')
244
+ self.sock_read_timeout = attributes[:'sock_read_timeout']
245
+ end
246
+
247
+ if attributes.key?(:'headers')
248
+ if (value = attributes[:'headers']).is_a?(Array)
249
+ self.headers = value
250
+ end
251
+ end
252
+
253
+ if attributes.key?(:'rate_limit')
254
+ self.rate_limit = attributes[:'rate_limit']
255
+ end
256
+ end
257
+
258
+ # Show invalid properties with the reasons. Usually used together with valid?
259
+ # @return Array for valid properties with the reasons
260
+ def list_invalid_properties
261
+ invalid_properties = Array.new
262
+ if @name.nil?
263
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
264
+ end
265
+
266
+ if @name.to_s.length < 1
267
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
268
+ end
269
+
270
+ if @url.nil?
271
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
272
+ end
273
+
274
+ if @url.to_s.length < 1
275
+ invalid_properties.push('invalid value for "url", the character length must be great than or equal to 1.')
276
+ end
277
+
278
+ if !@ca_cert.nil? && @ca_cert.to_s.length < 1
279
+ invalid_properties.push('invalid value for "ca_cert", the character length must be great than or equal to 1.')
280
+ end
281
+
282
+ if !@client_cert.nil? && @client_cert.to_s.length < 1
283
+ invalid_properties.push('invalid value for "client_cert", the character length must be great than or equal to 1.')
284
+ end
285
+
286
+ if !@client_key.nil? && @client_key.to_s.length < 1
287
+ invalid_properties.push('invalid value for "client_key", the character length must be great than or equal to 1.')
288
+ end
289
+
290
+ if !@proxy_url.nil? && @proxy_url.to_s.length < 1
291
+ invalid_properties.push('invalid value for "proxy_url", the character length must be great than or equal to 1.')
292
+ end
293
+
294
+ if !@proxy_username.nil? && @proxy_username.to_s.length < 1
295
+ invalid_properties.push('invalid value for "proxy_username", the character length must be great than or equal to 1.')
296
+ end
297
+
298
+ if !@proxy_password.nil? && @proxy_password.to_s.length < 1
299
+ invalid_properties.push('invalid value for "proxy_password", the character length must be great than or equal to 1.')
300
+ end
301
+
302
+ if !@username.nil? && @username.to_s.length < 1
303
+ invalid_properties.push('invalid value for "username", the character length must be great than or equal to 1.')
304
+ end
305
+
306
+ if !@password.nil? && @password.to_s.length < 1
307
+ invalid_properties.push('invalid value for "password", the character length must be great than or equal to 1.')
308
+ end
309
+
310
+ if !@download_concurrency.nil? && @download_concurrency < 1
311
+ invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
312
+ end
313
+
314
+ if !@total_timeout.nil? && @total_timeout < 0.0
315
+ invalid_properties.push('invalid value for "total_timeout", must be greater than or equal to 0.0.')
316
+ end
317
+
318
+ if !@connect_timeout.nil? && @connect_timeout < 0.0
319
+ invalid_properties.push('invalid value for "connect_timeout", must be greater than or equal to 0.0.')
320
+ end
321
+
322
+ if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
323
+ invalid_properties.push('invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.')
324
+ end
325
+
326
+ if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
327
+ invalid_properties.push('invalid value for "sock_read_timeout", must be greater than or equal to 0.0.')
328
+ end
329
+
330
+ invalid_properties
331
+ end
332
+
333
+ # Check to see if the all the properties in the model are valid
334
+ # @return true if the model is valid
335
+ def valid?
336
+ return false if @name.nil?
337
+ return false if @name.to_s.length < 1
338
+ return false if @url.nil?
339
+ return false if @url.to_s.length < 1
340
+ return false if !@ca_cert.nil? && @ca_cert.to_s.length < 1
341
+ return false if !@client_cert.nil? && @client_cert.to_s.length < 1
342
+ return false if !@client_key.nil? && @client_key.to_s.length < 1
343
+ return false if !@proxy_url.nil? && @proxy_url.to_s.length < 1
344
+ return false if !@proxy_username.nil? && @proxy_username.to_s.length < 1
345
+ return false if !@proxy_password.nil? && @proxy_password.to_s.length < 1
346
+ return false if !@username.nil? && @username.to_s.length < 1
347
+ return false if !@password.nil? && @password.to_s.length < 1
348
+ return false if !@download_concurrency.nil? && @download_concurrency < 1
349
+ return false if !@total_timeout.nil? && @total_timeout < 0.0
350
+ return false if !@connect_timeout.nil? && @connect_timeout < 0.0
351
+ return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
352
+ return false if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
353
+ true
354
+ end
355
+
356
+ # Custom attribute writer method with validation
357
+ # @param [Object] name Value to be assigned
358
+ def name=(name)
359
+ if name.nil?
360
+ fail ArgumentError, 'name cannot be nil'
361
+ end
362
+
363
+ if name.to_s.length < 1
364
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
365
+ end
366
+
367
+ @name = name
368
+ end
369
+
370
+ # Custom attribute writer method with validation
371
+ # @param [Object] url Value to be assigned
372
+ def url=(url)
373
+ if url.nil?
374
+ fail ArgumentError, 'url cannot be nil'
375
+ end
376
+
377
+ if url.to_s.length < 1
378
+ fail ArgumentError, 'invalid value for "url", the character length must be great than or equal to 1.'
379
+ end
380
+
381
+ @url = url
382
+ end
383
+
384
+ # Custom attribute writer method with validation
385
+ # @param [Object] ca_cert Value to be assigned
386
+ def ca_cert=(ca_cert)
387
+ if !ca_cert.nil? && ca_cert.to_s.length < 1
388
+ fail ArgumentError, 'invalid value for "ca_cert", the character length must be great than or equal to 1.'
389
+ end
390
+
391
+ @ca_cert = ca_cert
392
+ end
393
+
394
+ # Custom attribute writer method with validation
395
+ # @param [Object] client_cert Value to be assigned
396
+ def client_cert=(client_cert)
397
+ if !client_cert.nil? && client_cert.to_s.length < 1
398
+ fail ArgumentError, 'invalid value for "client_cert", the character length must be great than or equal to 1.'
399
+ end
400
+
401
+ @client_cert = client_cert
402
+ end
403
+
404
+ # Custom attribute writer method with validation
405
+ # @param [Object] client_key Value to be assigned
406
+ def client_key=(client_key)
407
+ if !client_key.nil? && client_key.to_s.length < 1
408
+ fail ArgumentError, 'invalid value for "client_key", the character length must be great than or equal to 1.'
409
+ end
410
+
411
+ @client_key = client_key
412
+ end
413
+
414
+ # Custom attribute writer method with validation
415
+ # @param [Object] proxy_url Value to be assigned
416
+ def proxy_url=(proxy_url)
417
+ if !proxy_url.nil? && proxy_url.to_s.length < 1
418
+ fail ArgumentError, 'invalid value for "proxy_url", the character length must be great than or equal to 1.'
419
+ end
420
+
421
+ @proxy_url = proxy_url
422
+ end
423
+
424
+ # Custom attribute writer method with validation
425
+ # @param [Object] proxy_username Value to be assigned
426
+ def proxy_username=(proxy_username)
427
+ if !proxy_username.nil? && proxy_username.to_s.length < 1
428
+ fail ArgumentError, 'invalid value for "proxy_username", the character length must be great than or equal to 1.'
429
+ end
430
+
431
+ @proxy_username = proxy_username
432
+ end
433
+
434
+ # Custom attribute writer method with validation
435
+ # @param [Object] proxy_password Value to be assigned
436
+ def proxy_password=(proxy_password)
437
+ if !proxy_password.nil? && proxy_password.to_s.length < 1
438
+ fail ArgumentError, 'invalid value for "proxy_password", the character length must be great than or equal to 1.'
439
+ end
440
+
441
+ @proxy_password = proxy_password
442
+ end
443
+
444
+ # Custom attribute writer method with validation
445
+ # @param [Object] username Value to be assigned
446
+ def username=(username)
447
+ if !username.nil? && username.to_s.length < 1
448
+ fail ArgumentError, 'invalid value for "username", the character length must be great than or equal to 1.'
449
+ end
450
+
451
+ @username = username
452
+ end
453
+
454
+ # Custom attribute writer method with validation
455
+ # @param [Object] password Value to be assigned
456
+ def password=(password)
457
+ if !password.nil? && password.to_s.length < 1
458
+ fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 1.'
459
+ end
460
+
461
+ @password = password
462
+ end
463
+
464
+ # Custom attribute writer method with validation
465
+ # @param [Object] download_concurrency Value to be assigned
466
+ def download_concurrency=(download_concurrency)
467
+ if !download_concurrency.nil? && download_concurrency < 1
468
+ fail ArgumentError, 'invalid value for "download_concurrency", must be greater than or equal to 1.'
469
+ end
470
+
471
+ @download_concurrency = download_concurrency
472
+ end
473
+
474
+ # Custom attribute writer method with validation
475
+ # @param [Object] total_timeout Value to be assigned
476
+ def total_timeout=(total_timeout)
477
+ if !total_timeout.nil? && total_timeout < 0.0
478
+ fail ArgumentError, 'invalid value for "total_timeout", must be greater than or equal to 0.0.'
479
+ end
480
+
481
+ @total_timeout = total_timeout
482
+ end
483
+
484
+ # Custom attribute writer method with validation
485
+ # @param [Object] connect_timeout Value to be assigned
486
+ def connect_timeout=(connect_timeout)
487
+ if !connect_timeout.nil? && connect_timeout < 0.0
488
+ fail ArgumentError, 'invalid value for "connect_timeout", must be greater than or equal to 0.0.'
489
+ end
490
+
491
+ @connect_timeout = connect_timeout
492
+ end
493
+
494
+ # Custom attribute writer method with validation
495
+ # @param [Object] sock_connect_timeout Value to be assigned
496
+ def sock_connect_timeout=(sock_connect_timeout)
497
+ if !sock_connect_timeout.nil? && sock_connect_timeout < 0.0
498
+ fail ArgumentError, 'invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.'
499
+ end
500
+
501
+ @sock_connect_timeout = sock_connect_timeout
502
+ end
503
+
504
+ # Custom attribute writer method with validation
505
+ # @param [Object] sock_read_timeout Value to be assigned
506
+ def sock_read_timeout=(sock_read_timeout)
507
+ if !sock_read_timeout.nil? && sock_read_timeout < 0.0
508
+ fail ArgumentError, 'invalid value for "sock_read_timeout", must be greater than or equal to 0.0.'
509
+ end
510
+
511
+ @sock_read_timeout = sock_read_timeout
512
+ end
513
+
514
+ # Checks equality by comparing each attribute.
515
+ # @param [Object] Object to be compared
516
+ def ==(o)
517
+ return true if self.equal?(o)
518
+ self.class == o.class &&
519
+ name == o.name &&
520
+ url == o.url &&
521
+ ca_cert == o.ca_cert &&
522
+ client_cert == o.client_cert &&
523
+ client_key == o.client_key &&
524
+ tls_validation == o.tls_validation &&
525
+ proxy_url == o.proxy_url &&
526
+ proxy_username == o.proxy_username &&
527
+ proxy_password == o.proxy_password &&
528
+ username == o.username &&
529
+ password == o.password &&
530
+ pulp_labels == o.pulp_labels &&
531
+ download_concurrency == o.download_concurrency &&
532
+ max_retries == o.max_retries &&
533
+ policy == o.policy &&
534
+ total_timeout == o.total_timeout &&
535
+ connect_timeout == o.connect_timeout &&
536
+ sock_connect_timeout == o.sock_connect_timeout &&
537
+ sock_read_timeout == o.sock_read_timeout &&
538
+ headers == o.headers &&
539
+ rate_limit == o.rate_limit
540
+ end
541
+
542
+ # @see the `==` method
543
+ # @param [Object] Object to be compared
544
+ def eql?(o)
545
+ self == o
546
+ end
547
+
548
+ # Calculates hash code according to all attributes.
549
+ # @return [Integer] Hash code
550
+ def hash
551
+ [name, url, ca_cert, client_cert, client_key, tls_validation, proxy_url, proxy_username, proxy_password, username, password, pulp_labels, download_concurrency, max_retries, policy, total_timeout, connect_timeout, sock_connect_timeout, sock_read_timeout, headers, rate_limit].hash
552
+ end
553
+
554
+ # Builds the object from hash
555
+ # @param [Hash] attributes Model attributes in the form of hash
556
+ # @return [Object] Returns the model itself
557
+ def self.build_from_hash(attributes)
558
+ new.build_from_hash(attributes)
559
+ end
560
+
561
+ # Builds the object from hash
562
+ # @param [Hash] attributes Model attributes in the form of hash
563
+ # @return [Object] Returns the model itself
564
+ def build_from_hash(attributes)
565
+ return nil unless attributes.is_a?(Hash)
566
+ self.class.openapi_types.each_pair do |key, type|
567
+ if type =~ /\AArray<(.*)>/i
568
+ # check to ensure the input is an array given that the attribute
569
+ # is documented as an array but the input is not
570
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
571
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
572
+ end
573
+ elsif !attributes[self.class.attribute_map[key]].nil?
574
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
575
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
576
+ end
577
+
578
+ self
579
+ end
580
+
581
+ # Deserializes the data based on type
582
+ # @param string type Data type
583
+ # @param string value Value to be deserialized
584
+ # @return [Object] Deserialized data
585
+ def _deserialize(type, value)
586
+ case type.to_sym
587
+ when :DateTime
588
+ DateTime.parse(value)
589
+ when :Date
590
+ Date.parse(value)
591
+ when :String
592
+ value.to_s
593
+ when :Integer
594
+ value.to_i
595
+ when :Float
596
+ value.to_f
597
+ when :Boolean
598
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
599
+ true
600
+ else
601
+ false
602
+ end
603
+ when :Object
604
+ # generic object (usually a Hash), return directly
605
+ value
606
+ when /\AArray<(?<inner_type>.+)>\z/
607
+ inner_type = Regexp.last_match[:inner_type]
608
+ value.map { |v| _deserialize(inner_type, v) }
609
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
610
+ k_type = Regexp.last_match[:k_type]
611
+ v_type = Regexp.last_match[:v_type]
612
+ {}.tap do |hash|
613
+ value.each do |k, v|
614
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
615
+ end
616
+ end
617
+ else # model
618
+ PulpContainerClient.const_get(type).build_from_hash(value)
619
+ end
620
+ end
621
+
622
+ # Returns the string representation of the object
623
+ # @return [String] String presentation of the object
624
+ def to_s
625
+ to_hash.to_s
626
+ end
627
+
628
+ # to_body is an alias to to_hash (backward compatibility)
629
+ # @return [Hash] Returns the object in the form of hash
630
+ def to_body
631
+ to_hash
632
+ end
633
+
634
+ # Returns the object in the form of hash
635
+ # @return [Hash] Returns the object in the form of hash
636
+ def to_hash
637
+ hash = {}
638
+ self.class.attribute_map.each_pair do |attr, param|
639
+ value = self.send(attr)
640
+ if value.nil?
641
+ is_nullable = self.class.openapi_nullable.include?(attr)
642
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
643
+ end
644
+
645
+ hash[param] = _to_hash(value)
646
+ end
647
+ hash
648
+ end
649
+
650
+ # Outputs non-array value in the form of hash
651
+ # For object, use to_hash. Otherwise, just return the value
652
+ # @param [Object] value Any valid value
653
+ # @return [Hash] Returns the value in the form of hash
654
+ def _to_hash(value)
655
+ if value.is_a?(Array)
656
+ value.compact.map { |v| _to_hash(v) }
657
+ elsif value.is_a?(Hash)
658
+ {}.tap do |hash|
659
+ value.each { |k, v| hash[k] = _to_hash(v) }
660
+ end
661
+ elsif value.respond_to? :to_hash
662
+ value.to_hash
663
+ else
664
+ value
665
+ end
666
+ end
667
+ end
668
+ end