pulp_cookbook_client 0.1.0b9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +162 -0
  4. data/Rakefile +10 -0
  5. data/docs/AsyncOperationResponse.md +17 -0
  6. data/docs/ContentCookbooksApi.md +208 -0
  7. data/docs/ContentSummary.md +21 -0
  8. data/docs/ContentSummaryResponse.md +21 -0
  9. data/docs/CookbookCookbookDistribution.md +27 -0
  10. data/docs/CookbookCookbookDistributionResponse.md +33 -0
  11. data/docs/CookbookCookbookPackageContent.md +25 -0
  12. data/docs/CookbookCookbookPackageContentResponse.md +29 -0
  13. data/docs/CookbookCookbookPublication.md +19 -0
  14. data/docs/CookbookCookbookPublicationResponse.md +25 -0
  15. data/docs/CookbookCookbookRemote.md +59 -0
  16. data/docs/CookbookCookbookRemoteResponse.md +55 -0
  17. data/docs/CookbookCookbookRepository.md +25 -0
  18. data/docs/CookbookCookbookRepositoryResponse.md +33 -0
  19. data/docs/DistributionsCookbookApi.md +372 -0
  20. data/docs/PaginatedRepositoryVersionResponseList.md +23 -0
  21. data/docs/PaginatedcookbookCookbookDistributionResponseList.md +23 -0
  22. data/docs/PaginatedcookbookCookbookPackageContentResponseList.md +23 -0
  23. data/docs/PaginatedcookbookCookbookPublicationResponseList.md +23 -0
  24. data/docs/PaginatedcookbookCookbookRemoteResponseList.md +23 -0
  25. data/docs/PaginatedcookbookCookbookRepositoryResponseList.md +23 -0
  26. data/docs/PatchedcookbookCookbookDistribution.md +27 -0
  27. data/docs/PatchedcookbookCookbookRemote.md +59 -0
  28. data/docs/PatchedcookbookCookbookRepository.md +25 -0
  29. data/docs/PolicyEnum.md +16 -0
  30. data/docs/PublicationsCookbookApi.md +257 -0
  31. data/docs/RemotesCookbookApi.md +376 -0
  32. data/docs/RepositoriesCookbookApi.md +475 -0
  33. data/docs/RepositoriesCookbookVersionsApi.md +271 -0
  34. data/docs/RepositoryAddRemoveContent.md +21 -0
  35. data/docs/RepositorySyncURL.md +19 -0
  36. data/docs/RepositoryVersion.md +17 -0
  37. data/docs/RepositoryVersionResponse.md +27 -0
  38. data/git_push.sh +58 -0
  39. data/lib/pulp_cookbook_client/api/content_cookbooks_api.rb +264 -0
  40. data/lib/pulp_cookbook_client/api/distributions_cookbook_api.rb +457 -0
  41. data/lib/pulp_cookbook_client/api/publications_cookbook_api.rb +312 -0
  42. data/lib/pulp_cookbook_client/api/remotes_cookbook_api.rb +463 -0
  43. data/lib/pulp_cookbook_client/api/repositories_cookbook_api.rb +583 -0
  44. data/lib/pulp_cookbook_client/api/repositories_cookbook_versions_api.rb +339 -0
  45. data/lib/pulp_cookbook_client/api_client.rb +406 -0
  46. data/lib/pulp_cookbook_client/api_error.rb +57 -0
  47. data/lib/pulp_cookbook_client/configuration.rb +250 -0
  48. data/lib/pulp_cookbook_client/models/async_operation_response.rb +213 -0
  49. data/lib/pulp_cookbook_client/models/content_summary.rb +246 -0
  50. data/lib/pulp_cookbook_client/models/content_summary_response.rb +246 -0
  51. data/lib/pulp_cookbook_client/models/cookbook_cookbook_distribution.rb +308 -0
  52. data/lib/pulp_cookbook_client/models/cookbook_cookbook_distribution_response.rb +299 -0
  53. data/lib/pulp_cookbook_client/models/cookbook_cookbook_package_content.rb +287 -0
  54. data/lib/pulp_cookbook_client/models/cookbook_cookbook_package_content_response.rb +272 -0
  55. data/lib/pulp_cookbook_client/models/cookbook_cookbook_publication.rb +217 -0
  56. data/lib/pulp_cookbook_client/models/cookbook_cookbook_publication_response.rb +248 -0
  57. data/lib/pulp_cookbook_client/models/cookbook_cookbook_remote.rb +677 -0
  58. data/lib/pulp_cookbook_client/models/cookbook_cookbook_remote_response.rb +493 -0
  59. data/lib/pulp_cookbook_client/models/cookbook_cookbook_repository.rb +304 -0
  60. data/lib/pulp_cookbook_client/models/cookbook_cookbook_repository_response.rb +307 -0
  61. data/lib/pulp_cookbook_client/models/paginated_repository_version_response_list.rb +237 -0
  62. data/lib/pulp_cookbook_client/models/paginatedcookbook_cookbook_distribution_response_list.rb +237 -0
  63. data/lib/pulp_cookbook_client/models/paginatedcookbook_cookbook_package_content_response_list.rb +237 -0
  64. data/lib/pulp_cookbook_client/models/paginatedcookbook_cookbook_publication_response_list.rb +237 -0
  65. data/lib/pulp_cookbook_client/models/paginatedcookbook_cookbook_remote_response_list.rb +237 -0
  66. data/lib/pulp_cookbook_client/models/paginatedcookbook_cookbook_repository_response_list.rb +237 -0
  67. data/lib/pulp_cookbook_client/models/patchedcookbook_cookbook_distribution.rb +290 -0
  68. data/lib/pulp_cookbook_client/models/patchedcookbook_cookbook_remote.rb +659 -0
  69. data/lib/pulp_cookbook_client/models/patchedcookbook_cookbook_repository.rb +295 -0
  70. data/lib/pulp_cookbook_client/models/policy_enum.rb +37 -0
  71. data/lib/pulp_cookbook_client/models/repository_add_remove_content.rb +232 -0
  72. data/lib/pulp_cookbook_client/models/repository_sync_url.rb +220 -0
  73. data/lib/pulp_cookbook_client/models/repository_version.rb +208 -0
  74. data/lib/pulp_cookbook_client/models/repository_version_response.rb +255 -0
  75. data/lib/pulp_cookbook_client/version.rb +15 -0
  76. data/lib/pulp_cookbook_client.rb +72 -0
  77. data/pulp_cookbook_client.gemspec +39 -0
  78. data/spec/api/content_cookbooks_api_spec.rb +87 -0
  79. data/spec/api/distributions_cookbook_api_spec.rb +125 -0
  80. data/spec/api/publications_cookbook_api_spec.rb +98 -0
  81. data/spec/api/remotes_cookbook_api_spec.rb +127 -0
  82. data/spec/api/repositories_cookbook_api_spec.rb +146 -0
  83. data/spec/api/repositories_cookbook_versions_api_spec.rb +104 -0
  84. data/spec/api_client_spec.rb +188 -0
  85. data/spec/configuration_spec.rb +42 -0
  86. data/spec/models/async_operation_response_spec.rb +41 -0
  87. data/spec/models/content_summary_response_spec.rb +53 -0
  88. data/spec/models/content_summary_spec.rb +53 -0
  89. data/spec/models/cookbook_cookbook_distribution_response_spec.rb +89 -0
  90. data/spec/models/cookbook_cookbook_distribution_spec.rb +71 -0
  91. data/spec/models/cookbook_cookbook_package_content_response_spec.rb +77 -0
  92. data/spec/models/cookbook_cookbook_package_content_spec.rb +65 -0
  93. data/spec/models/cookbook_cookbook_publication_response_spec.rb +65 -0
  94. data/spec/models/cookbook_cookbook_publication_spec.rb +47 -0
  95. data/spec/models/cookbook_cookbook_remote_response_spec.rb +155 -0
  96. data/spec/models/cookbook_cookbook_remote_spec.rb +167 -0
  97. data/spec/models/cookbook_cookbook_repository_response_spec.rb +89 -0
  98. data/spec/models/cookbook_cookbook_repository_spec.rb +65 -0
  99. data/spec/models/paginated_repository_version_response_list_spec.rb +59 -0
  100. data/spec/models/paginatedcookbook_cookbook_distribution_response_list_spec.rb +59 -0
  101. data/spec/models/paginatedcookbook_cookbook_package_content_response_list_spec.rb +59 -0
  102. data/spec/models/paginatedcookbook_cookbook_publication_response_list_spec.rb +59 -0
  103. data/spec/models/paginatedcookbook_cookbook_remote_response_list_spec.rb +59 -0
  104. data/spec/models/paginatedcookbook_cookbook_repository_response_list_spec.rb +59 -0
  105. data/spec/models/patchedcookbook_cookbook_distribution_spec.rb +71 -0
  106. data/spec/models/patchedcookbook_cookbook_remote_spec.rb +167 -0
  107. data/spec/models/patchedcookbook_cookbook_repository_spec.rb +65 -0
  108. data/spec/models/policy_enum_spec.rb +35 -0
  109. data/spec/models/repository_add_remove_content_spec.rb +53 -0
  110. data/spec/models/repository_sync_url_spec.rb +47 -0
  111. data/spec/models/repository_version_response_spec.rb +71 -0
  112. data/spec/models/repository_version_spec.rb +41 -0
  113. data/spec/spec_helper.rb +111 -0
  114. metadata +251 -0
