pulpcore_client 3.20.0 → 3.21.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -84
  3. data/docs/ContentApi.md +1 -115
  4. data/docs/ContentguardsApi.md +1 -280
  5. data/docs/DistributionsApi.md +3 -281
  6. data/docs/PublicationsApi.md +0 -113
  7. data/docs/PulpImport.md +3 -1
  8. data/docs/RemotesApi.md +0 -280
  9. data/docs/RepositoriesApi.md +3 -281
  10. data/docs/UploadsApi.md +228 -0
  11. data/lib/pulpcore_client/api/content_api.rb +2 -134
  12. data/lib/pulpcore_client/api/contentguards_api.rb +2 -334
  13. data/lib/pulpcore_client/api/distributions_api.rb +5 -336
  14. data/lib/pulpcore_client/api/publications_api.rb +0 -128
  15. data/lib/pulpcore_client/api/remotes_api.rb +0 -334
  16. data/lib/pulpcore_client/api/repositories_api.rb +5 -336
  17. data/lib/pulpcore_client/api/repository_versions_api.rb +1 -1
  18. data/lib/pulpcore_client/api/uploads_api.rb +268 -0
  19. data/lib/pulpcore_client/api_client.rb +1 -1
  20. data/lib/pulpcore_client/models/pulp_import.rb +16 -4
  21. data/lib/pulpcore_client/version.rb +1 -1
  22. data/lib/pulpcore_client.rb +0 -31
  23. data/pulpcore_client.gemspec +3 -3
  24. data/spec/api/content_api_spec.rb +1 -27
  25. data/spec/api/contentguards_api_spec.rb +1 -65
  26. data/spec/api/distributions_api_spec.rb +2 -65
  27. data/spec/api/publications_api_spec.rb +0 -26
  28. data/spec/api/remotes_api_spec.rb +0 -64
  29. data/spec/api/repositories_api_spec.rb +2 -65
  30. data/spec/api/uploads_api_spec.rb +50 -0
  31. data/spec/models/pulp_import_spec.rb +6 -0
  32. metadata +136 -261
  33. data/docs/AcsApi.md +0 -417
  34. data/docs/AlternateContentSource.md +0 -23
  35. data/docs/AlternateContentSourceResponse.md +0 -27
  36. data/docs/ContentGuard.md +0 -19
  37. data/docs/Distribution.md +0 -25
  38. data/docs/Export.md +0 -17
  39. data/docs/ExportResponse.md +0 -25
  40. data/docs/Exporter.md +0 -17
  41. data/docs/ExporterResponse.md +0 -21
  42. data/docs/ExportersApi.md +0 -362
  43. data/docs/ExportersExportsApi.md +0 -241
  44. data/docs/Import.md +0 -19
  45. data/docs/Importer.md +0 -17
  46. data/docs/ImporterResponse.md +0 -21
  47. data/docs/ImportersApi.md +0 -361
  48. data/docs/ImportersImportsApi.md +0 -241
  49. data/docs/MultipleArtifactContent.md +0 -17
  50. data/docs/PaginatedAlternateContentSourceResponseList.md +0 -23
  51. data/docs/PaginatedExportResponseList.md +0 -23
  52. data/docs/PaginatedExporterResponseList.md +0 -23
  53. data/docs/PaginatedImporterResponseList.md +0 -23
  54. data/docs/PatchedAlternateContentSource.md +0 -23
  55. data/docs/PatchedContentGuard.md +0 -19
  56. data/docs/PatchedDistribution.md +0 -25
  57. data/docs/PatchedExporter.md +0 -17
  58. data/docs/PatchedImporter.md +0 -17
  59. data/docs/PatchedRemote.md +0 -57
  60. data/docs/PatchedRepository.md +0 -25
  61. data/docs/Remote.md +0 -57
  62. data/docs/RepositoriesVersionsApi.md +0 -271
  63. data/docs/Repository.md +0 -25
  64. data/git_push.sh +0 -58
  65. data/lib/pulpcore_client/api/acs_api.rb +0 -514
  66. data/lib/pulpcore_client/api/exporters_api.rb +0 -446
  67. data/lib/pulpcore_client/api/exporters_exports_api.rb +0 -294
  68. data/lib/pulpcore_client/api/importers_api.rb +0 -444
  69. data/lib/pulpcore_client/api/importers_imports_api.rb +0 -294
  70. data/lib/pulpcore_client/api/repositories_versions_api.rb +0 -343
  71. data/lib/pulpcore_client/models/alternate_content_source.rb +0 -270
  72. data/lib/pulpcore_client/models/alternate_content_source_response.rb +0 -270
  73. data/lib/pulpcore_client/models/content_guard.rb +0 -258
  74. data/lib/pulpcore_client/models/distribution.rb +0 -297
  75. data/lib/pulpcore_client/models/export.rb +0 -209
  76. data/lib/pulpcore_client/models/export_response.rb +0 -250
  77. data/lib/pulpcore_client/models/exporter.rb +0 -232
  78. data/lib/pulpcore_client/models/exporter_response.rb +0 -232
  79. data/lib/pulpcore_client/models/import.rb +0 -228
  80. data/lib/pulpcore_client/models/importer.rb +0 -232
  81. data/lib/pulpcore_client/models/importer_response.rb +0 -232
  82. data/lib/pulpcore_client/models/multiple_artifact_content.rb +0 -213
  83. data/lib/pulpcore_client/models/paginated_alternate_content_source_response_list.rb +0 -237
  84. data/lib/pulpcore_client/models/paginated_export_response_list.rb +0 -237
  85. data/lib/pulpcore_client/models/paginated_exporter_response_list.rb +0 -237
  86. data/lib/pulpcore_client/models/paginated_importer_response_list.rb +0 -237
  87. data/lib/pulpcore_client/models/patched_alternate_content_source.rb +0 -256
  88. data/lib/pulpcore_client/models/patched_content_guard.rb +0 -249
  89. data/lib/pulpcore_client/models/patched_distribution.rb +0 -279
  90. data/lib/pulpcore_client/models/patched_exporter.rb +0 -223
  91. data/lib/pulpcore_client/models/patched_importer.rb +0 -223
  92. data/lib/pulpcore_client/models/patched_remote.rb +0 -649
  93. data/lib/pulpcore_client/models/patched_repository.rb +0 -295
  94. data/lib/pulpcore_client/models/remote.rb +0 -667
  95. data/lib/pulpcore_client/models/repository.rb +0 -304
  96. data/spec/api/acs_api_spec.rb +0 -132
  97. data/spec/api/exporters_api_spec.rb +0 -120
  98. data/spec/api/exporters_exports_api_spec.rb +0 -90
  99. data/spec/api/importers_api_spec.rb +0 -120
  100. data/spec/api/importers_imports_api_spec.rb +0 -90
  101. data/spec/api/repositories_versions_api_spec.rb +0 -104
  102. data/spec/models/alternate_content_source_response_spec.rb +0 -71
  103. data/spec/models/alternate_content_source_spec.rb +0 -59
  104. data/spec/models/content_guard_spec.rb +0 -47
  105. data/spec/models/distribution_spec.rb +0 -65
  106. data/spec/models/export_response_spec.rb +0 -65
  107. data/spec/models/export_spec.rb +0 -41
  108. data/spec/models/exporter_response_spec.rb +0 -53
  109. data/spec/models/exporter_spec.rb +0 -41
  110. data/spec/models/import_spec.rb +0 -47
  111. data/spec/models/importer_response_spec.rb +0 -53
  112. data/spec/models/importer_spec.rb +0 -41
  113. data/spec/models/multiple_artifact_content_spec.rb +0 -41
  114. data/spec/models/paginated_alternate_content_source_response_list_spec.rb +0 -59
  115. data/spec/models/paginated_export_response_list_spec.rb +0 -59
  116. data/spec/models/paginated_exporter_response_list_spec.rb +0 -59
  117. data/spec/models/paginated_importer_response_list_spec.rb +0 -59
  118. data/spec/models/patched_alternate_content_source_spec.rb +0 -59
  119. data/spec/models/patched_content_guard_spec.rb +0 -47
  120. data/spec/models/patched_distribution_spec.rb +0 -65
  121. data/spec/models/patched_exporter_spec.rb +0 -41
  122. data/spec/models/patched_importer_spec.rb +0 -41
  123. data/spec/models/patched_remote_spec.rb +0 -161
  124. data/spec/models/patched_repository_spec.rb +0 -65
  125. data/spec/models/remote_spec.rb +0 -161
  126. data/spec/models/repository_spec.rb +0 -65
