pulp_ansible_client 0.2.0b1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +79 -0
  4. data/README.md +150 -0
  5. data/Rakefile +10 -0
  6. data/docs/AnsibleCollectionsApi.md +66 -0
  7. data/docs/AnsibleDistribution.md +31 -0
  8. data/docs/AnsibleRemote.md +45 -0
  9. data/docs/AsyncOperationResponse.md +17 -0
  10. data/docs/Collection.md +41 -0
  11. data/docs/CollectionRemote.md +47 -0
  12. data/docs/ContentCollectionsApi.md +134 -0
  13. data/docs/ContentRolesApi.md +186 -0
  14. data/docs/DistributionsAnsibleApi.md +352 -0
  15. data/docs/GalaxyCollection.md +25 -0
  16. data/docs/GalaxyRole.md +21 -0
  17. data/docs/GalaxyRoleVersion.md +19 -0
  18. data/docs/InlineResponse200.md +23 -0
  19. data/docs/InlineResponse2001.md +23 -0
  20. data/docs/InlineResponse2002.md +23 -0
  21. data/docs/InlineResponse2003.md +23 -0
  22. data/docs/InlineResponse2004.md +23 -0
  23. data/docs/InlineResponse2005.md +23 -0
  24. data/docs/InlineResponse2006.md +23 -0
  25. data/docs/InlineResponse2007.md +23 -0
  26. data/docs/PulpAnsibleApiApi.md +60 -0
  27. data/docs/PulpAnsibleGalaxyApiCollectionsApi.md +113 -0
  28. data/docs/PulpAnsibleGalaxyApiRolesApi.md +67 -0
  29. data/docs/PulpAnsibleGalaxyApiV1VersionsApi.md +69 -0
  30. data/docs/PulpAnsibleGalaxyApiV2VersionsApi.md +67 -0
  31. data/docs/RemotesAnsibleApi.md +411 -0
  32. data/docs/RemotesCollectionApi.md +411 -0
  33. data/docs/RepositorySyncURL.md +19 -0
  34. data/docs/Role.md +29 -0
  35. data/git_push.sh +55 -0
  36. data/lib/pulp_ansible_client/api/ansible_collections_api.rb +94 -0
  37. data/lib/pulp_ansible_client/api/content_collections_api.rb +169 -0
  38. data/lib/pulp_ansible_client/api/content_roles_api.rb +228 -0
  39. data/lib/pulp_ansible_client/api/distributions_ansible_api.rb +430 -0
  40. data/lib/pulp_ansible_client/api/pulp_ansible_api_api.rb +80 -0
  41. data/lib/pulp_ansible_client/api/pulp_ansible_galaxy_api_collections_api.rb +140 -0
  42. data/lib/pulp_ansible_client/api/pulp_ansible_galaxy_api_roles_api.rb +88 -0
  43. data/lib/pulp_ansible_client/api/pulp_ansible_galaxy_api_v1_versions_api.rb +94 -0
  44. data/lib/pulp_ansible_client/api/pulp_ansible_galaxy_api_v2_versions_api.rb +88 -0
  45. data/lib/pulp_ansible_client/api/remotes_ansible_api.rb +504 -0
  46. data/lib/pulp_ansible_client/api/remotes_collection_api.rb +504 -0
  47. data/lib/pulp_ansible_client/api_client.rb +387 -0
  48. data/lib/pulp_ansible_client/api_error.rb +57 -0
  49. data/lib/pulp_ansible_client/configuration.rb +251 -0
  50. data/lib/pulp_ansible_client/models/ansible_distribution.rb +347 -0
  51. data/lib/pulp_ansible_client/models/ansible_remote.rb +539 -0
  52. data/lib/pulp_ansible_client/models/async_operation_response.rb +202 -0
  53. data/lib/pulp_ansible_client/models/collection.rb +494 -0
  54. data/lib/pulp_ansible_client/models/collection_remote.rb +572 -0
  55. data/lib/pulp_ansible_client/models/galaxy_collection.rb +304 -0
  56. data/lib/pulp_ansible_client/models/galaxy_role.rb +262 -0
  57. data/lib/pulp_ansible_client/models/galaxy_role_version.rb +229 -0
  58. data/lib/pulp_ansible_client/models/inline_response200.rb +235 -0
  59. data/lib/pulp_ansible_client/models/inline_response2001.rb +235 -0
  60. data/lib/pulp_ansible_client/models/inline_response2002.rb +235 -0
  61. data/lib/pulp_ansible_client/models/inline_response2003.rb +235 -0
  62. data/lib/pulp_ansible_client/models/inline_response2004.rb +235 -0
  63. data/lib/pulp_ansible_client/models/inline_response2005.rb +235 -0
  64. data/lib/pulp_ansible_client/models/inline_response2006.rb +235 -0
  65. data/lib/pulp_ansible_client/models/inline_response2007.rb +235 -0
  66. data/lib/pulp_ansible_client/models/repository_sync_url.rb +214 -0
  67. data/lib/pulp_ansible_client/models/role.rb +344 -0
  68. data/lib/pulp_ansible_client/version.rb +15 -0
  69. data/lib/pulp_ansible_client.rb +68 -0
  70. data/pulp_ansible_client.gemspec +45 -0
  71. data/spec/api/ansible_collections_api_spec.rb +48 -0
  72. data/spec/api/content_collections_api_spec.rb +67 -0
  73. data/spec/api/content_roles_api_spec.rb +78 -0
  74. data/spec/api/distributions_ansible_api_spec.rb +116 -0
  75. data/spec/api/pulp_ansible_api_api_spec.rb +46 -0
  76. data/spec/api/pulp_ansible_galaxy_api_collections_api_spec.rb +57 -0
  77. data/spec/api/pulp_ansible_galaxy_api_roles_api_spec.rb +48 -0
  78. data/spec/api/pulp_ansible_galaxy_api_v1_versions_api_spec.rb +49 -0
  79. data/spec/api/pulp_ansible_galaxy_api_v2_versions_api_spec.rb +48 -0
  80. data/spec/api/remotes_ansible_api_spec.rb +130 -0
  81. data/spec/api/remotes_collection_api_spec.rb +130 -0
  82. data/spec/api_client_spec.rb +226 -0
  83. data/spec/configuration_spec.rb +42 -0
  84. data/spec/models/ansible_distribution_spec.rb +83 -0
  85. data/spec/models/ansible_remote_spec.rb +129 -0
  86. data/spec/models/async_operation_response_spec.rb +41 -0
  87. data/spec/models/collection_remote_spec.rb +135 -0
  88. data/spec/models/collection_spec.rb +113 -0
  89. data/spec/models/galaxy_collection_spec.rb +65 -0
  90. data/spec/models/galaxy_role_spec.rb +53 -0
  91. data/spec/models/galaxy_role_version_spec.rb +47 -0
  92. data/spec/models/inline_response2001_spec.rb +59 -0
  93. data/spec/models/inline_response2002_spec.rb +59 -0
  94. data/spec/models/inline_response2003_spec.rb +59 -0
  95. data/spec/models/inline_response2004_spec.rb +59 -0
  96. data/spec/models/inline_response2005_spec.rb +59 -0
  97. data/spec/models/inline_response2006_spec.rb +59 -0
  98. data/spec/models/inline_response2007_spec.rb +59 -0
  99. data/spec/models/inline_response200_spec.rb +59 -0
  100. data/spec/models/repository_sync_url_spec.rb +47 -0
  101. data/spec/models/role_spec.rb +77 -0
  102. data/spec/spec_helper.rb +111 -0
  103. metadata +357 -0
