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