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