@@ -0,0 +1,572 @@
1
+ =begin
2
+ #Pulp 3 API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: v3
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.0.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpAnsibleClient
16
+ class CollectionRemote
17
+ attr_accessor :_href
18
+
19
+ # Timestamp of creation.
20
+ attr_accessor :_created
21
+
22
+ attr_accessor :_type
23
+
24
+ # A unique name for this remote.
25
+ attr_accessor :name
26
+
27
+ # The URL of an external content source.
28
+ attr_accessor :url
29
+
30
+ # A string containing the PEM encoded CA certificate used to validate the server certificate presented by the remote server. All new line characters must be escaped. Returns SHA256 sum on GET.
31
+ attr_accessor :ssl_ca_certificate
32
+
33
+ # A string containing the PEM encoded client certificate used for authentication. All new line characters must be escaped. Returns SHA256 sum on GET.
34
+ attr_accessor :ssl_client_certificate
35
+
36
+ # A PEM encoded private key used for authentication. Returns SHA256 sum on GET.
37
+ attr_accessor :ssl_client_key
38
+
39
+ # If True, SSL peer validation must be performed.
40
+ attr_accessor :ssl_validation
41
+
42
+ # The proxy URL. Format: scheme://user:password@host:port
43
+ attr_accessor :proxy_url
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.
49
+ attr_accessor :password
50
+
51
+ # Timestamp of the most recent update of the remote.
52
+ attr_accessor :_last_updated
53
+
54
+ # Total number of simultaneous connections.
55
+ attr_accessor :download_concurrency
56
+
57
+ # The policy to use when downloading content.
58
+ attr_accessor :policy
59
+
60
+ attr_accessor :whitelist
61
+
62
+ class EnumAttributeValidator
63
+ attr_reader :datatype
64
+ attr_reader :allowable_values
65
+
66
+ def initialize(datatype, allowable_values)
67
+ @allowable_values = allowable_values.map do |value|
68
+ case datatype.to_s
69
+ when /Integer/i
70
+ value.to_i
71
+ when /Float/i
72
+ value.to_f
73
+ else
74
+ value
75
+ end
76
+ end
77
+ end
78
+
79
+ def valid?(value)
80
+ !value || allowable_values.include?(value)
81
+ end
82
+ end
83
+
84
+ # Attribute mapping from ruby-style variable name to JSON key.
85
+ def self.attribute_map
86
+ {
87
+ :'_href' => :'_href',
88
+ :'_created' => :'_created',
89
+ :'_type' => :'_type',
90
+ :'name' => :'name',
91
+ :'url' => :'url',
92
+ :'ssl_ca_certificate' => :'ssl_ca_certificate',
93
+ :'ssl_client_certificate' => :'ssl_client_certificate',
94
+ :'ssl_client_key' => :'ssl_client_key',
95
+ :'ssl_validation' => :'ssl_validation',
96
+ :'proxy_url' => :'proxy_url',
97
+ :'username' => :'username',
98
+ :'password' => :'password',
99
+ :'_last_updated' => :'_last_updated',
100
+ :'download_concurrency' => :'download_concurrency',
101
+ :'policy' => :'policy',
102
+ :'whitelist' => :'whitelist'
103
+ }
104
+ end
105
+
106
+ # Attribute type mapping.
107
+ def self.openapi_types
108
+ {
109
+ :'_href' => :'String',
110
+ :'_created' => :'DateTime',
111
+ :'_type' => :'String',
112
+ :'name' => :'String',
113
+ :'url' => :'String',
114
+ :'ssl_ca_certificate' => :'String',
115
+ :'ssl_client_certificate' => :'String',
116
+ :'ssl_client_key' => :'String',
117
+ :'ssl_validation' => :'Boolean',
118
+ :'proxy_url' => :'String',
119
+ :'username' => :'String',
120
+ :'password' => :'String',
121
+ :'_last_updated' => :'DateTime',
122
+ :'download_concurrency' => :'Integer',
123
+ :'policy' => :'String',
124
+ :'whitelist' => :'String'
125
+ }
126
+ end
127
+
128
+ # Initializes the object
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ def initialize(attributes = {})
131
+ if (!attributes.is_a?(Hash))
132
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpAnsibleClient::CollectionRemote` initialize method"
133
+ end
134
+
135
+ # check to see if the attribute exists and convert string to symbol for hash key
136
+ attributes = attributes.each_with_object({}) { |(k, v), h|
137
+ if (!self.class.attribute_map.key?(k.to_sym))
138
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpAnsibleClient::CollectionRemote`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
139
+ end
140
+ h[k.to_sym] = v
141
+ }
142
+
143
+ if attributes.key?(:'_href')
144
+ self._href = attributes[:'_href']
145
+ end
146
+
147
+ if attributes.key?(:'_created')
148
+ self._created = attributes[:'_created']
149
+ end
150
+
151
+ if attributes.key?(:'_type')
152
+ self._type = attributes[:'_type']
153
+ end
154
+
155
+ if attributes.key?(:'name')
156
+ self.name = attributes[:'name']
157
+ end
158
+
159
+ if attributes.key?(:'url')
160
+ self.url = attributes[:'url']
161
+ end
162
+
163
+ if attributes.key?(:'ssl_ca_certificate')
164
+ self.ssl_ca_certificate = attributes[:'ssl_ca_certificate']
165
+ end
166
+
167
+ if attributes.key?(:'ssl_client_certificate')
168
+ self.ssl_client_certificate = attributes[:'ssl_client_certificate']
169
+ end
170
+
171
+ if attributes.key?(:'ssl_client_key')
172
+ self.ssl_client_key = attributes[:'ssl_client_key']
173
+ end
174
+
175
+ if attributes.key?(:'ssl_validation')
176
+ self.ssl_validation = attributes[:'ssl_validation']
177
+ end
178
+
179
+ if attributes.key?(:'proxy_url')
180
+ self.proxy_url = attributes[:'proxy_url']
181
+ end
182
+
183
+ if attributes.key?(:'username')
184
+ self.username = attributes[:'username']
185
+ end
186
+
187
+ if attributes.key?(:'password')
188
+ self.password = attributes[:'password']
189
+ end
190
+
191
+ if attributes.key?(:'_last_updated')
192
+ self._last_updated = attributes[:'_last_updated']
193
+ end
194
+
195
+ if attributes.key?(:'download_concurrency')
196
+ self.download_concurrency = attributes[:'download_concurrency']
197
+ end
198
+
199
+ if attributes.key?(:'policy')
200
+ self.policy = attributes[:'policy']
201
+ else
202
+ self.policy = 'immediate'
203
+ end
204
+
205
+ if attributes.key?(:'whitelist')
206
+ self.whitelist = attributes[:'whitelist']
207
+ end
208
+ end
209
+
210
+ # Show invalid properties with the reasons. Usually used together with valid?
211
+ # @return Array for valid properties with the reasons
212
+ def list_invalid_properties
213
+ invalid_properties = Array.new
214
+ if !@_type.nil? && @_type.to_s.length < 1
215
+ invalid_properties.push('invalid value for "_type", the character length must be great than or equal to 1.')
216
+ end
217
+
218
+ if @name.nil?
219
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
220
+ end
221
+
222
+ if @name.to_s.length < 1
223
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
224
+ end
225
+
226
+ if @url.nil?
227
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
228
+ end
229
+
230
+ if @url.to_s.length < 1
231
+ invalid_properties.push('invalid value for "url", the character length must be great than or equal to 1.')
232
+ end
233
+
234
+ if !@ssl_ca_certificate.nil? && @ssl_ca_certificate.to_s.length < 1
235
+ invalid_properties.push('invalid value for "ssl_ca_certificate", the character length must be great than or equal to 1.')
236
+ end
237
+
238
+ if !@ssl_client_certificate.nil? && @ssl_client_certificate.to_s.length < 1
239
+ invalid_properties.push('invalid value for "ssl_client_certificate", the character length must be great than or equal to 1.')
240
+ end
241
+
242
+ if !@ssl_client_key.nil? && @ssl_client_key.to_s.length < 1
243
+ invalid_properties.push('invalid value for "ssl_client_key", the character length must be great than or equal to 1.')
244
+ end
245
+
246
+ if !@proxy_url.nil? && @proxy_url.to_s.length < 1
247
+ invalid_properties.push('invalid value for "proxy_url", the character length must be great than or equal to 1.')
248
+ end
249
+
250
+ if !@username.nil? && @username.to_s.length < 1
251
+ invalid_properties.push('invalid value for "username", the character length must be great than or equal to 1.')
252
+ end
253
+
254
+ if !@password.nil? && @password.to_s.length < 1
255
+ invalid_properties.push('invalid value for "password", the character length must be great than or equal to 1.')
256
+ end
257
+
258
+ if !@download_concurrency.nil? && @download_concurrency < 1
259
+ invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
260
+ end
261
+
262
+ if @whitelist.nil?
263
+ invalid_properties.push('invalid value for "whitelist", whitelist cannot be nil.')
264
+ end
265
+
266
+ if @whitelist.to_s.length < 1
267
+ invalid_properties.push('invalid value for "whitelist", the character length must be great than or equal to 1.')
268
+ end
269
+
270
+ invalid_properties
271
+ end
272
+
273
+ # Check to see if the all the properties in the model are valid
274
+ # @return true if the model is valid
275
+ def valid?
276
+ return false if !@_type.nil? && @_type.to_s.length < 1
277
+ return false if @name.nil?
278
+ return false if @name.to_s.length < 1
279
+ return false if @url.nil?
280
+ return false if @url.to_s.length < 1
281
+ return false if !@ssl_ca_certificate.nil? && @ssl_ca_certificate.to_s.length < 1
282
+ return false if !@ssl_client_certificate.nil? && @ssl_client_certificate.to_s.length < 1
283
+ return false if !@ssl_client_key.nil? && @ssl_client_key.to_s.length < 1
284
+ return false if !@proxy_url.nil? && @proxy_url.to_s.length < 1
285
+ return false if !@username.nil? && @username.to_s.length < 1
286
+ return false if !@password.nil? && @password.to_s.length < 1
287
+ return false if !@download_concurrency.nil? && @download_concurrency < 1
288
+ policy_validator = EnumAttributeValidator.new('String', ["immediate", "When syncing, download all metadata and content now."])
289
+ return false unless policy_validator.valid?(@policy)
290
+ return false if @whitelist.nil?
291
+ return false if @whitelist.to_s.length < 1
292
+ true
293
+ end
294
+
295
+ # Custom attribute writer method with validation
296
+ # @param [Object] _type Value to be assigned
297
+ def _type=(_type)
298
+ if !_type.nil? && _type.to_s.length < 1
299
+ fail ArgumentError, 'invalid value for "_type", the character length must be great than or equal to 1.'
300
+ end
301
+
302
+ @_type = _type
303
+ end
304
+
305
+ # Custom attribute writer method with validation
306
+ # @param [Object] name Value to be assigned
307
+ def name=(name)
308
+ if name.nil?
309
+ fail ArgumentError, 'name cannot be nil'
310
+ end
311
+
312
+ if name.to_s.length < 1
313
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
314
+ end
315
+
316
+ @name = name
317
+ end
318
+
319
+ # Custom attribute writer method with validation
320
+ # @param [Object] url Value to be assigned
321
+ def url=(url)
322
+ if url.nil?
323
+ fail ArgumentError, 'url cannot be nil'
324
+ end
325
+
326
+ if url.to_s.length < 1
327
+ fail ArgumentError, 'invalid value for "url", the character length must be great than or equal to 1.'
328
+ end
329
+
330
+ @url = url
331
+ end
332
+
333
+ # Custom attribute writer method with validation
334
+ # @param [Object] ssl_ca_certificate Value to be assigned
335
+ def ssl_ca_certificate=(ssl_ca_certificate)
336
+ if !ssl_ca_certificate.nil? && ssl_ca_certificate.to_s.length < 1
337
+ fail ArgumentError, 'invalid value for "ssl_ca_certificate", the character length must be great than or equal to 1.'
338
+ end
339
+
340
+ @ssl_ca_certificate = ssl_ca_certificate
341
+ end
342
+
343
+ # Custom attribute writer method with validation
344
+ # @param [Object] ssl_client_certificate Value to be assigned
345
+ def ssl_client_certificate=(ssl_client_certificate)
346
+ if !ssl_client_certificate.nil? && ssl_client_certificate.to_s.length < 1
347
+ fail ArgumentError, 'invalid value for "ssl_client_certificate", the character length must be great than or equal to 1.'
348
+ end
349
+
350
+ @ssl_client_certificate = ssl_client_certificate
351
+ end
352
+
353
+ # Custom attribute writer method with validation
354
+ # @param [Object] ssl_client_key Value to be assigned
355
+ def ssl_client_key=(ssl_client_key)
356
+ if !ssl_client_key.nil? && ssl_client_key.to_s.length < 1
357
+ fail ArgumentError, 'invalid value for "ssl_client_key", the character length must be great than or equal to 1.'
358
+ end
359
+
360
+ @ssl_client_key = ssl_client_key
361
+ end
362
+
363
+ # Custom attribute writer method with validation
364
+ # @param [Object] proxy_url Value to be assigned
365
+ def proxy_url=(proxy_url)
366
+ if !proxy_url.nil? && proxy_url.to_s.length < 1
367
+ fail ArgumentError, 'invalid value for "proxy_url", the character length must be great than or equal to 1.'
368
+ end
369
+
370
+ @proxy_url = proxy_url
371
+ end
372
+
373
+ # Custom attribute writer method with validation
374
+ # @param [Object] username Value to be assigned
375
+ def username=(username)
376
+ if !username.nil? && username.to_s.length < 1
377
+ fail ArgumentError, 'invalid value for "username", the character length must be great than or equal to 1.'
378
+ end
379
+
380
+ @username = username
381
+ end
382
+
383
+ # Custom attribute writer method with validation
384
+ # @param [Object] password Value to be assigned
385
+ def password=(password)
386
+ if !password.nil? && password.to_s.length < 1
387
+ fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 1.'
388
+ end
389
+
390
+ @password = password
391
+ end
392
+
393
+ # Custom attribute writer method with validation
394
+ # @param [Object] download_concurrency Value to be assigned
395
+ def download_concurrency=(download_concurrency)
396
+ if !download_concurrency.nil? && download_concurrency < 1
397
+ fail ArgumentError, 'invalid value for "download_concurrency", must be greater than or equal to 1.'
398
+ end
399
+
400
+ @download_concurrency = download_concurrency
401
+ end
402
+
403
+ # Custom attribute writer method checking allowed values (enum).
404
+ # @param [Object] policy Object to be assigned
405
+ def policy=(policy)
406
+ validator = EnumAttributeValidator.new('String', ["immediate", "When syncing, download all metadata and content now."])
407
+ unless validator.valid?(policy)
408
+ fail ArgumentError, "invalid value for \"policy\", must be one of #{validator.allowable_values}."
409
+ end
410
+ @policy = policy
411
+ end
412
+
413
+ # Custom attribute writer method with validation
414
+ # @param [Object] whitelist Value to be assigned
415
+ def whitelist=(whitelist)
416
+ if whitelist.nil?
417
+ fail ArgumentError, 'whitelist cannot be nil'
418
+ end
419
+
420
+ if whitelist.to_s.length < 1
421
+ fail ArgumentError, 'invalid value for "whitelist", the character length must be great than or equal to 1.'
422
+ end
423
+
424
+ @whitelist = whitelist
425
+ end
426
+
427
+ # Checks equality by comparing each attribute.
428
+ # @param [Object] Object to be compared
429
+ def ==(o)
430
+ return true if self.equal?(o)
431
+ self.class == o.class &&
432
+ _href == o._href &&
433
+ _created == o._created &&
434
+ _type == o._type &&
435
+ name == o.name &&
436
+ url == o.url &&
437
+ ssl_ca_certificate == o.ssl_ca_certificate &&
438
+ ssl_client_certificate == o.ssl_client_certificate &&
439
+ ssl_client_key == o.ssl_client_key &&
440
+ ssl_validation == o.ssl_validation &&
441
+ proxy_url == o.proxy_url &&
442
+ username == o.username &&
443
+ password == o.password &&
444
+ _last_updated == o._last_updated &&
445
+ download_concurrency == o.download_concurrency &&
446
+ policy == o.policy &&
447
+ whitelist == o.whitelist
448
+ end
449
+
450
+ # @see the `==` method
451
+ # @param [Object] Object to be compared
452
+ def eql?(o)
453
+ self == o
454
+ end
455
+
456
+ # Calculates hash code according to all attributes.
457
+ # @return [Integer] Hash code
458
+ def hash
459
+ [_href, _created, _type, name, url, ssl_ca_certificate, ssl_client_certificate, ssl_client_key, ssl_validation, proxy_url, username, password, _last_updated, download_concurrency, policy, whitelist].hash
460
+ end
461
+
462
+ # Builds the object from hash
463
+ # @param [Hash] attributes Model attributes in the form of hash
464
+ # @return [Object] Returns the model itself
465
+ def self.build_from_hash(attributes)
466
+ new.build_from_hash(attributes)
467
+ end
468
+
469
+ # Builds the object from hash
470
+ # @param [Hash] attributes Model attributes in the form of hash
471
+ # @return [Object] Returns the model itself
472
+ def build_from_hash(attributes)
473
+ return nil unless attributes.is_a?(Hash)
474
+ self.class.openapi_types.each_pair do |key, type|
475
+ if type =~ /\AArray<(.*)>/i
476
+ # check to ensure the input is an array given that the attribute
477
+ # is documented as an array but the input is not
478
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
479
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
480
+ end
481
+ elsif !attributes[self.class.attribute_map[key]].nil?
482
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
483
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
484
+ end
485
+
486
+ self
487
+ end
488
+
489
+ # Deserializes the data based on type
490
+ # @param string type Data type
491
+ # @param string value Value to be deserialized
492
+ # @return [Object] Deserialized data
493
+ def _deserialize(type, value)
494
+ case type.to_sym
495
+ when :DateTime
496
+ DateTime.parse(value)
497
+ when :Date
498
+ Date.parse(value)
499
+ when :String
500
+ value.to_s
501
+ when :Integer
502
+ value.to_i
503
+ when :Float
504
+ value.to_f
505
+ when :Boolean
506
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
507
+ true
508
+ else
509
+ false
510
+ end
511
+ when :Object
512
+ # generic object (usually a Hash), return directly
513
+ value
514
+ when /\AArray<(?<inner_type>.+)>\z/
515
+ inner_type = Regexp.last_match[:inner_type]
516
+ value.map { |v| _deserialize(inner_type, v) }
517
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
518
+ k_type = Regexp.last_match[:k_type]
519
+ v_type = Regexp.last_match[:v_type]
520
+ {}.tap do |hash|
521
+ value.each do |k, v|
522
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
523
+ end
524
+ end
525
+ else # model
526
+ PulpAnsibleClient.const_get(type).build_from_hash(value)
527
+ end
528
+ end
529
+
530
+ # Returns the string representation of the object
531
+ # @return [String] String presentation of the object
532
+ def to_s
533
+ to_hash.to_s
534
+ end
535
+
536
+ # to_body is an alias to to_hash (backward compatibility)
537
+ # @return [Hash] Returns the object in the form of hash
538
+ def to_body
539
+ to_hash
540
+ end
541
+
542
+ # Returns the object in the form of hash
543
+ # @return [Hash] Returns the object in the form of hash
544
+ def to_hash
545
+ hash = {}
546
+ self.class.attribute_map.each_pair do |attr, param|
547
+ value = self.send(attr)
548
+ next if value.nil?
549
+ hash[param] = _to_hash(value)
550
+ end
551
+ hash
552
+ end
553
+
554
+ # Outputs non-array value in the form of hash
555
+ # For object, use to_hash. Otherwise, just return the value
556
+ # @param [Object] value Any valid value
557
+ # @return [Hash] Returns the value in the form of hash
558
+ def _to_hash(value)
559
+ if value.is_a?(Array)
560
+ value.compact.map { |v| _to_hash(v) }
561
+ elsif value.is_a?(Hash)
562
+ {}.tap do |hash|
563
+ value.each { |k, v| hash[k] = _to_hash(v) }
564
+ end
565
+ elsif value.respond_to? :to_hash
566
+ value.to_hash
567
+ else
568
+ value
569
+ end
570
+ end
571
+ end
572
+ end