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