pulp_deb_client 3.8.1 → 3.8.2

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 (93) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -4
  3. data/docs/ContentGenericContentsApi.md +9 -7
  4. data/docs/ContentInstallerFileIndicesApi.md +6 -6
  5. data/docs/ContentInstallerPackagesApi.md +9 -7
  6. data/docs/ContentPackageIndicesApi.md +6 -6
  7. data/docs/ContentPackageReleaseComponentsApi.md +10 -10
  8. data/docs/ContentPackagesApi.md +8 -6
  9. data/docs/ContentReleaseArchitecturesApi.md +6 -6
  10. data/docs/ContentReleaseComponentsApi.md +6 -6
  11. data/docs/ContentReleaseFilesApi.md +6 -6
  12. data/docs/ContentReleasesApi.md +6 -6
  13. data/docs/ContentSourceIndicesApi.md +6 -6
  14. data/docs/ContentSourcePackagesApi.md +6 -6
  15. data/docs/ContentSourceReleaseComponentsApi.md +10 -10
  16. data/docs/DebAptDistribution.md +2 -0
  17. data/docs/DebAptDistributionResponse.md +4 -0
  18. data/docs/DebAptRemote.md +6 -6
  19. data/docs/DebAptRemoteResponse.md +8 -8
  20. data/docs/DebAptRepository.md +2 -0
  21. data/docs/DebAptRepositoryResponse.md +2 -0
  22. data/docs/DistributionsAptApi.md +4 -4
  23. data/docs/PatcheddebAptDistribution.md +2 -0
  24. data/docs/PatcheddebAptRemote.md +6 -6
  25. data/docs/PatcheddebAptRepository.md +2 -0
  26. data/docs/PublicationsAptApi.md +2 -2
  27. data/docs/PublicationsVerbatimApi.md +2 -2
  28. data/docs/RemoteNetworkConfig.md +50 -0
  29. data/docs/RemoteNetworkConfigResponse.md +40 -0
  30. data/docs/RepositoriesAptApi.md +20 -4
  31. data/lib/pulp_deb_client/api/content_generic_contents_api.rb +9 -6
  32. data/lib/pulp_deb_client/api/content_installer_file_indices_api.rb +6 -6
  33. data/lib/pulp_deb_client/api/content_installer_packages_api.rb +9 -6
  34. data/lib/pulp_deb_client/api/content_package_indices_api.rb +6 -6
  35. data/lib/pulp_deb_client/api/content_package_release_components_api.rb +10 -10
  36. data/lib/pulp_deb_client/api/content_packages_api.rb +9 -6
  37. data/lib/pulp_deb_client/api/content_release_architectures_api.rb +6 -6
  38. data/lib/pulp_deb_client/api/content_release_components_api.rb +6 -6
  39. data/lib/pulp_deb_client/api/content_release_files_api.rb +6 -6
  40. data/lib/pulp_deb_client/api/content_releases_api.rb +6 -6
  41. data/lib/pulp_deb_client/api/content_source_indices_api.rb +6 -6
  42. data/lib/pulp_deb_client/api/content_source_packages_api.rb +6 -6
  43. data/lib/pulp_deb_client/api/content_source_release_components_api.rb +10 -10
  44. data/lib/pulp_deb_client/api/distributions_apt_api.rb +4 -4
  45. data/lib/pulp_deb_client/api/publications_apt_api.rb +2 -2
  46. data/lib/pulp_deb_client/api/publications_verbatim_api.rb +2 -2
  47. data/lib/pulp_deb_client/api/repositories_apt_api.rb +29 -5
  48. data/lib/pulp_deb_client/models/deb_apt_distribution.rb +12 -1
  49. data/lib/pulp_deb_client/models/deb_apt_distribution_response.rb +22 -1
  50. data/lib/pulp_deb_client/models/deb_apt_remote.rb +48 -33
  51. data/lib/pulp_deb_client/models/deb_apt_remote_response.rb +60 -45
  52. data/lib/pulp_deb_client/models/deb_apt_repository.rb +42 -1
  53. data/lib/pulp_deb_client/models/deb_apt_repository_response.rb +42 -1
  54. data/lib/pulp_deb_client/models/patcheddeb_apt_distribution.rb +12 -1
  55. data/lib/pulp_deb_client/models/patcheddeb_apt_remote.rb +48 -33
  56. data/lib/pulp_deb_client/models/patcheddeb_apt_repository.rb +42 -1
  57. data/lib/pulp_deb_client/models/remote_network_config.rb +588 -0
  58. data/lib/pulp_deb_client/models/remote_network_config_response.rb +413 -0
  59. data/lib/pulp_deb_client/models/set_label.rb +0 -11
  60. data/lib/pulp_deb_client/models/set_label_response.rb +0 -21
  61. data/lib/pulp_deb_client/models/unset_label.rb +0 -11
  62. data/lib/pulp_deb_client/models/unset_label_response.rb +0 -21
  63. data/lib/pulp_deb_client/version.rb +1 -1
  64. data/lib/pulp_deb_client.rb +2 -0
  65. data/spec/api/content_generic_contents_api_spec.rb +4 -3
  66. data/spec/api/content_installer_file_indices_api_spec.rb +3 -3
  67. data/spec/api/content_installer_packages_api_spec.rb +4 -3
  68. data/spec/api/content_package_indices_api_spec.rb +3 -3
  69. data/spec/api/content_package_release_components_api_spec.rb +5 -5
  70. data/spec/api/content_packages_api_spec.rb +4 -3
  71. data/spec/api/content_release_architectures_api_spec.rb +3 -3
  72. data/spec/api/content_release_components_api_spec.rb +3 -3
  73. data/spec/api/content_release_files_api_spec.rb +3 -3
  74. data/spec/api/content_releases_api_spec.rb +3 -3
  75. data/spec/api/content_source_indices_api_spec.rb +3 -3
  76. data/spec/api/content_source_packages_api_spec.rb +3 -3
  77. data/spec/api/content_source_release_components_api_spec.rb +5 -5
  78. data/spec/api/distributions_apt_api_spec.rb +2 -2
  79. data/spec/api/publications_apt_api_spec.rb +1 -1
  80. data/spec/api/publications_verbatim_api_spec.rb +1 -1
  81. data/spec/api/repositories_apt_api_spec.rb +10 -2
  82. data/spec/models/deb_apt_distribution_response_spec.rb +12 -0
  83. data/spec/models/deb_apt_distribution_spec.rb +6 -0
  84. data/spec/models/deb_apt_remote_response_spec.rb +10 -10
  85. data/spec/models/deb_apt_remote_spec.rb +17 -17
  86. data/spec/models/deb_apt_repository_response_spec.rb +6 -0
  87. data/spec/models/deb_apt_repository_spec.rb +6 -0
  88. data/spec/models/patcheddeb_apt_distribution_spec.rb +6 -0
  89. data/spec/models/patcheddeb_apt_remote_spec.rb +17 -17
  90. data/spec/models/patcheddeb_apt_repository_spec.rb +6 -0
  91. data/spec/models/remote_network_config_response_spec.rb +102 -0
  92. data/spec/models/remote_network_config_spec.rb +132 -0
  93. metadata +88 -80
