pulp_container_client 2.16.4 → 2.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,650 @@
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 PatchedcontainerContainerPullThroughRemote
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::PatchedcontainerContainerPullThroughRemote` 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::PatchedcontainerContainerPullThroughRemote`. 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? && @name.to_s.length < 1
263
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
264
+ end
265
+
266
+ if !@url.nil? && @url.to_s.length < 1
267
+ invalid_properties.push('invalid value for "url", the character length must be great than or equal to 1.')
268
+ end
269
+
270
+ if !@ca_cert.nil? && @ca_cert.to_s.length < 1
271
+ invalid_properties.push('invalid value for "ca_cert", the character length must be great than or equal to 1.')
272
+ end
273
+
274
+ if !@client_cert.nil? && @client_cert.to_s.length < 1
275
+ invalid_properties.push('invalid value for "client_cert", the character length must be great than or equal to 1.')
276
+ end
277
+
278
+ if !@client_key.nil? && @client_key.to_s.length < 1
279
+ invalid_properties.push('invalid value for "client_key", the character length must be great than or equal to 1.')
280
+ end
281
+
282
+ if !@proxy_url.nil? && @proxy_url.to_s.length < 1
283
+ invalid_properties.push('invalid value for "proxy_url", the character length must be great than or equal to 1.')
284
+ end
285
+
286
+ if !@proxy_username.nil? && @proxy_username.to_s.length < 1
287
+ invalid_properties.push('invalid value for "proxy_username", the character length must be great than or equal to 1.')
288
+ end
289
+
290
+ if !@proxy_password.nil? && @proxy_password.to_s.length < 1
291
+ invalid_properties.push('invalid value for "proxy_password", the character length must be great than or equal to 1.')
292
+ end
293
+
294
+ if !@username.nil? && @username.to_s.length < 1
295
+ invalid_properties.push('invalid value for "username", the character length must be great than or equal to 1.')
296
+ end
297
+
298
+ if !@password.nil? && @password.to_s.length < 1
299
+ invalid_properties.push('invalid value for "password", the character length must be great than or equal to 1.')
300
+ end
301
+
302
+ if !@download_concurrency.nil? && @download_concurrency < 1
303
+ invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
304
+ end
305
+
306
+ if !@total_timeout.nil? && @total_timeout < 0.0
307
+ invalid_properties.push('invalid value for "total_timeout", must be greater than or equal to 0.0.')
308
+ end
309
+
310
+ if !@connect_timeout.nil? && @connect_timeout < 0.0
311
+ invalid_properties.push('invalid value for "connect_timeout", must be greater than or equal to 0.0.')
312
+ end
313
+
314
+ if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
315
+ invalid_properties.push('invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.')
316
+ end
317
+
318
+ if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
319
+ invalid_properties.push('invalid value for "sock_read_timeout", must be greater than or equal to 0.0.')
320
+ end
321
+
322
+ invalid_properties
323
+ end
324
+
325
+ # Check to see if the all the properties in the model are valid
326
+ # @return true if the model is valid
327
+ def valid?
328
+ return false if !@name.nil? && @name.to_s.length < 1
329
+ return false if !@url.nil? && @url.to_s.length < 1
330
+ return false if !@ca_cert.nil? && @ca_cert.to_s.length < 1
331
+ return false if !@client_cert.nil? && @client_cert.to_s.length < 1
332
+ return false if !@client_key.nil? && @client_key.to_s.length < 1
333
+ return false if !@proxy_url.nil? && @proxy_url.to_s.length < 1
334
+ return false if !@proxy_username.nil? && @proxy_username.to_s.length < 1
335
+ return false if !@proxy_password.nil? && @proxy_password.to_s.length < 1
336
+ return false if !@username.nil? && @username.to_s.length < 1
337
+ return false if !@password.nil? && @password.to_s.length < 1
338
+ return false if !@download_concurrency.nil? && @download_concurrency < 1
339
+ return false if !@total_timeout.nil? && @total_timeout < 0.0
340
+ return false if !@connect_timeout.nil? && @connect_timeout < 0.0
341
+ return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
342
+ return false if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
343
+ true
344
+ end
345
+
346
+ # Custom attribute writer method with validation
347
+ # @param [Object] name Value to be assigned
348
+ def name=(name)
349
+ if !name.nil? && name.to_s.length < 1
350
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
351
+ end
352
+
353
+ @name = name
354
+ end
355
+
356
+ # Custom attribute writer method with validation
357
+ # @param [Object] url Value to be assigned
358
+ def url=(url)
359
+ if !url.nil? && url.to_s.length < 1
360
+ fail ArgumentError, 'invalid value for "url", the character length must be great than or equal to 1.'
361
+ end
362
+
363
+ @url = url
364
+ end
365
+
366
+ # Custom attribute writer method with validation
367
+ # @param [Object] ca_cert Value to be assigned
368
+ def ca_cert=(ca_cert)
369
+ if !ca_cert.nil? && ca_cert.to_s.length < 1
370
+ fail ArgumentError, 'invalid value for "ca_cert", the character length must be great than or equal to 1.'
371
+ end
372
+
373
+ @ca_cert = ca_cert
374
+ end
375
+
376
+ # Custom attribute writer method with validation
377
+ # @param [Object] client_cert Value to be assigned
378
+ def client_cert=(client_cert)
379
+ if !client_cert.nil? && client_cert.to_s.length < 1
380
+ fail ArgumentError, 'invalid value for "client_cert", the character length must be great than or equal to 1.'
381
+ end
382
+
383
+ @client_cert = client_cert
384
+ end
385
+
386
+ # Custom attribute writer method with validation
387
+ # @param [Object] client_key Value to be assigned
388
+ def client_key=(client_key)
389
+ if !client_key.nil? && client_key.to_s.length < 1
390
+ fail ArgumentError, 'invalid value for "client_key", the character length must be great than or equal to 1.'
391
+ end
392
+
393
+ @client_key = client_key
394
+ end
395
+
396
+ # Custom attribute writer method with validation
397
+ # @param [Object] proxy_url Value to be assigned
398
+ def proxy_url=(proxy_url)
399
+ if !proxy_url.nil? && proxy_url.to_s.length < 1
400
+ fail ArgumentError, 'invalid value for "proxy_url", the character length must be great than or equal to 1.'
401
+ end
402
+
403
+ @proxy_url = proxy_url
404
+ end
405
+
406
+ # Custom attribute writer method with validation
407
+ # @param [Object] proxy_username Value to be assigned
408
+ def proxy_username=(proxy_username)
409
+ if !proxy_username.nil? && proxy_username.to_s.length < 1
410
+ fail ArgumentError, 'invalid value for "proxy_username", the character length must be great than or equal to 1.'
411
+ end
412
+
413
+ @proxy_username = proxy_username
414
+ end
415
+
416
+ # Custom attribute writer method with validation
417
+ # @param [Object] proxy_password Value to be assigned
418
+ def proxy_password=(proxy_password)
419
+ if !proxy_password.nil? && proxy_password.to_s.length < 1
420
+ fail ArgumentError, 'invalid value for "proxy_password", the character length must be great than or equal to 1.'
421
+ end
422
+
423
+ @proxy_password = proxy_password
424
+ end
425
+
426
+ # Custom attribute writer method with validation
427
+ # @param [Object] username Value to be assigned
428
+ def username=(username)
429
+ if !username.nil? && username.to_s.length < 1
430
+ fail ArgumentError, 'invalid value for "username", the character length must be great than or equal to 1.'
431
+ end
432
+
433
+ @username = username
434
+ end
435
+
436
+ # Custom attribute writer method with validation
437
+ # @param [Object] password Value to be assigned
438
+ def password=(password)
439
+ if !password.nil? && password.to_s.length < 1
440
+ fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 1.'
441
+ end
442
+
443
+ @password = password
444
+ end
445
+
446
+ # Custom attribute writer method with validation
447
+ # @param [Object] download_concurrency Value to be assigned
448
+ def download_concurrency=(download_concurrency)
449
+ if !download_concurrency.nil? && download_concurrency < 1
450
+ fail ArgumentError, 'invalid value for "download_concurrency", must be greater than or equal to 1.'
451
+ end
452
+
453
+ @download_concurrency = download_concurrency
454
+ end
455
+
456
+ # Custom attribute writer method with validation
457
+ # @param [Object] total_timeout Value to be assigned
458
+ def total_timeout=(total_timeout)
459
+ if !total_timeout.nil? && total_timeout < 0.0
460
+ fail ArgumentError, 'invalid value for "total_timeout", must be greater than or equal to 0.0.'
461
+ end
462
+
463
+ @total_timeout = total_timeout
464
+ end
465
+
466
+ # Custom attribute writer method with validation
467
+ # @param [Object] connect_timeout Value to be assigned
468
+ def connect_timeout=(connect_timeout)
469
+ if !connect_timeout.nil? && connect_timeout < 0.0
470
+ fail ArgumentError, 'invalid value for "connect_timeout", must be greater than or equal to 0.0.'
471
+ end
472
+
473
+ @connect_timeout = connect_timeout
474
+ end
475
+
476
+ # Custom attribute writer method with validation
477
+ # @param [Object] sock_connect_timeout Value to be assigned
478
+ def sock_connect_timeout=(sock_connect_timeout)
479
+ if !sock_connect_timeout.nil? && sock_connect_timeout < 0.0
480
+ fail ArgumentError, 'invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.'
481
+ end
482
+
483
+ @sock_connect_timeout = sock_connect_timeout
484
+ end
485
+
486
+ # Custom attribute writer method with validation
487
+ # @param [Object] sock_read_timeout Value to be assigned
488
+ def sock_read_timeout=(sock_read_timeout)
489
+ if !sock_read_timeout.nil? && sock_read_timeout < 0.0
490
+ fail ArgumentError, 'invalid value for "sock_read_timeout", must be greater than or equal to 0.0.'
491
+ end
492
+
493
+ @sock_read_timeout = sock_read_timeout
494
+ end
495
+
496
+ # Checks equality by comparing each attribute.
497
+ # @param [Object] Object to be compared
498
+ def ==(o)
499
+ return true if self.equal?(o)
500
+ self.class == o.class &&
501
+ name == o.name &&
502
+ url == o.url &&
503
+ ca_cert == o.ca_cert &&
504
+ client_cert == o.client_cert &&
505
+ client_key == o.client_key &&
506
+ tls_validation == o.tls_validation &&
507
+ proxy_url == o.proxy_url &&
508
+ proxy_username == o.proxy_username &&
509
+ proxy_password == o.proxy_password &&
510
+ username == o.username &&
511
+ password == o.password &&
512
+ pulp_labels == o.pulp_labels &&
513
+ download_concurrency == o.download_concurrency &&
514
+ max_retries == o.max_retries &&
515
+ policy == o.policy &&
516
+ total_timeout == o.total_timeout &&
517
+ connect_timeout == o.connect_timeout &&
518
+ sock_connect_timeout == o.sock_connect_timeout &&
519
+ sock_read_timeout == o.sock_read_timeout &&
520
+ headers == o.headers &&
521
+ rate_limit == o.rate_limit
522
+ end
523
+
524
+ # @see the `==` method
525
+ # @param [Object] Object to be compared
526
+ def eql?(o)
527
+ self == o
528
+ end
529
+
530
+ # Calculates hash code according to all attributes.
531
+ # @return [Integer] Hash code
532
+ def hash
533
+ [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
534
+ end
535
+
536
+ # Builds the object from hash
537
+ # @param [Hash] attributes Model attributes in the form of hash
538
+ # @return [Object] Returns the model itself
539
+ def self.build_from_hash(attributes)
540
+ new.build_from_hash(attributes)
541
+ end
542
+
543
+ # Builds the object from hash
544
+ # @param [Hash] attributes Model attributes in the form of hash
545
+ # @return [Object] Returns the model itself
546
+ def build_from_hash(attributes)
547
+ return nil unless attributes.is_a?(Hash)
548
+ self.class.openapi_types.each_pair do |key, type|
549
+ if type =~ /\AArray<(.*)>/i
550
+ # check to ensure the input is an array given that the attribute
551
+ # is documented as an array but the input is not
552
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
553
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
554
+ end
555
+ elsif !attributes[self.class.attribute_map[key]].nil?
556
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
557
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
558
+ end
559
+
560
+ self
561
+ end
562
+
563
+ # Deserializes the data based on type
564
+ # @param string type Data type
565
+ # @param string value Value to be deserialized
566
+ # @return [Object] Deserialized data
567
+ def _deserialize(type, value)
568
+ case type.to_sym
569
+ when :DateTime
570
+ DateTime.parse(value)
571
+ when :Date
572
+ Date.parse(value)
573
+ when :String
574
+ value.to_s
575
+ when :Integer
576
+ value.to_i
577
+ when :Float
578
+ value.to_f
579
+ when :Boolean
580
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
581
+ true
582
+ else
583
+ false
584
+ end
585
+ when :Object
586
+ # generic object (usually a Hash), return directly
587
+ value
588
+ when /\AArray<(?<inner_type>.+)>\z/
589
+ inner_type = Regexp.last_match[:inner_type]
590
+ value.map { |v| _deserialize(inner_type, v) }
591
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
592
+ k_type = Regexp.last_match[:k_type]
593
+ v_type = Regexp.last_match[:v_type]
594
+ {}.tap do |hash|
595
+ value.each do |k, v|
596
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
597
+ end
598
+ end
599
+ else # model
600
+ PulpContainerClient.const_get(type).build_from_hash(value)
601
+ end
602
+ end
603
+
604
+ # Returns the string representation of the object
605
+ # @return [String] String presentation of the object
606
+ def to_s
607
+ to_hash.to_s
608
+ end
609
+
610
+ # to_body is an alias to to_hash (backward compatibility)
611
+ # @return [Hash] Returns the object in the form of hash
612
+ def to_body
613
+ to_hash
614
+ end
615
+
616
+ # Returns the object in the form of hash
617
+ # @return [Hash] Returns the object in the form of hash
618
+ def to_hash
619
+ hash = {}
620
+ self.class.attribute_map.each_pair do |attr, param|
621
+ value = self.send(attr)
622
+ if value.nil?
623
+ is_nullable = self.class.openapi_nullable.include?(attr)
624
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
625
+ end
626
+
627
+ hash[param] = _to_hash(value)
628
+ end
629
+ hash
630
+ end
631
+
632
+ # Outputs non-array value in the form of hash
633
+ # For object, use to_hash. Otherwise, just return the value
634
+ # @param [Object] value Any valid value
635
+ # @return [Hash] Returns the value in the form of hash
636
+ def _to_hash(value)
637
+ if value.is_a?(Array)
638
+ value.compact.map { |v| _to_hash(v) }
639
+ elsif value.is_a?(Hash)
640
+ {}.tap do |hash|
641
+ value.each { |k, v| hash[k] = _to_hash(v) }
642
+ end
643
+ elsif value.respond_to? :to_hash
644
+ value.to_hash
645
+ else
646
+ value
647
+ end
648
+ end
649
+ end
650
+ end