@@ -1,649 +0,0 @@
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 PulpcoreClient
16
- # Every remote defined by a plugin should have a Remote serializer that inherits from this class. Please import from `pulpcore.plugin.serializers` rather than from this module directly.
17
- class PatchedRemote
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
- # The policy to use when downloading content.
60
- attr_accessor :policy
61
-
62
- # aiohttp.ClientTimeout.total (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
63
- attr_accessor :total_timeout
64
-
65
- # aiohttp.ClientTimeout.connect (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
66
- attr_accessor :connect_timeout
67
-
68
- # 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.
69
- attr_accessor :sock_connect_timeout
70
-
71
- # 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.
72
- attr_accessor :sock_read_timeout
73
-
74
- # Headers for aiohttp.Clientsession
75
- attr_accessor :headers
76
-
77
- # Limits requests per second for each concurrent downloader
78
- attr_accessor :rate_limit
79
-
80
- # Attribute mapping from ruby-style variable name to JSON key.
81
- def self.attribute_map
82
- {
83
- :'name' => :'name',
84
- :'url' => :'url',
85
- :'ca_cert' => :'ca_cert',
86
- :'client_cert' => :'client_cert',
87
- :'client_key' => :'client_key',
88
- :'tls_validation' => :'tls_validation',
89
- :'proxy_url' => :'proxy_url',
90
- :'proxy_username' => :'proxy_username',
91
- :'proxy_password' => :'proxy_password',
92
- :'username' => :'username',
93
- :'password' => :'password',
94
- :'pulp_labels' => :'pulp_labels',
95
- :'download_concurrency' => :'download_concurrency',
96
- :'max_retries' => :'max_retries',
97
- :'policy' => :'policy',
98
- :'total_timeout' => :'total_timeout',
99
- :'connect_timeout' => :'connect_timeout',
100
- :'sock_connect_timeout' => :'sock_connect_timeout',
101
- :'sock_read_timeout' => :'sock_read_timeout',
102
- :'headers' => :'headers',
103
- :'rate_limit' => :'rate_limit'
104
- }
105
- end
106
-
107
- # Attribute type mapping.
108
- def self.openapi_types
109
- {
110
- :'name' => :'String',
111
- :'url' => :'String',
112
- :'ca_cert' => :'String',
113
- :'client_cert' => :'String',
114
- :'client_key' => :'String',
115
- :'tls_validation' => :'Boolean',
116
- :'proxy_url' => :'String',
117
- :'proxy_username' => :'String',
118
- :'proxy_password' => :'String',
119
- :'username' => :'String',
120
- :'password' => :'String',
121
- :'pulp_labels' => :'Object',
122
- :'download_concurrency' => :'Integer',
123
- :'max_retries' => :'Integer',
124
- :'policy' => :'PolicyEnum',
125
- :'total_timeout' => :'Float',
126
- :'connect_timeout' => :'Float',
127
- :'sock_connect_timeout' => :'Float',
128
- :'sock_read_timeout' => :'Float',
129
- :'headers' => :'Array<Object>',
130
- :'rate_limit' => :'Integer'
131
- }
132
- end
133
-
134
- # List of attributes with nullable: true
135
- def self.openapi_nullable
136
- Set.new([
137
- :'ca_cert',
138
- :'client_cert',
139
- :'client_key',
140
- :'proxy_url',
141
- :'proxy_username',
142
- :'proxy_password',
143
- :'username',
144
- :'password',
145
- :'download_concurrency',
146
- :'max_retries',
147
- :'total_timeout',
148
- :'connect_timeout',
149
- :'sock_connect_timeout',
150
- :'sock_read_timeout',
151
- :'rate_limit'
152
- ])
153
- end
154
-
155
- # Initializes the object
156
- # @param [Hash] attributes Model attributes in the form of hash
157
- def initialize(attributes = {})
158
- if (!attributes.is_a?(Hash))
159
- fail ArgumentError, "The input argument (attributes) must be a hash in `PulpcoreClient::PatchedRemote` initialize method"
160
- end
161
-
162
- # check to see if the attribute exists and convert string to symbol for hash key
163
- attributes = attributes.each_with_object({}) { |(k, v), h|
164
- if (!self.class.attribute_map.key?(k.to_sym))
165
- fail ArgumentError, "`#{k}` is not a valid attribute in `PulpcoreClient::PatchedRemote`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
166
- end
167
- h[k.to_sym] = v
168
- }
169
-
170
- if attributes.key?(:'name')
171
- self.name = attributes[:'name']
172
- end
173
-
174
- if attributes.key?(:'url')
175
- self.url = attributes[:'url']
176
- end
177
-
178
- if attributes.key?(:'ca_cert')
179
- self.ca_cert = attributes[:'ca_cert']
180
- end
181
-
182
- if attributes.key?(:'client_cert')
183
- self.client_cert = attributes[:'client_cert']
184
- end
185
-
186
- if attributes.key?(:'client_key')
187
- self.client_key = attributes[:'client_key']
188
- end
189
-
190
- if attributes.key?(:'tls_validation')
191
- self.tls_validation = attributes[:'tls_validation']
192
- end
193
-
194
- if attributes.key?(:'proxy_url')
195
- self.proxy_url = attributes[:'proxy_url']
196
- end
197
-
198
- if attributes.key?(:'proxy_username')
199
- self.proxy_username = attributes[:'proxy_username']
200
- end
201
-
202
- if attributes.key?(:'proxy_password')
203
- self.proxy_password = attributes[:'proxy_password']
204
- end
205
-
206
- if attributes.key?(:'username')
207
- self.username = attributes[:'username']
208
- end
209
-
210
- if attributes.key?(:'password')
211
- self.password = attributes[:'password']
212
- end
213
-
214
- if attributes.key?(:'pulp_labels')
215
- self.pulp_labels = attributes[:'pulp_labels']
216
- end
217
-
218
- if attributes.key?(:'download_concurrency')
219
- self.download_concurrency = attributes[:'download_concurrency']
220
- end
221
-
222
- if attributes.key?(:'max_retries')
223
- self.max_retries = attributes[:'max_retries']
224
- end
225
-
226
- if attributes.key?(:'policy')
227
- self.policy = attributes[:'policy']
228
- end
229
-
230
- if attributes.key?(:'total_timeout')
231
- self.total_timeout = attributes[:'total_timeout']
232
- end
233
-
234
- if attributes.key?(:'connect_timeout')
235
- self.connect_timeout = attributes[:'connect_timeout']
236
- end
237
-
238
- if attributes.key?(:'sock_connect_timeout')
239
- self.sock_connect_timeout = attributes[:'sock_connect_timeout']
240
- end
241
-
242
- if attributes.key?(:'sock_read_timeout')
243
- self.sock_read_timeout = attributes[:'sock_read_timeout']
244
- end
245
-
246
- if attributes.key?(:'headers')
247
- if (value = attributes[:'headers']).is_a?(Array)
248
- self.headers = value
249
- end
250
- end
251
-
252
- if attributes.key?(:'rate_limit')
253
- self.rate_limit = attributes[:'rate_limit']
254
- end
255
- end
256
-
257
- # Show invalid properties with the reasons. Usually used together with valid?
258
- # @return Array for valid properties with the reasons
259
- def list_invalid_properties
260
- invalid_properties = Array.new
261
- if !@name.nil? && @name.to_s.length < 1
262
- invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
263
- end
264
-
265
- if !@url.nil? && @url.to_s.length < 1
266
- invalid_properties.push('invalid value for "url", the character length must be great than or equal to 1.')
267
- end
268
-
269
- if !@ca_cert.nil? && @ca_cert.to_s.length < 1
270
- invalid_properties.push('invalid value for "ca_cert", the character length must be great than or equal to 1.')
271
- end
272
-
273
- if !@client_cert.nil? && @client_cert.to_s.length < 1
274
- invalid_properties.push('invalid value for "client_cert", the character length must be great than or equal to 1.')
275
- end
276
-
277
- if !@client_key.nil? && @client_key.to_s.length < 1
278
- invalid_properties.push('invalid value for "client_key", the character length must be great than or equal to 1.')
279
- end
280
-
281
- if !@proxy_url.nil? && @proxy_url.to_s.length < 1
282
- invalid_properties.push('invalid value for "proxy_url", the character length must be great than or equal to 1.')
283
- end
284
-
285
- if !@proxy_username.nil? && @proxy_username.to_s.length < 1
286
- invalid_properties.push('invalid value for "proxy_username", the character length must be great than or equal to 1.')
287
- end
288
-
289
- if !@proxy_password.nil? && @proxy_password.to_s.length < 1
290
- invalid_properties.push('invalid value for "proxy_password", the character length must be great than or equal to 1.')
291
- end
292
-
293
- if !@username.nil? && @username.to_s.length < 1
294
- invalid_properties.push('invalid value for "username", the character length must be great than or equal to 1.')
295
- end
296
-
297
- if !@password.nil? && @password.to_s.length < 1
298
- invalid_properties.push('invalid value for "password", the character length must be great than or equal to 1.')
299
- end
300
-
301
- if !@download_concurrency.nil? && @download_concurrency < 1
302
- invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
303
- end
304
-
305
- if !@total_timeout.nil? && @total_timeout < 0.0
306
- invalid_properties.push('invalid value for "total_timeout", must be greater than or equal to 0.0.')
307
- end
308
-
309
- if !@connect_timeout.nil? && @connect_timeout < 0.0
310
- invalid_properties.push('invalid value for "connect_timeout", must be greater than or equal to 0.0.')
311
- end
312
-
313
- if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
314
- invalid_properties.push('invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.')
315
- end
316
-
317
- if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
318
- invalid_properties.push('invalid value for "sock_read_timeout", must be greater than or equal to 0.0.')
319
- end
320
-
321
- invalid_properties
322
- end
323
-
324
- # Check to see if the all the properties in the model are valid
325
- # @return true if the model is valid
326
- def valid?
327
- return false if !@name.nil? && @name.to_s.length < 1
328
- return false if !@url.nil? && @url.to_s.length < 1
329
- return false if !@ca_cert.nil? && @ca_cert.to_s.length < 1
330
- return false if !@client_cert.nil? && @client_cert.to_s.length < 1
331
- return false if !@client_key.nil? && @client_key.to_s.length < 1
332
- return false if !@proxy_url.nil? && @proxy_url.to_s.length < 1
333
- return false if !@proxy_username.nil? && @proxy_username.to_s.length < 1
334
- return false if !@proxy_password.nil? && @proxy_password.to_s.length < 1
335
- return false if !@username.nil? && @username.to_s.length < 1
336
- return false if !@password.nil? && @password.to_s.length < 1
337
- return false if !@download_concurrency.nil? && @download_concurrency < 1
338
- return false if !@total_timeout.nil? && @total_timeout < 0.0
339
- return false if !@connect_timeout.nil? && @connect_timeout < 0.0
340
- return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
341
- return false if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
342
- true
343
- end
344
-
345
- # Custom attribute writer method with validation
346
- # @param [Object] name Value to be assigned
347
- def name=(name)
348
- if !name.nil? && name.to_s.length < 1
349
- fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
350
- end
351
-
352
- @name = name
353
- end
354
-
355
- # Custom attribute writer method with validation
356
- # @param [Object] url Value to be assigned
357
- def url=(url)
358
- if !url.nil? && url.to_s.length < 1
359
- fail ArgumentError, 'invalid value for "url", the character length must be great than or equal to 1.'
360
- end
361
-
362
- @url = url
363
- end
364
-
365
- # Custom attribute writer method with validation
366
- # @param [Object] ca_cert Value to be assigned
367
- def ca_cert=(ca_cert)
368
- if !ca_cert.nil? && ca_cert.to_s.length < 1
369
- fail ArgumentError, 'invalid value for "ca_cert", the character length must be great than or equal to 1.'
370
- end
371
-
372
- @ca_cert = ca_cert
373
- end
374
-
375
- # Custom attribute writer method with validation
376
- # @param [Object] client_cert Value to be assigned
377
- def client_cert=(client_cert)
378
- if !client_cert.nil? && client_cert.to_s.length < 1
379
- fail ArgumentError, 'invalid value for "client_cert", the character length must be great than or equal to 1.'
380
- end
381
-
382
- @client_cert = client_cert
383
- end
384
-
385
- # Custom attribute writer method with validation
386
- # @param [Object] client_key Value to be assigned
387
- def client_key=(client_key)
388
- if !client_key.nil? && client_key.to_s.length < 1
389
- fail ArgumentError, 'invalid value for "client_key", the character length must be great than or equal to 1.'
390
- end
391
-
392
- @client_key = client_key
393
- end
394
-
395
- # Custom attribute writer method with validation
396
- # @param [Object] proxy_url Value to be assigned
397
- def proxy_url=(proxy_url)
398
- if !proxy_url.nil? && proxy_url.to_s.length < 1
399
- fail ArgumentError, 'invalid value for "proxy_url", the character length must be great than or equal to 1.'
400
- end
401
-
402
- @proxy_url = proxy_url
403
- end
404
-
405
- # Custom attribute writer method with validation
406
- # @param [Object] proxy_username Value to be assigned
407
- def proxy_username=(proxy_username)
408
- if !proxy_username.nil? && proxy_username.to_s.length < 1
409
- fail ArgumentError, 'invalid value for "proxy_username", the character length must be great than or equal to 1.'
410
- end
411
-
412
- @proxy_username = proxy_username
413
- end
414
-
415
- # Custom attribute writer method with validation
416
- # @param [Object] proxy_password Value to be assigned
417
- def proxy_password=(proxy_password)
418
- if !proxy_password.nil? && proxy_password.to_s.length < 1
419
- fail ArgumentError, 'invalid value for "proxy_password", the character length must be great than or equal to 1.'
420
- end
421
-
422
- @proxy_password = proxy_password
423
- end
424
-
425
- # Custom attribute writer method with validation
426
- # @param [Object] username Value to be assigned
427
- def username=(username)
428
- if !username.nil? && username.to_s.length < 1
429
- fail ArgumentError, 'invalid value for "username", the character length must be great than or equal to 1.'
430
- end
431
-
432
- @username = username
433
- end
434
-
435
- # Custom attribute writer method with validation
436
- # @param [Object] password Value to be assigned
437
- def password=(password)
438
- if !password.nil? && password.to_s.length < 1
439
- fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 1.'
440
- end
441
-
442
- @password = password
443
- end
444
-
445
- # Custom attribute writer method with validation
446
- # @param [Object] download_concurrency Value to be assigned
447
- def download_concurrency=(download_concurrency)
448
- if !download_concurrency.nil? && download_concurrency < 1
449
- fail ArgumentError, 'invalid value for "download_concurrency", must be greater than or equal to 1.'
450
- end
451
-
452
- @download_concurrency = download_concurrency
453
- end
454
-
455
- # Custom attribute writer method with validation
456
- # @param [Object] total_timeout Value to be assigned
457
- def total_timeout=(total_timeout)
458
- if !total_timeout.nil? && total_timeout < 0.0
459
- fail ArgumentError, 'invalid value for "total_timeout", must be greater than or equal to 0.0.'
460
- end
461
-
462
- @total_timeout = total_timeout
463
- end
464
-
465
- # Custom attribute writer method with validation
466
- # @param [Object] connect_timeout Value to be assigned
467
- def connect_timeout=(connect_timeout)
468
- if !connect_timeout.nil? && connect_timeout < 0.0
469
- fail ArgumentError, 'invalid value for "connect_timeout", must be greater than or equal to 0.0.'
470
- end
471
-
472
- @connect_timeout = connect_timeout
473
- end
474
-
475
- # Custom attribute writer method with validation
476
- # @param [Object] sock_connect_timeout Value to be assigned
477
- def sock_connect_timeout=(sock_connect_timeout)
478
- if !sock_connect_timeout.nil? && sock_connect_timeout < 0.0
479
- fail ArgumentError, 'invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.'
480
- end
481
-
482
- @sock_connect_timeout = sock_connect_timeout
483
- end
484
-
485
- # Custom attribute writer method with validation
486
- # @param [Object] sock_read_timeout Value to be assigned
487
- def sock_read_timeout=(sock_read_timeout)
488
- if !sock_read_timeout.nil? && sock_read_timeout < 0.0
489
- fail ArgumentError, 'invalid value for "sock_read_timeout", must be greater than or equal to 0.0.'
490
- end
491
-
492
- @sock_read_timeout = sock_read_timeout
493
- end
494
-
495
- # Checks equality by comparing each attribute.
496
- # @param [Object] Object to be compared
497
- def ==(o)
498
- return true if self.equal?(o)
499
- self.class == o.class &&
500
- name == o.name &&
501
- url == o.url &&
502
- ca_cert == o.ca_cert &&
503
- client_cert == o.client_cert &&
504
- client_key == o.client_key &&
505
- tls_validation == o.tls_validation &&
506
- proxy_url == o.proxy_url &&
507
- proxy_username == o.proxy_username &&
508
- proxy_password == o.proxy_password &&
509
- username == o.username &&
510
- password == o.password &&
511
- pulp_labels == o.pulp_labels &&
512
- download_concurrency == o.download_concurrency &&
513
- max_retries == o.max_retries &&
514
- policy == o.policy &&
515
- total_timeout == o.total_timeout &&
516
- connect_timeout == o.connect_timeout &&
517
- sock_connect_timeout == o.sock_connect_timeout &&
518
- sock_read_timeout == o.sock_read_timeout &&
519
- headers == o.headers &&
520
- rate_limit == o.rate_limit
521
- end
522
-
523
- # @see the `==` method
524
- # @param [Object] Object to be compared
525
- def eql?(o)
526
- self == o
527
- end
528
-
529
- # Calculates hash code according to all attributes.
530
- # @return [Integer] Hash code
531
- def hash
532
- [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
533
- end
534
-
535
- # Builds the object from hash
536
- # @param [Hash] attributes Model attributes in the form of hash
537
- # @return [Object] Returns the model itself
538
- def self.build_from_hash(attributes)
539
- new.build_from_hash(attributes)
540
- end
541
-
542
- # Builds the object from hash
543
- # @param [Hash] attributes Model attributes in the form of hash
544
- # @return [Object] Returns the model itself
545
- def build_from_hash(attributes)
546
- return nil unless attributes.is_a?(Hash)
547
- self.class.openapi_types.each_pair do |key, type|
548
- if type =~ /\AArray<(.*)>/i
549
- # check to ensure the input is an array given that the attribute
550
- # is documented as an array but the input is not
551
- if attributes[self.class.attribute_map[key]].is_a?(Array)
552
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
553
- end
554
- elsif !attributes[self.class.attribute_map[key]].nil?
555
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
556
- end # or else data not found in attributes(hash), not an issue as the data can be optional
557
- end
558
-
559
- self
560
- end
561
-
562
- # Deserializes the data based on type
563
- # @param string type Data type
564
- # @param string value Value to be deserialized
565
- # @return [Object] Deserialized data
566
- def _deserialize(type, value)
567
- case type.to_sym
568
- when :DateTime
569
- DateTime.parse(value)
570
- when :Date
571
- Date.parse(value)
572
- when :String
573
- value.to_s
574
- when :Integer
575
- value.to_i
576
- when :Float
577
- value.to_f
578
- when :Boolean
579
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
580
- true
581
- else
582
- false
583
- end
584
- when :Object
585
- # generic object (usually a Hash), return directly
586
- value
587
- when /\AArray<(?<inner_type>.+)>\z/
588
- inner_type = Regexp.last_match[:inner_type]
589
- value.map { |v| _deserialize(inner_type, v) }
590
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
591
- k_type = Regexp.last_match[:k_type]
592
- v_type = Regexp.last_match[:v_type]
593
- {}.tap do |hash|
594
- value.each do |k, v|
595
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
596
- end
597
- end
598
- else # model
599
- PulpcoreClient.const_get(type).build_from_hash(value)
600
- end
601
- end
602
-
603
- # Returns the string representation of the object
604
- # @return [String] String presentation of the object
605
- def to_s
606
- to_hash.to_s
607
- end
608
-
609
- # to_body is an alias to to_hash (backward compatibility)
610
- # @return [Hash] Returns the object in the form of hash
611
- def to_body
612
- to_hash
613
- end
614
-
615
- # Returns the object in the form of hash
616
- # @return [Hash] Returns the object in the form of hash
617
- def to_hash
618
- hash = {}
619
- self.class.attribute_map.each_pair do |attr, param|
620
- value = self.send(attr)
621
- if value.nil?
622
- is_nullable = self.class.openapi_nullable.include?(attr)
623
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
624
- end
625
-
626
- hash[param] = _to_hash(value)
627
- end
628
- hash
629
- end
630
-
631
- # Outputs non-array value in the form of hash
632
- # For object, use to_hash. Otherwise, just return the value
633
- # @param [Object] value Any valid value
634
- # @return [Hash] Returns the value in the form of hash
635
- def _to_hash(value)
636
- if value.is_a?(Array)
637
- value.compact.map { |v| _to_hash(v) }
638
- elsif value.is_a?(Hash)
639
- {}.tap do |hash|
640
- value.each { |k, v| hash[k] = _to_hash(v) }
641
- end
642
- elsif value.respond_to? :to_hash
643
- value.to_hash
644
- else
645
- value
646
- end
647
- end
648
- end
649
- end