pulp_ansible_client 0.10.5 → 0.11.0

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