pulp_file_client 3.104.2 → 3.105.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 (36) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +21 -5
  3. data/docs/FileFileGitRemote.md +58 -0
  4. data/docs/FileFileGitRemoteResponse.md +58 -0
  5. data/docs/{FileFileRemoteResponseHiddenFieldsInner.md → FileFileGitRemoteResponseHiddenFieldsInner.md} +2 -2
  6. data/docs/FileFileRemoteResponse.md +1 -1
  7. data/docs/PaginatedfileFileGitRemoteResponseList.md +24 -0
  8. data/docs/PatchedfileFileGitRemote.md +58 -0
  9. data/docs/RemotesGitApi.md +981 -0
  10. data/lib/pulp_file_client/api/remotes_git_api.rb +979 -0
  11. data/lib/pulp_file_client/models/file_file_git_remote.rb +702 -0
  12. data/lib/pulp_file_client/models/file_file_git_remote_response.rb +521 -0
  13. data/lib/pulp_file_client/models/{file_file_remote_response_hidden_fields_inner.rb → file_file_git_remote_response_hidden_fields_inner.rb} +3 -3
  14. data/lib/pulp_file_client/models/file_file_remote.rb +15 -0
  15. data/lib/pulp_file_client/models/file_file_remote_response.rb +16 -1
  16. data/lib/pulp_file_client/models/file_file_repository.rb +15 -0
  17. data/lib/pulp_file_client/models/file_file_repository_response.rb +15 -0
  18. data/lib/pulp_file_client/models/paginatedfile_file_git_remote_response_list.rb +257 -0
  19. data/lib/pulp_file_client/models/patchedfile_file_git_remote.rb +688 -0
  20. data/lib/pulp_file_client/models/patchedfile_file_remote.rb +15 -0
  21. data/lib/pulp_file_client/models/patchedfile_file_repository.rb +15 -0
  22. data/lib/pulp_file_client/models/remote_network_config.rb +15 -0
  23. data/lib/pulp_file_client/models/remote_network_config_response.rb +15 -0
  24. data/lib/pulp_file_client/models/set_label.rb +0 -11
  25. data/lib/pulp_file_client/models/set_label_response.rb +0 -21
  26. data/lib/pulp_file_client/models/unset_label.rb +0 -11
  27. data/lib/pulp_file_client/models/unset_label_response.rb +0 -21
  28. data/lib/pulp_file_client/version.rb +1 -1
  29. data/lib/pulp_file_client.rb +6 -1
  30. data/spec/api/remotes_git_api_spec.rb +228 -0
  31. data/spec/models/{file_file_remote_response_hidden_fields_inner_spec.rb → file_file_git_remote_response_hidden_fields_inner_spec.rb} +6 -6
  32. data/spec/models/file_file_git_remote_response_spec.rb +156 -0
  33. data/spec/models/file_file_git_remote_spec.rb +156 -0
  34. data/spec/models/paginatedfile_file_git_remote_response_list_spec.rb +54 -0
  35. data/spec/models/patchedfile_file_git_remote_spec.rb +156 -0
  36. metadata +26 -6