@@ -0,0 +1,588 @@
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
+ Generator version: 7.10.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module PulpDebClient
17
+ # Shared network configuration fields and validation logic used by both RemoteSerializer and UploadSerializerFieldsMixin.
18
+ class RemoteNetworkConfig
19
+ # A PEM encoded CA certificate used to validate the server certificate presented by the remote server.
20
+ attr_accessor :ca_cert
21
+
22
+ # A PEM encoded client certificate used for authentication.
23
+ attr_accessor :client_cert
24
+
25
+ # A PEM encoded private key used for authentication.
26
+ attr_accessor :client_key
27
+
28
+ # If True, TLS peer validation must be performed.
29
+ attr_accessor :tls_validation
30
+
31
+ # The proxy URL. Format: scheme://host:port
32
+ attr_accessor :proxy_url
33
+
34
+ # The username to authenticte to the proxy.
35
+ attr_accessor :proxy_username
36
+
37
+ # The password to authenticate to the proxy. Extra leading and trailing whitespace characters are not trimmed.
38
+ attr_accessor :proxy_password
39
+
40
+ # The username to be used for authentication when syncing.
41
+ attr_accessor :username
42
+
43
+ # The password to be used for authentication when syncing. Extra leading and trailing whitespace characters are not trimmed.
44
+ attr_accessor :password
45
+
46
+ # Maximum number of retry attempts after a download failure. If not set then the default value (3) will be used.
47
+ attr_accessor :max_retries
48
+
49
+ # aiohttp.ClientTimeout.total (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
50
+ attr_accessor :total_timeout
51
+
52
+ # aiohttp.ClientTimeout.connect (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
53
+ attr_accessor :connect_timeout
54
+
55
+ # 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.
56
+ attr_accessor :sock_connect_timeout
57
+
58
+ # 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.
59
+ attr_accessor :sock_read_timeout
60
+
61
+ # Headers for aiohttp.Clientsession
62
+ attr_accessor :headers
63
+
64
+ # Total number of simultaneous connections. If not set then the default value will be used.
65
+ attr_accessor :download_concurrency
66
+
67
+ # Limits requests per second for each concurrent downloader
68
+ attr_accessor :rate_limit
69
+
70
+ # Attribute mapping from ruby-style variable name to JSON key.
71
+ def self.attribute_map
72
+ {
73
+ :'ca_cert' => :'ca_cert',
74
+ :'client_cert' => :'client_cert',
75
+ :'client_key' => :'client_key',
76
+ :'tls_validation' => :'tls_validation',
77
+ :'proxy_url' => :'proxy_url',
78
+ :'proxy_username' => :'proxy_username',
79
+ :'proxy_password' => :'proxy_password',
80
+ :'username' => :'username',
81
+ :'password' => :'password',
82
+ :'max_retries' => :'max_retries',
83
+ :'total_timeout' => :'total_timeout',
84
+ :'connect_timeout' => :'connect_timeout',
85
+ :'sock_connect_timeout' => :'sock_connect_timeout',
86
+ :'sock_read_timeout' => :'sock_read_timeout',
87
+ :'headers' => :'headers',
88
+ :'download_concurrency' => :'download_concurrency',
89
+ :'rate_limit' => :'rate_limit'
90
+ }
91
+ end
92
+
93
+ # Returns all the JSON keys this model knows about
94
+ def self.acceptable_attributes
95
+ attribute_map.values
96
+ end
97
+
98
+ # Attribute type mapping.
99
+ def self.openapi_types
100
+ {
101
+ :'ca_cert' => :'String',
102
+ :'client_cert' => :'String',
103
+ :'client_key' => :'String',
104
+ :'tls_validation' => :'Boolean',
105
+ :'proxy_url' => :'String',
106
+ :'proxy_username' => :'String',
107
+ :'proxy_password' => :'String',
108
+ :'username' => :'String',
109
+ :'password' => :'String',
110
+ :'max_retries' => :'Integer',
111
+ :'total_timeout' => :'Float',
112
+ :'connect_timeout' => :'Float',
113
+ :'sock_connect_timeout' => :'Float',
114
+ :'sock_read_timeout' => :'Float',
115
+ :'headers' => :'Array<Object>',
116
+ :'download_concurrency' => :'Integer',
117
+ :'rate_limit' => :'Integer'
118
+ }
119
+ end
120
+
121
+ # List of attributes with nullable: true
122
+ def self.openapi_nullable
123
+ Set.new([
124
+ :'ca_cert',
125
+ :'client_cert',
126
+ :'client_key',
127
+ :'proxy_url',
128
+ :'proxy_username',
129
+ :'proxy_password',
130
+ :'username',
131
+ :'password',
132
+ :'max_retries',
133
+ :'total_timeout',
134
+ :'connect_timeout',
135
+ :'sock_connect_timeout',
136
+ :'sock_read_timeout',
137
+ :'download_concurrency',
138
+ :'rate_limit'
139
+ ])
140
+ end
141
+
142
+ # Initializes the object
143
+ # @param [Hash] attributes Model attributes in the form of hash
144
+ def initialize(attributes = {})
145
+ if (!attributes.is_a?(Hash))
146
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpDebClient::RemoteNetworkConfig` initialize method"
147
+ end
148
+
149
+ # check to see if the attribute exists and convert string to symbol for hash key
150
+ attributes = attributes.each_with_object({}) { |(k, v), h|
151
+ if (!self.class.attribute_map.key?(k.to_sym))
152
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpDebClient::RemoteNetworkConfig`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
153
+ end
154
+ h[k.to_sym] = v
155
+ }
156
+
157
+ if attributes.key?(:'ca_cert')
158
+ self.ca_cert = attributes[:'ca_cert']
159
+ end
160
+
161
+ if attributes.key?(:'client_cert')
162
+ self.client_cert = attributes[:'client_cert']
163
+ end
164
+
165
+ if attributes.key?(:'client_key')
166
+ self.client_key = attributes[:'client_key']
167
+ end
168
+
169
+ if attributes.key?(:'tls_validation')
170
+ self.tls_validation = attributes[:'tls_validation']
171
+ end
172
+
173
+ if attributes.key?(:'proxy_url')
174
+ self.proxy_url = attributes[:'proxy_url']
175
+ end
176
+
177
+ if attributes.key?(:'proxy_username')
178
+ self.proxy_username = attributes[:'proxy_username']
179
+ end
180
+
181
+ if attributes.key?(:'proxy_password')
182
+ self.proxy_password = attributes[:'proxy_password']
183
+ end
184
+
185
+ if attributes.key?(:'username')
186
+ self.username = attributes[:'username']
187
+ end
188
+
189
+ if attributes.key?(:'password')
190
+ self.password = attributes[:'password']
191
+ end
192
+
193
+ if attributes.key?(:'max_retries')
194
+ self.max_retries = attributes[:'max_retries']
195
+ end
196
+
197
+ if attributes.key?(:'total_timeout')
198
+ self.total_timeout = attributes[:'total_timeout']
199
+ end
200
+
201
+ if attributes.key?(:'connect_timeout')
202
+ self.connect_timeout = attributes[:'connect_timeout']
203
+ end
204
+
205
+ if attributes.key?(:'sock_connect_timeout')
206
+ self.sock_connect_timeout = attributes[:'sock_connect_timeout']
207
+ end
208
+
209
+ if attributes.key?(:'sock_read_timeout')
210
+ self.sock_read_timeout = attributes[:'sock_read_timeout']
211
+ end
212
+
213
+ if attributes.key?(:'headers')
214
+ if (value = attributes[:'headers']).is_a?(Array)
215
+ self.headers = 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?(:'rate_limit')
224
+ self.rate_limit = attributes[:'rate_limit']
225
+ end
226
+ end
227
+
228
+ # Show invalid properties with the reasons. Usually used together with valid?
229
+ # @return Array for valid properties with the reasons
230
+ def list_invalid_properties
231
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
232
+ invalid_properties = Array.new
233
+ if !@ca_cert.nil? && @ca_cert.to_s.length < 1
234
+ invalid_properties.push('invalid value for "ca_cert", the character length must be great than or equal to 1.')
235
+ end
236
+
237
+ if !@client_cert.nil? && @client_cert.to_s.length < 1
238
+ invalid_properties.push('invalid value for "client_cert", the character length must be great than or equal to 1.')
239
+ end
240
+
241
+ if !@client_key.nil? && @client_key.to_s.length < 1
242
+ invalid_properties.push('invalid value for "client_key", the character length must be great than or equal to 1.')
243
+ end
244
+
245
+ if !@proxy_url.nil? && @proxy_url.to_s.length < 1
246
+ invalid_properties.push('invalid value for "proxy_url", the character length must be great than or equal to 1.')
247
+ end
248
+
249
+ if !@proxy_username.nil? && @proxy_username.to_s.length < 1
250
+ invalid_properties.push('invalid value for "proxy_username", the character length must be great than or equal to 1.')
251
+ end
252
+
253
+ if !@proxy_password.nil? && @proxy_password.to_s.length < 1
254
+ invalid_properties.push('invalid value for "proxy_password", the character length must be great than or equal to 1.')
255
+ end
256
+
257
+ if !@username.nil? && @username.to_s.length < 1
258
+ invalid_properties.push('invalid value for "username", the character length must be great than or equal to 1.')
259
+ end
260
+
261
+ if !@password.nil? && @password.to_s.length < 1
262
+ invalid_properties.push('invalid value for "password", the character length must be great than or equal to 1.')
263
+ end
264
+
265
+ if !@total_timeout.nil? && @total_timeout < 0.0
266
+ invalid_properties.push('invalid value for "total_timeout", must be greater than or equal to 0.0.')
267
+ end
268
+
269
+ if !@connect_timeout.nil? && @connect_timeout < 0.0
270
+ invalid_properties.push('invalid value for "connect_timeout", must be greater than or equal to 0.0.')
271
+ end
272
+
273
+ if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
274
+ invalid_properties.push('invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.')
275
+ end
276
+
277
+ if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
278
+ invalid_properties.push('invalid value for "sock_read_timeout", must be greater than or equal to 0.0.')
279
+ end
280
+
281
+ if !@download_concurrency.nil? && @download_concurrency < 1
282
+ invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
283
+ end
284
+
285
+ invalid_properties
286
+ end
287
+
288
+ # Check to see if the all the properties in the model are valid
289
+ # @return true if the model is valid
290
+ def valid?
291
+ warn '[DEPRECATED] the `valid?` method is obsolete'
292
+ return false if !@ca_cert.nil? && @ca_cert.to_s.length < 1
293
+ return false if !@client_cert.nil? && @client_cert.to_s.length < 1
294
+ return false if !@client_key.nil? && @client_key.to_s.length < 1
295
+ return false if !@proxy_url.nil? && @proxy_url.to_s.length < 1
296
+ return false if !@proxy_username.nil? && @proxy_username.to_s.length < 1
297
+ return false if !@proxy_password.nil? && @proxy_password.to_s.length < 1
298
+ return false if !@username.nil? && @username.to_s.length < 1
299
+ return false if !@password.nil? && @password.to_s.length < 1
300
+ return false if !@total_timeout.nil? && @total_timeout < 0.0
301
+ return false if !@connect_timeout.nil? && @connect_timeout < 0.0
302
+ return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
303
+ return false if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
304
+ return false if !@download_concurrency.nil? && @download_concurrency < 1
305
+ true
306
+ end
307
+
308
+ # Custom attribute writer method with validation
309
+ # @param [Object] ca_cert Value to be assigned
310
+ def ca_cert=(ca_cert)
311
+ if !ca_cert.nil? && ca_cert.to_s.length < 1
312
+ fail ArgumentError, 'invalid value for "ca_cert", the character length must be great than or equal to 1.'
313
+ end
314
+
315
+ @ca_cert = ca_cert
316
+ end
317
+
318
+ # Custom attribute writer method with validation
319
+ # @param [Object] client_cert Value to be assigned
320
+ def client_cert=(client_cert)
321
+ if !client_cert.nil? && client_cert.to_s.length < 1
322
+ fail ArgumentError, 'invalid value for "client_cert", the character length must be great than or equal to 1.'
323
+ end
324
+
325
+ @client_cert = client_cert
326
+ end
327
+
328
+ # Custom attribute writer method with validation
329
+ # @param [Object] client_key Value to be assigned
330
+ def client_key=(client_key)
331
+ if !client_key.nil? && client_key.to_s.length < 1
332
+ fail ArgumentError, 'invalid value for "client_key", the character length must be great than or equal to 1.'
333
+ end
334
+
335
+ @client_key = client_key
336
+ end
337
+
338
+ # Custom attribute writer method with validation
339
+ # @param [Object] proxy_url Value to be assigned
340
+ def proxy_url=(proxy_url)
341
+ if !proxy_url.nil? && proxy_url.to_s.length < 1
342
+ fail ArgumentError, 'invalid value for "proxy_url", the character length must be great than or equal to 1.'
343
+ end
344
+
345
+ @proxy_url = proxy_url
346
+ end
347
+
348
+ # Custom attribute writer method with validation
349
+ # @param [Object] proxy_username Value to be assigned
350
+ def proxy_username=(proxy_username)
351
+ if !proxy_username.nil? && proxy_username.to_s.length < 1
352
+ fail ArgumentError, 'invalid value for "proxy_username", the character length must be great than or equal to 1.'
353
+ end
354
+
355
+ @proxy_username = proxy_username
356
+ end
357
+
358
+ # Custom attribute writer method with validation
359
+ # @param [Object] proxy_password Value to be assigned
360
+ def proxy_password=(proxy_password)
361
+ if !proxy_password.nil? && proxy_password.to_s.length < 1
362
+ fail ArgumentError, 'invalid value for "proxy_password", the character length must be great than or equal to 1.'
363
+ end
364
+
365
+ @proxy_password = proxy_password
366
+ end
367
+
368
+ # Custom attribute writer method with validation
369
+ # @param [Object] username Value to be assigned
370
+ def username=(username)
371
+ if !username.nil? && username.to_s.length < 1
372
+ fail ArgumentError, 'invalid value for "username", the character length must be great than or equal to 1.'
373
+ end
374
+
375
+ @username = username
376
+ end
377
+
378
+ # Custom attribute writer method with validation
379
+ # @param [Object] password Value to be assigned
380
+ def password=(password)
381
+ if !password.nil? && password.to_s.length < 1
382
+ fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 1.'
383
+ end
384
+
385
+ @password = password
386
+ end
387
+
388
+ # Custom attribute writer method with validation
389
+ # @param [Object] total_timeout Value to be assigned
390
+ def total_timeout=(total_timeout)
391
+ if !total_timeout.nil? && total_timeout < 0.0
392
+ fail ArgumentError, 'invalid value for "total_timeout", must be greater than or equal to 0.0.'
393
+ end
394
+
395
+ @total_timeout = total_timeout
396
+ end
397
+
398
+ # Custom attribute writer method with validation
399
+ # @param [Object] connect_timeout Value to be assigned
400
+ def connect_timeout=(connect_timeout)
401
+ if !connect_timeout.nil? && connect_timeout < 0.0
402
+ fail ArgumentError, 'invalid value for "connect_timeout", must be greater than or equal to 0.0.'
403
+ end
404
+
405
+ @connect_timeout = connect_timeout
406
+ end
407
+
408
+ # Custom attribute writer method with validation
409
+ # @param [Object] sock_connect_timeout Value to be assigned
410
+ def sock_connect_timeout=(sock_connect_timeout)
411
+ if !sock_connect_timeout.nil? && sock_connect_timeout < 0.0
412
+ fail ArgumentError, 'invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.'
413
+ end
414
+
415
+ @sock_connect_timeout = sock_connect_timeout
416
+ end
417
+
418
+ # Custom attribute writer method with validation
419
+ # @param [Object] sock_read_timeout Value to be assigned
420
+ def sock_read_timeout=(sock_read_timeout)
421
+ if !sock_read_timeout.nil? && sock_read_timeout < 0.0
422
+ fail ArgumentError, 'invalid value for "sock_read_timeout", must be greater than or equal to 0.0.'
423
+ end
424
+
425
+ @sock_read_timeout = sock_read_timeout
426
+ end
427
+
428
+ # Custom attribute writer method with validation
429
+ # @param [Object] download_concurrency Value to be assigned
430
+ def download_concurrency=(download_concurrency)
431
+ if !download_concurrency.nil? && download_concurrency < 1
432
+ fail ArgumentError, 'invalid value for "download_concurrency", must be greater than or equal to 1.'
433
+ end
434
+
435
+ @download_concurrency = download_concurrency
436
+ end
437
+
438
+ # Checks equality by comparing each attribute.
439
+ # @param [Object] Object to be compared
440
+ def ==(o)
441
+ return true if self.equal?(o)
442
+ self.class == o.class &&
443
+ ca_cert == o.ca_cert &&
444
+ client_cert == o.client_cert &&
445
+ client_key == o.client_key &&
446
+ tls_validation == o.tls_validation &&
447
+ proxy_url == o.proxy_url &&
448
+ proxy_username == o.proxy_username &&
449
+ proxy_password == o.proxy_password &&
450
+ username == o.username &&
451
+ password == o.password &&
452
+ max_retries == o.max_retries &&
453
+ total_timeout == o.total_timeout &&
454
+ connect_timeout == o.connect_timeout &&
455
+ sock_connect_timeout == o.sock_connect_timeout &&
456
+ sock_read_timeout == o.sock_read_timeout &&
457
+ headers == o.headers &&
458
+ download_concurrency == o.download_concurrency &&
459
+ rate_limit == o.rate_limit
460
+ end
461
+
462
+ # @see the `==` method
463
+ # @param [Object] Object to be compared
464
+ def eql?(o)
465
+ self == o
466
+ end
467
+
468
+ # Calculates hash code according to all attributes.
469
+ # @return [Integer] Hash code
470
+ def hash
471
+ [ca_cert, client_cert, client_key, tls_validation, proxy_url, proxy_username, proxy_password, username, password, max_retries, total_timeout, connect_timeout, sock_connect_timeout, sock_read_timeout, headers, download_concurrency, rate_limit].hash
472
+ end
473
+
474
+ # Builds the object from hash
475
+ # @param [Hash] attributes Model attributes in the form of hash
476
+ # @return [Object] Returns the model itself
477
+ def self.build_from_hash(attributes)
478
+ return nil unless attributes.is_a?(Hash)
479
+ attributes = attributes.transform_keys(&:to_sym)
480
+ transformed_hash = {}
481
+ openapi_types.each_pair do |key, type|
482
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
483
+ transformed_hash["#{key}"] = nil
484
+ elsif type =~ /\AArray<(.*)>/i
485
+ # check to ensure the input is an array given that the attribute
486
+ # is documented as an array but the input is not
487
+ if attributes[attribute_map[key]].is_a?(Array)
488
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
489
+ end
490
+ elsif !attributes[attribute_map[key]].nil?
491
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
492
+ end
493
+ end
494
+ new(transformed_hash)
495
+ end
496
+
497
+ # Deserializes the data based on type
498
+ # @param string type Data type
499
+ # @param string value Value to be deserialized
500
+ # @return [Object] Deserialized data
501
+ def self._deserialize(type, value)
502
+ case type.to_sym
503
+ when :Time
504
+ Time.parse(value)
505
+ when :Date
506
+ Date.parse(value)
507
+ when :String
508
+ value.to_s
509
+ when :Integer
510
+ value.to_i
511
+ when :Float
512
+ value.to_f
513
+ when :Boolean
514
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
515
+ true
516
+ else
517
+ false
518
+ end
519
+ when :Object
520
+ # generic object (usually a Hash), return directly
521
+ value
522
+ when /\AArray<(?<inner_type>.+)>\z/
523
+ inner_type = Regexp.last_match[:inner_type]
524
+ value.map { |v| _deserialize(inner_type, v) }
525
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
526
+ k_type = Regexp.last_match[:k_type]
527
+ v_type = Regexp.last_match[:v_type]
528
+ {}.tap do |hash|
529
+ value.each do |k, v|
530
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
531
+ end
532
+ end
533
+ else # model
534
+ # models (e.g. Pet) or oneOf
535
+ klass = PulpDebClient.const_get(type)
536
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
537
+ end
538
+ end
539
+
540
+ # Returns the string representation of the object
541
+ # @return [String] String presentation of the object
542
+ def to_s
543
+ to_hash.to_s
544
+ end
545
+
546
+ # to_body is an alias to to_hash (backward compatibility)
547
+ # @return [Hash] Returns the object in the form of hash
548
+ def to_body
549
+ to_hash
550
+ end
551
+
552
+ # Returns the object in the form of hash
553
+ # @return [Hash] Returns the object in the form of hash
554
+ def to_hash
555
+ hash = {}
556
+ self.class.attribute_map.each_pair do |attr, param|
557
+ value = self.send(attr)
558
+ if value.nil?
559
+ is_nullable = self.class.openapi_nullable.include?(attr)
560
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
561
+ end
562
+
563
+ hash[param] = _to_hash(value)
564
+ end
565
+ hash
566
+ end
567
+
568
+ # Outputs non-array value in the form of hash
569
+ # For object, use to_hash. Otherwise, just return the value
570
+ # @param [Object] value Any valid value
571
+ # @return [Hash] Returns the value in the form of hash
572
+ def _to_hash(value)
573
+ if value.is_a?(Array)
574
+ value.compact.map { |v| _to_hash(v) }
575
+ elsif value.is_a?(Hash)
576
+ {}.tap do |hash|
577
+ value.each { |k, v| hash[k] = _to_hash(v) }
578
+ end
579
+ elsif value.respond_to? :to_hash
580
+ value.to_hash
581
+ else
582
+ value
583
+ end
584
+ end
585
+
586
+ end
587
+
588
+ end