@@ -0,0 +1,677 @@
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 PulpCookbookClient
16
+ # Serializer for the remote pointing to a universe repo.
17
+ class CookbookCookbookRemote
18
+ # A unique name for this remote.
19
+ attr_accessor :name
20
+
21
+ # The URL of an external content source.
22
+ attr_accessor :url
23
+
24
+ # A PEM encoded CA certificate used to validate the server certificate presented by the remote server.
25
+ attr_accessor :ca_cert
26
+
27
+ # A PEM encoded client certificate used for authentication.
28
+ attr_accessor :client_cert
29
+
30
+ # A PEM encoded private key used for authentication.
31
+ attr_accessor :client_key
32
+
33
+ # If True, TLS peer validation must be performed.
34
+ attr_accessor :tls_validation
35
+
36
+ # The proxy URL. Format: scheme://host:port
37
+ attr_accessor :proxy_url
38
+
39
+ # The username to authenticte to the proxy.
40
+ attr_accessor :proxy_username
41
+
42
+ # The password to authenticte to the proxy.
43
+ attr_accessor :proxy_password
44
+
45
+ # The username to be used for authentication when syncing.
46
+ attr_accessor :username
47
+
48
+ # The password to be used for authentication when syncing.
49
+ attr_accessor :password
50
+
51
+ attr_accessor :pulp_labels
52
+
53
+ # Total number of simultaneous connections. If not set then the default value will be used.
54
+ attr_accessor :download_concurrency
55
+
56
+ # Maximum number of retry attempts after a download failure. If not set then the default value (3) will be used.
57
+ attr_accessor :max_retries
58
+
59
+ # The policy to use when downloading content. The possible values include: 'immediate', 'on_demand', and 'streamed'. 'immediate' is the default.
60
+ attr_accessor :policy
61
+
62
+ # aiohttp.ClientTimeout.total (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
63
+ attr_accessor :total_timeout
64
+
65
+ # aiohttp.ClientTimeout.connect (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
66
+ attr_accessor :connect_timeout
67
+
68
+ # aiohttp.ClientTimeout.sock_connect (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
69
+ attr_accessor :sock_connect_timeout
70
+
71
+ # aiohttp.ClientTimeout.sock_read (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
72
+ attr_accessor :sock_read_timeout
73
+
74
+ # Headers for aiohttp.Clientsession
75
+ attr_accessor :headers
76
+
77
+ # Limits requests per second for each concurrent downloader
78
+ attr_accessor :rate_limit
79
+
80
+ # An optional JSON object in the format {\"<cookbook name>\": \"<version_string>\" }. Used to limit the cookbooks to synchronize from the remote
81
+ attr_accessor :cookbooks
82
+
83
+ # Attribute mapping from ruby-style variable name to JSON key.
84
+ def self.attribute_map
85
+ {
86
+ :'name' => :'name',
87
+ :'url' => :'url',
88
+ :'ca_cert' => :'ca_cert',
89
+ :'client_cert' => :'client_cert',
90
+ :'client_key' => :'client_key',
91
+ :'tls_validation' => :'tls_validation',
92
+ :'proxy_url' => :'proxy_url',
93
+ :'proxy_username' => :'proxy_username',
94
+ :'proxy_password' => :'proxy_password',
95
+ :'username' => :'username',
96
+ :'password' => :'password',
97
+ :'pulp_labels' => :'pulp_labels',
98
+ :'download_concurrency' => :'download_concurrency',
99
+ :'max_retries' => :'max_retries',
100
+ :'policy' => :'policy',
101
+ :'total_timeout' => :'total_timeout',
102
+ :'connect_timeout' => :'connect_timeout',
103
+ :'sock_connect_timeout' => :'sock_connect_timeout',
104
+ :'sock_read_timeout' => :'sock_read_timeout',
105
+ :'headers' => :'headers',
106
+ :'rate_limit' => :'rate_limit',
107
+ :'cookbooks' => :'cookbooks'
108
+ }
109
+ end
110
+
111
+ # Attribute type mapping.
112
+ def self.openapi_types
113
+ {
114
+ :'name' => :'String',
115
+ :'url' => :'String',
116
+ :'ca_cert' => :'String',
117
+ :'client_cert' => :'String',
118
+ :'client_key' => :'String',
119
+ :'tls_validation' => :'Boolean',
120
+ :'proxy_url' => :'String',
121
+ :'proxy_username' => :'String',
122
+ :'proxy_password' => :'String',
123
+ :'username' => :'String',
124
+ :'password' => :'String',
125
+ :'pulp_labels' => :'Object',
126
+ :'download_concurrency' => :'Integer',
127
+ :'max_retries' => :'Integer',
128
+ :'policy' => :'PolicyEnum',
129
+ :'total_timeout' => :'Float',
130
+ :'connect_timeout' => :'Float',
131
+ :'sock_connect_timeout' => :'Float',
132
+ :'sock_read_timeout' => :'Float',
133
+ :'headers' => :'Array<Object>',
134
+ :'rate_limit' => :'Integer',
135
+ :'cookbooks' => :'Object'
136
+ }
137
+ end
138
+
139
+ # List of attributes with nullable: true
140
+ def self.openapi_nullable
141
+ Set.new([
142
+ :'ca_cert',
143
+ :'client_cert',
144
+ :'client_key',
145
+ :'proxy_url',
146
+ :'proxy_username',
147
+ :'proxy_password',
148
+ :'username',
149
+ :'password',
150
+ :'download_concurrency',
151
+ :'max_retries',
152
+ :'total_timeout',
153
+ :'connect_timeout',
154
+ :'sock_connect_timeout',
155
+ :'sock_read_timeout',
156
+ :'rate_limit',
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 `PulpCookbookClient::CookbookCookbookRemote` 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 `PulpCookbookClient::CookbookCookbookRemote`. 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?(:'name')
176
+ self.name = attributes[:'name']
177
+ end
178
+
179
+ if attributes.key?(:'url')
180
+ self.url = attributes[:'url']
181
+ end
182
+
183
+ if attributes.key?(:'ca_cert')
184
+ self.ca_cert = attributes[:'ca_cert']
185
+ end
186
+
187
+ if attributes.key?(:'client_cert')
188
+ self.client_cert = attributes[:'client_cert']
189
+ end
190
+
191
+ if attributes.key?(:'client_key')
192
+ self.client_key = attributes[:'client_key']
193
+ end
194
+
195
+ if attributes.key?(:'tls_validation')
196
+ self.tls_validation = attributes[:'tls_validation']
197
+ end
198
+
199
+ if attributes.key?(:'proxy_url')
200
+ self.proxy_url = attributes[:'proxy_url']
201
+ end
202
+
203
+ if attributes.key?(:'proxy_username')
204
+ self.proxy_username = attributes[:'proxy_username']
205
+ end
206
+
207
+ if attributes.key?(:'proxy_password')
208
+ self.proxy_password = attributes[:'proxy_password']
209
+ end
210
+
211
+ if attributes.key?(:'username')
212
+ self.username = attributes[:'username']
213
+ end
214
+
215
+ if attributes.key?(:'password')
216
+ self.password = attributes[:'password']
217
+ end
218
+
219
+ if attributes.key?(:'pulp_labels')
220
+ self.pulp_labels = attributes[:'pulp_labels']
221
+ end
222
+
223
+ if attributes.key?(:'download_concurrency')
224
+ self.download_concurrency = attributes[:'download_concurrency']
225
+ end
226
+
227
+ if attributes.key?(:'max_retries')
228
+ self.max_retries = attributes[:'max_retries']
229
+ end
230
+
231
+ if attributes.key?(:'policy')
232
+ self.policy = attributes[:'policy']
233
+ end
234
+
235
+ if attributes.key?(:'total_timeout')
236
+ self.total_timeout = attributes[:'total_timeout']
237
+ end
238
+
239
+ if attributes.key?(:'connect_timeout')
240
+ self.connect_timeout = attributes[:'connect_timeout']
241
+ end
242
+
243
+ if attributes.key?(:'sock_connect_timeout')
244
+ self.sock_connect_timeout = attributes[:'sock_connect_timeout']
245
+ end
246
+
247
+ if attributes.key?(:'sock_read_timeout')
248
+ self.sock_read_timeout = attributes[:'sock_read_timeout']
249
+ end
250
+
251
+ if attributes.key?(:'headers')
252
+ if (value = attributes[:'headers']).is_a?(Array)
253
+ self.headers = value
254
+ end
255
+ end
256
+
257
+ if attributes.key?(:'rate_limit')
258
+ self.rate_limit = attributes[:'rate_limit']
259
+ end
260
+
261
+ if attributes.key?(:'cookbooks')
262
+ self.cookbooks = attributes[:'cookbooks']
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 @name.nil?
271
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
272
+ end
273
+
274
+ if @name.to_s.length < 1
275
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
276
+ end
277
+
278
+ if @url.nil?
279
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
280
+ end
281
+
282
+ if @url.to_s.length < 1
283
+ invalid_properties.push('invalid value for "url", the character length must be great than or equal to 1.')
284
+ end
285
+
286
+ if !@ca_cert.nil? && @ca_cert.to_s.length < 1
287
+ invalid_properties.push('invalid value for "ca_cert", the character length must be great than or equal to 1.')
288
+ end
289
+
290
+ if !@client_cert.nil? && @client_cert.to_s.length < 1
291
+ invalid_properties.push('invalid value for "client_cert", the character length must be great than or equal to 1.')
292
+ end
293
+
294
+ if !@client_key.nil? && @client_key.to_s.length < 1
295
+ invalid_properties.push('invalid value for "client_key", the character length must be great than or equal to 1.')
296
+ end
297
+
298
+ if !@proxy_url.nil? && @proxy_url.to_s.length < 1
299
+ invalid_properties.push('invalid value for "proxy_url", the character length must be great than or equal to 1.')
300
+ end
301
+
302
+ if !@proxy_username.nil? && @proxy_username.to_s.length < 1
303
+ invalid_properties.push('invalid value for "proxy_username", 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 !@username.nil? && @username.to_s.length < 1
311
+ invalid_properties.push('invalid value for "username", the character length must be great than or equal to 1.')
312
+ end
313
+
314
+ if !@password.nil? && @password.to_s.length < 1
315
+ invalid_properties.push('invalid value for "password", the character length must be great than or equal to 1.')
316
+ end
317
+
318
+ if !@download_concurrency.nil? && @download_concurrency < 1
319
+ invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
320
+ end
321
+
322
+ if !@total_timeout.nil? && @total_timeout < 0.0
323
+ invalid_properties.push('invalid value for "total_timeout", must be greater than or equal to 0.0.')
324
+ end
325
+
326
+ if !@connect_timeout.nil? && @connect_timeout < 0.0
327
+ invalid_properties.push('invalid value for "connect_timeout", must be greater than or equal to 0.0.')
328
+ end
329
+
330
+ if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
331
+ invalid_properties.push('invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.')
332
+ end
333
+
334
+ if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
335
+ invalid_properties.push('invalid value for "sock_read_timeout", must be greater than or equal to 0.0.')
336
+ end
337
+
338
+ invalid_properties
339
+ end
340
+
341
+ # Check to see if the all the properties in the model are valid
342
+ # @return true if the model is valid
343
+ def valid?
344
+ return false if @name.nil?
345
+ return false if @name.to_s.length < 1
346
+ return false if @url.nil?
347
+ return false if @url.to_s.length < 1
348
+ return false if !@ca_cert.nil? && @ca_cert.to_s.length < 1
349
+ return false if !@client_cert.nil? && @client_cert.to_s.length < 1
350
+ return false if !@client_key.nil? && @client_key.to_s.length < 1
351
+ return false if !@proxy_url.nil? && @proxy_url.to_s.length < 1
352
+ return false if !@proxy_username.nil? && @proxy_username.to_s.length < 1
353
+ return false if !@proxy_password.nil? && @proxy_password.to_s.length < 1
354
+ return false if !@username.nil? && @username.to_s.length < 1
355
+ return false if !@password.nil? && @password.to_s.length < 1
356
+ return false if !@download_concurrency.nil? && @download_concurrency < 1
357
+ return false if !@total_timeout.nil? && @total_timeout < 0.0
358
+ return false if !@connect_timeout.nil? && @connect_timeout < 0.0
359
+ return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
360
+ return false if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
361
+ true
362
+ end
363
+
364
+ # Custom attribute writer method with validation
365
+ # @param [Object] name Value to be assigned
366
+ def name=(name)
367
+ if name.nil?
368
+ fail ArgumentError, 'name cannot be nil'
369
+ end
370
+
371
+ if name.to_s.length < 1
372
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
373
+ end
374
+
375
+ @name = name
376
+ end
377
+
378
+ # Custom attribute writer method with validation
379
+ # @param [Object] url Value to be assigned
380
+ def url=(url)
381
+ if url.nil?
382
+ fail ArgumentError, 'url cannot be nil'
383
+ end
384
+
385
+ if url.to_s.length < 1
386
+ fail ArgumentError, 'invalid value for "url", the character length must be great than or equal to 1.'
387
+ end
388
+
389
+ @url = url
390
+ end
391
+
392
+ # Custom attribute writer method with validation
393
+ # @param [Object] ca_cert Value to be assigned
394
+ def ca_cert=(ca_cert)
395
+ if !ca_cert.nil? && ca_cert.to_s.length < 1
396
+ fail ArgumentError, 'invalid value for "ca_cert", the character length must be great than or equal to 1.'
397
+ end
398
+
399
+ @ca_cert = ca_cert
400
+ end
401
+
402
+ # Custom attribute writer method with validation
403
+ # @param [Object] client_cert Value to be assigned
404
+ def client_cert=(client_cert)
405
+ if !client_cert.nil? && client_cert.to_s.length < 1
406
+ fail ArgumentError, 'invalid value for "client_cert", the character length must be great than or equal to 1.'
407
+ end
408
+
409
+ @client_cert = client_cert
410
+ end
411
+
412
+ # Custom attribute writer method with validation
413
+ # @param [Object] client_key Value to be assigned
414
+ def client_key=(client_key)
415
+ if !client_key.nil? && client_key.to_s.length < 1
416
+ fail ArgumentError, 'invalid value for "client_key", the character length must be great than or equal to 1.'
417
+ end
418
+
419
+ @client_key = client_key
420
+ end
421
+
422
+ # Custom attribute writer method with validation
423
+ # @param [Object] proxy_url Value to be assigned
424
+ def proxy_url=(proxy_url)
425
+ if !proxy_url.nil? && proxy_url.to_s.length < 1
426
+ fail ArgumentError, 'invalid value for "proxy_url", the character length must be great than or equal to 1.'
427
+ end
428
+
429
+ @proxy_url = proxy_url
430
+ end
431
+
432
+ # Custom attribute writer method with validation
433
+ # @param [Object] proxy_username Value to be assigned
434
+ def proxy_username=(proxy_username)
435
+ if !proxy_username.nil? && proxy_username.to_s.length < 1
436
+ fail ArgumentError, 'invalid value for "proxy_username", the character length must be great than or equal to 1.'
437
+ end
438
+
439
+ @proxy_username = proxy_username
440
+ end
441
+
442
+ # Custom attribute writer method with validation
443
+ # @param [Object] proxy_password Value to be assigned
444
+ def proxy_password=(proxy_password)
445
+ if !proxy_password.nil? && proxy_password.to_s.length < 1
446
+ fail ArgumentError, 'invalid value for "proxy_password", the character length must be great than or equal to 1.'
447
+ end
448
+
449
+ @proxy_password = proxy_password
450
+ end
451
+
452
+ # Custom attribute writer method with validation
453
+ # @param [Object] username Value to be assigned
454
+ def username=(username)
455
+ if !username.nil? && username.to_s.length < 1
456
+ fail ArgumentError, 'invalid value for "username", the character length must be great than or equal to 1.'
457
+ end
458
+
459
+ @username = username
460
+ end
461
+
462
+ # Custom attribute writer method with validation
463
+ # @param [Object] password Value to be assigned
464
+ def password=(password)
465
+ if !password.nil? && password.to_s.length < 1
466
+ fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 1.'
467
+ end
468
+
469
+ @password = password
470
+ end
471
+
472
+ # Custom attribute writer method with validation
473
+ # @param [Object] download_concurrency Value to be assigned
474
+ def download_concurrency=(download_concurrency)
475
+ if !download_concurrency.nil? && download_concurrency < 1
476
+ fail ArgumentError, 'invalid value for "download_concurrency", must be greater than or equal to 1.'
477
+ end
478
+
479
+ @download_concurrency = download_concurrency
480
+ end
481
+
482
+ # Custom attribute writer method with validation
483
+ # @param [Object] total_timeout Value to be assigned
484
+ def total_timeout=(total_timeout)
485
+ if !total_timeout.nil? && total_timeout < 0.0
486
+ fail ArgumentError, 'invalid value for "total_timeout", must be greater than or equal to 0.0.'
487
+ end
488
+
489
+ @total_timeout = total_timeout
490
+ end
491
+
492
+ # Custom attribute writer method with validation
493
+ # @param [Object] connect_timeout Value to be assigned
494
+ def connect_timeout=(connect_timeout)
495
+ if !connect_timeout.nil? && connect_timeout < 0.0
496
+ fail ArgumentError, 'invalid value for "connect_timeout", must be greater than or equal to 0.0.'
497
+ end
498
+
499
+ @connect_timeout = connect_timeout
500
+ end
501
+
502
+ # Custom attribute writer method with validation
503
+ # @param [Object] sock_connect_timeout Value to be assigned
504
+ def sock_connect_timeout=(sock_connect_timeout)
505
+ if !sock_connect_timeout.nil? && sock_connect_timeout < 0.0
506
+ fail ArgumentError, 'invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.'
507
+ end
508
+
509
+ @sock_connect_timeout = sock_connect_timeout
510
+ end
511
+
512
+ # Custom attribute writer method with validation
513
+ # @param [Object] sock_read_timeout Value to be assigned
514
+ def sock_read_timeout=(sock_read_timeout)
515
+ if !sock_read_timeout.nil? && sock_read_timeout < 0.0
516
+ fail ArgumentError, 'invalid value for "sock_read_timeout", must be greater than or equal to 0.0.'
517
+ end
518
+
519
+ @sock_read_timeout = sock_read_timeout
520
+ end
521
+
522
+ # Checks equality by comparing each attribute.
523
+ # @param [Object] Object to be compared
524
+ def ==(o)
525
+ return true if self.equal?(o)
526
+ self.class == o.class &&
527
+ name == o.name &&
528
+ url == o.url &&
529
+ ca_cert == o.ca_cert &&
530
+ client_cert == o.client_cert &&
531
+ client_key == o.client_key &&
532
+ tls_validation == o.tls_validation &&
533
+ proxy_url == o.proxy_url &&
534
+ proxy_username == o.proxy_username &&
535
+ proxy_password == o.proxy_password &&
536
+ username == o.username &&
537
+ password == o.password &&
538
+ pulp_labels == o.pulp_labels &&
539
+ download_concurrency == o.download_concurrency &&
540
+ max_retries == o.max_retries &&
541
+ policy == o.policy &&
542
+ total_timeout == o.total_timeout &&
543
+ connect_timeout == o.connect_timeout &&
544
+ sock_connect_timeout == o.sock_connect_timeout &&
545
+ sock_read_timeout == o.sock_read_timeout &&
546
+ headers == o.headers &&
547
+ rate_limit == o.rate_limit &&
548
+ cookbooks == o.cookbooks
549
+ end
550
+
551
+ # @see the `==` method
552
+ # @param [Object] Object to be compared
553
+ def eql?(o)
554
+ self == o
555
+ end
556
+
557
+ # Calculates hash code according to all attributes.
558
+ # @return [Integer] Hash code
559
+ def hash
560
+ [name, url, ca_cert, client_cert, client_key, tls_validation, proxy_url, proxy_username, proxy_password, username, password, pulp_labels, download_concurrency, max_retries, policy, total_timeout, connect_timeout, sock_connect_timeout, sock_read_timeout, headers, rate_limit, cookbooks].hash
561
+ end
562
+
563
+ # Builds the object from hash
564
+ # @param [Hash] attributes Model attributes in the form of hash
565
+ # @return [Object] Returns the model itself
566
+ def self.build_from_hash(attributes)
567
+ new.build_from_hash(attributes)
568
+ end
569
+
570
+ # Builds the object from hash
571
+ # @param [Hash] attributes Model attributes in the form of hash
572
+ # @return [Object] Returns the model itself
573
+ def build_from_hash(attributes)
574
+ return nil unless attributes.is_a?(Hash)
575
+ self.class.openapi_types.each_pair do |key, type|
576
+ if type =~ /\AArray<(.*)>/i
577
+ # check to ensure the input is an array given that the attribute
578
+ # is documented as an array but the input is not
579
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
580
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
581
+ end
582
+ elsif !attributes[self.class.attribute_map[key]].nil?
583
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
584
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
585
+ end
586
+
587
+ self
588
+ end
589
+
590
+ # Deserializes the data based on type
591
+ # @param string type Data type
592
+ # @param string value Value to be deserialized
593
+ # @return [Object] Deserialized data
594
+ def _deserialize(type, value)
595
+ case type.to_sym
596
+ when :DateTime
597
+ DateTime.parse(value)
598
+ when :Date
599
+ Date.parse(value)
600
+ when :String
601
+ value.to_s
602
+ when :Integer
603
+ value.to_i
604
+ when :Float
605
+ value.to_f
606
+ when :Boolean
607
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
608
+ true
609
+ else
610
+ false
611
+ end
612
+ when :Object
613
+ # generic object (usually a Hash), return directly
614
+ value
615
+ when /\AArray<(?<inner_type>.+)>\z/
616
+ inner_type = Regexp.last_match[:inner_type]
617
+ value.map { |v| _deserialize(inner_type, v) }
618
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
619
+ k_type = Regexp.last_match[:k_type]
620
+ v_type = Regexp.last_match[:v_type]
621
+ {}.tap do |hash|
622
+ value.each do |k, v|
623
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
624
+ end
625
+ end
626
+ else # model
627
+ PulpCookbookClient.const_get(type).build_from_hash(value)
628
+ end
629
+ end
630
+
631
+ # Returns the string representation of the object
632
+ # @return [String] String presentation of the object
633
+ def to_s
634
+ to_hash.to_s
635
+ end
636
+
637
+ # to_body is an alias to to_hash (backward compatibility)
638
+ # @return [Hash] Returns the object in the form of hash
639
+ def to_body
640
+ to_hash
641
+ end
642
+
643
+ # Returns the object in the form of hash
644
+ # @return [Hash] Returns the object in the form of hash
645
+ def to_hash
646
+ hash = {}
647
+ self.class.attribute_map.each_pair do |attr, param|
648
+ value = self.send(attr)
649
+ if value.nil?
650
+ is_nullable = self.class.openapi_nullable.include?(attr)
651
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
652
+ end
653
+
654
+ hash[param] = _to_hash(value)
655
+ end
656
+ hash
657
+ end
658
+
659
+ # Outputs non-array value in the form of hash
660
+ # For object, use to_hash. Otherwise, just return the value
661
+ # @param [Object] value Any valid value
662
+ # @return [Hash] Returns the value in the form of hash
663
+ def _to_hash(value)
664
+ if value.is_a?(Array)
665
+ value.compact.map { |v| _to_hash(v) }
666
+ elsif value.is_a?(Hash)
667
+ {}.tap do |hash|
668
+ value.each { |k, v| hash[k] = _to_hash(v) }
669
+ end
670
+ elsif value.respond_to? :to_hash
671
+ value.to_hash
672
+ else
673
+ value
674
+ end
675
+ end
676
+ end
677
+ end