@@ -0,0 +1,688 @@
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 PulpFileClient
17
+ # Serializer for File Git Remotes.
18
+ class PatchedfileFileGitRemote
19
+ # A unique name for this remote.
20
+ attr_accessor :name
21
+
22
+ # The URL of an external content source.
23
+ attr_accessor :url
24
+
25
+ attr_accessor :pulp_labels
26
+
27
+ # A PEM encoded CA certificate used to validate the server certificate presented by the remote server.
28
+ attr_accessor :ca_cert
29
+
30
+ # A PEM encoded client certificate used for authentication.
31
+ attr_accessor :client_cert
32
+
33
+ # A PEM encoded private key used for authentication.
34
+ attr_accessor :client_key
35
+
36
+ # If True, TLS peer validation must be performed.
37
+ attr_accessor :tls_validation
38
+
39
+ # The proxy URL. Format: scheme://host:port
40
+ attr_accessor :proxy_url
41
+
42
+ # The username to authenticte to the proxy.
43
+ attr_accessor :proxy_username
44
+
45
+ # The password to authenticate to the proxy. Extra leading and trailing whitespace characters are not trimmed.
46
+ attr_accessor :proxy_password
47
+
48
+ # The username to be used for authentication when syncing.
49
+ attr_accessor :username
50
+
51
+ # The password to be used for authentication when syncing. Extra leading and trailing whitespace characters are not trimmed.
52
+ attr_accessor :password
53
+
54
+ # Maximum number of retry attempts after a download failure. If not set then the default value (3) will be used.
55
+ attr_accessor :max_retries
56
+
57
+ # aiohttp.ClientTimeout.total (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
58
+ attr_accessor :total_timeout
59
+
60
+ # aiohttp.ClientTimeout.connect (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
61
+ attr_accessor :connect_timeout
62
+
63
+ # 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.
64
+ attr_accessor :sock_connect_timeout
65
+
66
+ # 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.
67
+ attr_accessor :sock_read_timeout
68
+
69
+ # Headers for aiohttp.Clientsession
70
+ attr_accessor :headers
71
+
72
+ # Total number of simultaneous connections. If not set then the default value will be used.
73
+ attr_accessor :download_concurrency
74
+
75
+ # Limits requests per second for each concurrent downloader
76
+ attr_accessor :rate_limit
77
+
78
+ # The git ref (branch, tag, or commit hash) to sync from. Defaults to HEAD.
79
+ attr_accessor :git_ref
80
+
81
+ # Attribute mapping from ruby-style variable name to JSON key.
82
+ def self.attribute_map
83
+ {
84
+ :'name' => :'name',
85
+ :'url' => :'url',
86
+ :'pulp_labels' => :'pulp_labels',
87
+ :'ca_cert' => :'ca_cert',
88
+ :'client_cert' => :'client_cert',
89
+ :'client_key' => :'client_key',
90
+ :'tls_validation' => :'tls_validation',
91
+ :'proxy_url' => :'proxy_url',
92
+ :'proxy_username' => :'proxy_username',
93
+ :'proxy_password' => :'proxy_password',
94
+ :'username' => :'username',
95
+ :'password' => :'password',
96
+ :'max_retries' => :'max_retries',
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
+ :'download_concurrency' => :'download_concurrency',
103
+ :'rate_limit' => :'rate_limit',
104
+ :'git_ref' => :'git_ref'
105
+ }
106
+ end
107
+
108
+ # Returns all the JSON keys this model knows about
109
+ def self.acceptable_attributes
110
+ attribute_map.values
111
+ end
112
+
113
+ # Attribute type mapping.
114
+ def self.openapi_types
115
+ {
116
+ :'name' => :'String',
117
+ :'url' => :'String',
118
+ :'pulp_labels' => :'Hash<String, String>',
119
+ :'ca_cert' => :'String',
120
+ :'client_cert' => :'String',
121
+ :'client_key' => :'String',
122
+ :'tls_validation' => :'Boolean',
123
+ :'proxy_url' => :'String',
124
+ :'proxy_username' => :'String',
125
+ :'proxy_password' => :'String',
126
+ :'username' => :'String',
127
+ :'password' => :'String',
128
+ :'max_retries' => :'Integer',
129
+ :'total_timeout' => :'Float',
130
+ :'connect_timeout' => :'Float',
131
+ :'sock_connect_timeout' => :'Float',
132
+ :'sock_read_timeout' => :'Float',
133
+ :'headers' => :'Array<Object>',
134
+ :'download_concurrency' => :'Integer',
135
+ :'rate_limit' => :'Integer',
136
+ :'git_ref' => :'String'
137
+ }
138
+ end
139
+
140
+ # List of attributes with nullable: true
141
+ def self.openapi_nullable
142
+ Set.new([
143
+ :'ca_cert',
144
+ :'client_cert',
145
+ :'client_key',
146
+ :'proxy_url',
147
+ :'proxy_username',
148
+ :'proxy_password',
149
+ :'username',
150
+ :'password',
151
+ :'max_retries',
152
+ :'total_timeout',
153
+ :'connect_timeout',
154
+ :'sock_connect_timeout',
155
+ :'sock_read_timeout',
156
+ :'download_concurrency',
157
+ :'rate_limit',
158
+ ])
159
+ end
160
+
161
+ # Initializes the object
162
+ # @param [Hash] attributes Model attributes in the form of hash
163
+ def initialize(attributes = {})
164
+ if (!attributes.is_a?(Hash))
165
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpFileClient::PatchedfileFileGitRemote` initialize method"
166
+ end
167
+
168
+ # check to see if the attribute exists and convert string to symbol for hash key
169
+ attributes = attributes.each_with_object({}) { |(k, v), h|
170
+ if (!self.class.attribute_map.key?(k.to_sym))
171
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpFileClient::PatchedfileFileGitRemote`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
172
+ end
173
+ h[k.to_sym] = v
174
+ }
175
+
176
+ if attributes.key?(:'name')
177
+ self.name = attributes[:'name']
178
+ end
179
+
180
+ if attributes.key?(:'url')
181
+ self.url = attributes[:'url']
182
+ end
183
+
184
+ if attributes.key?(:'pulp_labels')
185
+ if (value = attributes[:'pulp_labels']).is_a?(Hash)
186
+ self.pulp_labels = value
187
+ end
188
+ end
189
+
190
+ if attributes.key?(:'ca_cert')
191
+ self.ca_cert = attributes[:'ca_cert']
192
+ end
193
+
194
+ if attributes.key?(:'client_cert')
195
+ self.client_cert = attributes[:'client_cert']
196
+ end
197
+
198
+ if attributes.key?(:'client_key')
199
+ self.client_key = attributes[:'client_key']
200
+ end
201
+
202
+ if attributes.key?(:'tls_validation')
203
+ self.tls_validation = attributes[:'tls_validation']
204
+ end
205
+
206
+ if attributes.key?(:'proxy_url')
207
+ self.proxy_url = attributes[:'proxy_url']
208
+ end
209
+
210
+ if attributes.key?(:'proxy_username')
211
+ self.proxy_username = attributes[:'proxy_username']
212
+ end
213
+
214
+ if attributes.key?(:'proxy_password')
215
+ self.proxy_password = attributes[:'proxy_password']
216
+ end
217
+
218
+ if attributes.key?(:'username')
219
+ self.username = attributes[:'username']
220
+ end
221
+
222
+ if attributes.key?(:'password')
223
+ self.password = attributes[:'password']
224
+ end
225
+
226
+ if attributes.key?(:'max_retries')
227
+ self.max_retries = attributes[:'max_retries']
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?(:'download_concurrency')
253
+ self.download_concurrency = attributes[:'download_concurrency']
254
+ end
255
+
256
+ if attributes.key?(:'rate_limit')
257
+ self.rate_limit = attributes[:'rate_limit']
258
+ end
259
+
260
+ if attributes.key?(:'git_ref')
261
+ self.git_ref = attributes[:'git_ref']
262
+ else
263
+ self.git_ref = 'HEAD'
264
+ end
265
+ end
266
+
267
+ # Show invalid properties with the reasons. Usually used together with valid?
268
+ # @return Array for valid properties with the reasons
269
+ def list_invalid_properties
270
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
271
+ invalid_properties = Array.new
272
+ if !@name.nil? && @name.to_s.length < 1
273
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
274
+ end
275
+
276
+ if !@url.nil? && @url.to_s.length < 1
277
+ invalid_properties.push('invalid value for "url", the character length must be great than or equal to 1.')
278
+ end
279
+
280
+ if !@ca_cert.nil? && @ca_cert.to_s.length < 1
281
+ invalid_properties.push('invalid value for "ca_cert", the character length must be great than or equal to 1.')
282
+ end
283
+
284
+ if !@client_cert.nil? && @client_cert.to_s.length < 1
285
+ invalid_properties.push('invalid value for "client_cert", the character length must be great than or equal to 1.')
286
+ end
287
+
288
+ if !@client_key.nil? && @client_key.to_s.length < 1
289
+ invalid_properties.push('invalid value for "client_key", the character length must be great than or equal to 1.')
290
+ end
291
+
292
+ if !@proxy_url.nil? && @proxy_url.to_s.length < 1
293
+ invalid_properties.push('invalid value for "proxy_url", the character length must be great than or equal to 1.')
294
+ end
295
+
296
+ if !@proxy_username.nil? && @proxy_username.to_s.length < 1
297
+ invalid_properties.push('invalid value for "proxy_username", the character length must be great than or equal to 1.')
298
+ end
299
+
300
+ if !@proxy_password.nil? && @proxy_password.to_s.length < 1
301
+ invalid_properties.push('invalid value for "proxy_password", the character length must be great than or equal to 1.')
302
+ end
303
+
304
+ if !@username.nil? && @username.to_s.length < 1
305
+ invalid_properties.push('invalid value for "username", the character length must be great than or equal to 1.')
306
+ end
307
+
308
+ if !@password.nil? && @password.to_s.length < 1
309
+ invalid_properties.push('invalid value for "password", the character length must be great than or equal to 1.')
310
+ end
311
+
312
+ if !@total_timeout.nil? && @total_timeout < 0.0
313
+ invalid_properties.push('invalid value for "total_timeout", must be greater than or equal to 0.0.')
314
+ end
315
+
316
+ if !@connect_timeout.nil? && @connect_timeout < 0.0
317
+ invalid_properties.push('invalid value for "connect_timeout", must be greater than or equal to 0.0.')
318
+ end
319
+
320
+ if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
321
+ invalid_properties.push('invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.')
322
+ end
323
+
324
+ if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
325
+ invalid_properties.push('invalid value for "sock_read_timeout", must be greater than or equal to 0.0.')
326
+ end
327
+
328
+ if !@download_concurrency.nil? && @download_concurrency < 1
329
+ invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
330
+ end
331
+
332
+ if !@git_ref.nil? && @git_ref.to_s.length < 1
333
+ invalid_properties.push('invalid value for "git_ref", the character length must be great than or equal to 1.')
334
+ end
335
+
336
+ invalid_properties
337
+ end
338
+
339
+ # Check to see if the all the properties in the model are valid
340
+ # @return true if the model is valid
341
+ def valid?
342
+ warn '[DEPRECATED] the `valid?` method is obsolete'
343
+ return false if !@name.nil? && @name.to_s.length < 1
344
+ return false if !@url.nil? && @url.to_s.length < 1
345
+ return false if !@ca_cert.nil? && @ca_cert.to_s.length < 1
346
+ return false if !@client_cert.nil? && @client_cert.to_s.length < 1
347
+ return false if !@client_key.nil? && @client_key.to_s.length < 1
348
+ return false if !@proxy_url.nil? && @proxy_url.to_s.length < 1
349
+ return false if !@proxy_username.nil? && @proxy_username.to_s.length < 1
350
+ return false if !@proxy_password.nil? && @proxy_password.to_s.length < 1
351
+ return false if !@username.nil? && @username.to_s.length < 1
352
+ return false if !@password.nil? && @password.to_s.length < 1
353
+ return false if !@total_timeout.nil? && @total_timeout < 0.0
354
+ return false if !@connect_timeout.nil? && @connect_timeout < 0.0
355
+ return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
356
+ return false if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
357
+ return false if !@download_concurrency.nil? && @download_concurrency < 1
358
+ return false if !@git_ref.nil? && @git_ref.to_s.length < 1
359
+ true
360
+ end
361
+
362
+ # Custom attribute writer method with validation
363
+ # @param [Object] name Value to be assigned
364
+ def name=(name)
365
+ if name.nil?
366
+ fail ArgumentError, 'name cannot be nil'
367
+ end
368
+
369
+ if name.to_s.length < 1
370
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
371
+ end
372
+
373
+ @name = name
374
+ end
375
+
376
+ # Custom attribute writer method with validation
377
+ # @param [Object] url Value to be assigned
378
+ def url=(url)
379
+ if url.nil?
380
+ fail ArgumentError, 'url cannot be nil'
381
+ end
382
+
383
+ if url.to_s.length < 1
384
+ fail ArgumentError, 'invalid value for "url", the character length must be great than or equal to 1.'
385
+ end
386
+
387
+ @url = url
388
+ end
389
+
390
+ # Custom attribute writer method with validation
391
+ # @param [Object] ca_cert Value to be assigned
392
+ def ca_cert=(ca_cert)
393
+ if !ca_cert.nil? && ca_cert.to_s.length < 1
394
+ fail ArgumentError, 'invalid value for "ca_cert", the character length must be great than or equal to 1.'
395
+ end
396
+
397
+ @ca_cert = ca_cert
398
+ end
399
+
400
+ # Custom attribute writer method with validation
401
+ # @param [Object] client_cert Value to be assigned
402
+ def client_cert=(client_cert)
403
+ if !client_cert.nil? && client_cert.to_s.length < 1
404
+ fail ArgumentError, 'invalid value for "client_cert", the character length must be great than or equal to 1.'
405
+ end
406
+
407
+ @client_cert = client_cert
408
+ end
409
+
410
+ # Custom attribute writer method with validation
411
+ # @param [Object] client_key Value to be assigned
412
+ def client_key=(client_key)
413
+ if !client_key.nil? && client_key.to_s.length < 1
414
+ fail ArgumentError, 'invalid value for "client_key", the character length must be great than or equal to 1.'
415
+ end
416
+
417
+ @client_key = client_key
418
+ end
419
+
420
+ # Custom attribute writer method with validation
421
+ # @param [Object] proxy_url Value to be assigned
422
+ def proxy_url=(proxy_url)
423
+ if !proxy_url.nil? && proxy_url.to_s.length < 1
424
+ fail ArgumentError, 'invalid value for "proxy_url", the character length must be great than or equal to 1.'
425
+ end
426
+
427
+ @proxy_url = proxy_url
428
+ end
429
+
430
+ # Custom attribute writer method with validation
431
+ # @param [Object] proxy_username Value to be assigned
432
+ def proxy_username=(proxy_username)
433
+ if !proxy_username.nil? && proxy_username.to_s.length < 1
434
+ fail ArgumentError, 'invalid value for "proxy_username", the character length must be great than or equal to 1.'
435
+ end
436
+
437
+ @proxy_username = proxy_username
438
+ end
439
+
440
+ # Custom attribute writer method with validation
441
+ # @param [Object] proxy_password Value to be assigned
442
+ def proxy_password=(proxy_password)
443
+ if !proxy_password.nil? && proxy_password.to_s.length < 1
444
+ fail ArgumentError, 'invalid value for "proxy_password", the character length must be great than or equal to 1.'
445
+ end
446
+
447
+ @proxy_password = proxy_password
448
+ end
449
+
450
+ # Custom attribute writer method with validation
451
+ # @param [Object] username Value to be assigned
452
+ def username=(username)
453
+ if !username.nil? && username.to_s.length < 1
454
+ fail ArgumentError, 'invalid value for "username", the character length must be great than or equal to 1.'
455
+ end
456
+
457
+ @username = username
458
+ end
459
+
460
+ # Custom attribute writer method with validation
461
+ # @param [Object] password Value to be assigned
462
+ def password=(password)
463
+ if !password.nil? && password.to_s.length < 1
464
+ fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 1.'
465
+ end
466
+
467
+ @password = password
468
+ end
469
+
470
+ # Custom attribute writer method with validation
471
+ # @param [Object] total_timeout Value to be assigned
472
+ def total_timeout=(total_timeout)
473
+ if !total_timeout.nil? && total_timeout < 0.0
474
+ fail ArgumentError, 'invalid value for "total_timeout", must be greater than or equal to 0.0.'
475
+ end
476
+
477
+ @total_timeout = total_timeout
478
+ end
479
+
480
+ # Custom attribute writer method with validation
481
+ # @param [Object] connect_timeout Value to be assigned
482
+ def connect_timeout=(connect_timeout)
483
+ if !connect_timeout.nil? && connect_timeout < 0.0
484
+ fail ArgumentError, 'invalid value for "connect_timeout", must be greater than or equal to 0.0.'
485
+ end
486
+
487
+ @connect_timeout = connect_timeout
488
+ end
489
+
490
+ # Custom attribute writer method with validation
491
+ # @param [Object] sock_connect_timeout Value to be assigned
492
+ def sock_connect_timeout=(sock_connect_timeout)
493
+ if !sock_connect_timeout.nil? && sock_connect_timeout < 0.0
494
+ fail ArgumentError, 'invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.'
495
+ end
496
+
497
+ @sock_connect_timeout = sock_connect_timeout
498
+ end
499
+
500
+ # Custom attribute writer method with validation
501
+ # @param [Object] sock_read_timeout Value to be assigned
502
+ def sock_read_timeout=(sock_read_timeout)
503
+ if !sock_read_timeout.nil? && sock_read_timeout < 0.0
504
+ fail ArgumentError, 'invalid value for "sock_read_timeout", must be greater than or equal to 0.0.'
505
+ end
506
+
507
+ @sock_read_timeout = sock_read_timeout
508
+ end
509
+
510
+ # Custom attribute writer method with validation
511
+ # @param [Object] download_concurrency Value to be assigned
512
+ def download_concurrency=(download_concurrency)
513
+ if !download_concurrency.nil? && download_concurrency < 1
514
+ fail ArgumentError, 'invalid value for "download_concurrency", must be greater than or equal to 1.'
515
+ end
516
+
517
+ @download_concurrency = download_concurrency
518
+ end
519
+
520
+ # Custom attribute writer method with validation
521
+ # @param [Object] git_ref Value to be assigned
522
+ def git_ref=(git_ref)
523
+ if git_ref.nil?
524
+ fail ArgumentError, 'git_ref cannot be nil'
525
+ end
526
+
527
+ if git_ref.to_s.length < 1
528
+ fail ArgumentError, 'invalid value for "git_ref", the character length must be great than or equal to 1.'
529
+ end
530
+
531
+ @git_ref = git_ref
532
+ end
533
+
534
+ # Checks equality by comparing each attribute.
535
+ # @param [Object] Object to be compared
536
+ def ==(o)
537
+ return true if self.equal?(o)
538
+ self.class == o.class &&
539
+ name == o.name &&
540
+ url == o.url &&
541
+ pulp_labels == o.pulp_labels &&
542
+ ca_cert == o.ca_cert &&
543
+ client_cert == o.client_cert &&
544
+ client_key == o.client_key &&
545
+ tls_validation == o.tls_validation &&
546
+ proxy_url == o.proxy_url &&
547
+ proxy_username == o.proxy_username &&
548
+ proxy_password == o.proxy_password &&
549
+ username == o.username &&
550
+ password == o.password &&
551
+ max_retries == o.max_retries &&
552
+ total_timeout == o.total_timeout &&
553
+ connect_timeout == o.connect_timeout &&
554
+ sock_connect_timeout == o.sock_connect_timeout &&
555
+ sock_read_timeout == o.sock_read_timeout &&
556
+ headers == o.headers &&
557
+ download_concurrency == o.download_concurrency &&
558
+ rate_limit == o.rate_limit &&
559
+ git_ref == o.git_ref
560
+ end
561
+
562
+ # @see the `==` method
563
+ # @param [Object] Object to be compared
564
+ def eql?(o)
565
+ self == o
566
+ end
567
+
568
+ # Calculates hash code according to all attributes.
569
+ # @return [Integer] Hash code
570
+ def hash
571
+ [name, url, pulp_labels, 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, git_ref].hash
572
+ end
573
+
574
+ # Builds the object from hash
575
+ # @param [Hash] attributes Model attributes in the form of hash
576
+ # @return [Object] Returns the model itself
577
+ def self.build_from_hash(attributes)
578
+ return nil unless attributes.is_a?(Hash)
579
+ attributes = attributes.transform_keys(&:to_sym)
580
+ transformed_hash = {}
581
+ openapi_types.each_pair do |key, type|
582
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
583
+ transformed_hash["#{key}"] = nil
584
+ elsif type =~ /\AArray<(.*)>/i
585
+ # check to ensure the input is an array given that the attribute
586
+ # is documented as an array but the input is not
587
+ if attributes[attribute_map[key]].is_a?(Array)
588
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
589
+ end
590
+ elsif !attributes[attribute_map[key]].nil?
591
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
592
+ end
593
+ end
594
+ new(transformed_hash)
595
+ end
596
+
597
+ # Deserializes the data based on type
598
+ # @param string type Data type
599
+ # @param string value Value to be deserialized
600
+ # @return [Object] Deserialized data
601
+ def self._deserialize(type, value)
602
+ case type.to_sym
603
+ when :Time
604
+ Time.parse(value)
605
+ when :Date
606
+ Date.parse(value)
607
+ when :String
608
+ value.to_s
609
+ when :Integer
610
+ value.to_i
611
+ when :Float
612
+ value.to_f
613
+ when :Boolean
614
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
615
+ true
616
+ else
617
+ false
618
+ end
619
+ when :Object
620
+ # generic object (usually a Hash), return directly
621
+ value
622
+ when /\AArray<(?<inner_type>.+)>\z/
623
+ inner_type = Regexp.last_match[:inner_type]
624
+ value.map { |v| _deserialize(inner_type, v) }
625
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
626
+ k_type = Regexp.last_match[:k_type]
627
+ v_type = Regexp.last_match[:v_type]
628
+ {}.tap do |hash|
629
+ value.each do |k, v|
630
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
631
+ end
632
+ end
633
+ else # model
634
+ # models (e.g. Pet) or oneOf
635
+ klass = PulpFileClient.const_get(type)
636
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
637
+ end
638
+ end
639
+
640
+ # Returns the string representation of the object
641
+ # @return [String] String presentation of the object
642
+ def to_s
643
+ to_hash.to_s
644
+ end
645
+
646
+ # to_body is an alias to to_hash (backward compatibility)
647
+ # @return [Hash] Returns the object in the form of hash
648
+ def to_body
649
+ to_hash
650
+ end
651
+
652
+ # Returns the object in the form of hash
653
+ # @return [Hash] Returns the object in the form of hash
654
+ def to_hash
655
+ hash = {}
656
+ self.class.attribute_map.each_pair do |attr, param|
657
+ value = self.send(attr)
658
+ if value.nil?
659
+ is_nullable = self.class.openapi_nullable.include?(attr)
660
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
661
+ end
662
+
663
+ hash[param] = _to_hash(value)
664
+ end
665
+ hash
666
+ end
667
+
668
+ # Outputs non-array value in the form of hash
669
+ # For object, use to_hash. Otherwise, just return the value
670
+ # @param [Object] value Any valid value
671
+ # @return [Hash] Returns the value in the form of hash
672
+ def _to_hash(value)
673
+ if value.is_a?(Array)
674
+ value.compact.map { |v| _to_hash(v) }
675
+ elsif value.is_a?(Hash)
676
+ {}.tap do |hash|
677
+ value.each { |k, v| hash[k] = _to_hash(v) }
678
+ end
679
+ elsif value.respond_to? :to_hash
680
+ value.to_hash
681
+ else
682
+ value
683
+ end
684
+ end
685
+
686
+ end
687
+
688
+ end