pulp_gem_client 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +160 -0
  4. data/Rakefile +10 -0
  5. data/docs/AsyncOperationResponse.md +17 -0
  6. data/docs/ContentGemApi.md +210 -0
  7. data/docs/ContentSummaryResponse.md +21 -0
  8. data/docs/DistributionsGemApi.md +382 -0
  9. data/docs/GemGemContent.md +21 -0
  10. data/docs/GemGemContentResponse.md +35 -0
  11. data/docs/GemGemDistribution.md +31 -0
  12. data/docs/GemGemDistributionResponse.md +37 -0
  13. data/docs/GemGemPublication.md +19 -0
  14. data/docs/GemGemPublicationResponse.md +23 -0
  15. data/docs/GemGemRemote.md +63 -0
  16. data/docs/GemGemRemoteResponse.md +61 -0
  17. data/docs/GemGemRemoteResponseHiddenFields.md +19 -0
  18. data/docs/GemGemRepository.md +25 -0
  19. data/docs/GemGemRepositoryResponse.md +33 -0
  20. data/docs/PaginatedRepositoryVersionResponseList.md +23 -0
  21. data/docs/PaginatedgemGemContentResponseList.md +23 -0
  22. data/docs/PaginatedgemGemDistributionResponseList.md +23 -0
  23. data/docs/PaginatedgemGemPublicationResponseList.md +23 -0
  24. data/docs/PaginatedgemGemRemoteResponseList.md +23 -0
  25. data/docs/PaginatedgemGemRepositoryResponseList.md +23 -0
  26. data/docs/PatchedgemGemDistribution.md +31 -0
  27. data/docs/PatchedgemGemRemote.md +63 -0
  28. data/docs/PatchedgemGemRepository.md +25 -0
  29. data/docs/PolicyEnum.md +16 -0
  30. data/docs/PublicationsGemApi.md +263 -0
  31. data/docs/RemotesGemApi.md +380 -0
  32. data/docs/Repair.md +17 -0
  33. data/docs/RepositoriesGemApi.md +502 -0
  34. data/docs/RepositoriesGemVersionsApi.md +273 -0
  35. data/docs/RepositoryAddRemoveContent.md +21 -0
  36. data/docs/RepositorySyncURL.md +19 -0
  37. data/docs/RepositoryVersionResponse.md +27 -0
  38. data/lib/pulp_gem_client/api/content_gem_api.rb +259 -0
  39. data/lib/pulp_gem_client/api/distributions_gem_api.rb +476 -0
  40. data/lib/pulp_gem_client/api/publications_gem_api.rb +325 -0
  41. data/lib/pulp_gem_client/api/remotes_gem_api.rb +473 -0
  42. data/lib/pulp_gem_client/api/repositories_gem_api.rb +628 -0
  43. data/lib/pulp_gem_client/api/repositories_gem_versions_api.rb +346 -0
  44. data/lib/pulp_gem_client/api_client.rb +403 -0
  45. data/lib/pulp_gem_client/api_error.rb +57 -0
  46. data/lib/pulp_gem_client/configuration.rb +251 -0
  47. data/lib/pulp_gem_client/models/async_operation_response.rb +213 -0
  48. data/lib/pulp_gem_client/models/content_summary_response.rb +246 -0
  49. data/lib/pulp_gem_client/models/gem_gem_content.rb +228 -0
  50. data/lib/pulp_gem_client/models/gem_gem_content_response.rb +303 -0
  51. data/lib/pulp_gem_client/models/gem_gem_distribution.rb +333 -0
  52. data/lib/pulp_gem_client/models/gem_gem_distribution_response.rb +324 -0
  53. data/lib/pulp_gem_client/models/gem_gem_publication.rb +217 -0
  54. data/lib/pulp_gem_client/models/gem_gem_publication_response.rb +236 -0
  55. data/lib/pulp_gem_client/models/gem_gem_remote.rb +704 -0
  56. data/lib/pulp_gem_client/models/gem_gem_remote_response.rb +532 -0
  57. data/lib/pulp_gem_client/models/gem_gem_remote_response_hidden_fields.rb +215 -0
  58. data/lib/pulp_gem_client/models/gem_gem_repository.rb +306 -0
  59. data/lib/pulp_gem_client/models/gem_gem_repository_response.rb +309 -0
  60. data/lib/pulp_gem_client/models/paginated_repository_version_response_list.rb +237 -0
  61. data/lib/pulp_gem_client/models/paginatedgem_gem_content_response_list.rb +237 -0
  62. data/lib/pulp_gem_client/models/paginatedgem_gem_distribution_response_list.rb +237 -0
  63. data/lib/pulp_gem_client/models/paginatedgem_gem_publication_response_list.rb +237 -0
  64. data/lib/pulp_gem_client/models/paginatedgem_gem_remote_response_list.rb +237 -0
  65. data/lib/pulp_gem_client/models/paginatedgem_gem_repository_response_list.rb +237 -0
  66. data/lib/pulp_gem_client/models/patchedgem_gem_distribution.rb +315 -0
  67. data/lib/pulp_gem_client/models/patchedgem_gem_remote.rb +686 -0
  68. data/lib/pulp_gem_client/models/patchedgem_gem_repository.rb +297 -0
  69. data/lib/pulp_gem_client/models/policy_enum.rb +37 -0
  70. data/lib/pulp_gem_client/models/repair.rb +209 -0
  71. data/lib/pulp_gem_client/models/repository_add_remove_content.rb +232 -0
  72. data/lib/pulp_gem_client/models/repository_sync_url.rb +220 -0
  73. data/lib/pulp_gem_client/models/repository_version_response.rb +255 -0
  74. data/lib/pulp_gem_client/version.rb +15 -0
  75. data/lib/pulp_gem_client.rb +72 -0
  76. data/pulp_gem_client.gemspec +39 -0
  77. data/spec/api/content_gem_api_spec.rb +88 -0
  78. data/spec/api/distributions_gem_api_spec.rb +130 -0
  79. data/spec/api/publications_gem_api_spec.rb +101 -0
  80. data/spec/api/remotes_gem_api_spec.rb +129 -0
  81. data/spec/api/repositories_gem_api_spec.rb +160 -0
  82. data/spec/api/repositories_gem_versions_api_spec.rb +105 -0
  83. data/spec/api_client_spec.rb +188 -0
  84. data/spec/configuration_spec.rb +42 -0
  85. data/spec/models/async_operation_response_spec.rb +41 -0
  86. data/spec/models/content_summary_response_spec.rb +53 -0
  87. data/spec/models/gem_gem_content_response_spec.rb +95 -0
  88. data/spec/models/gem_gem_content_spec.rb +53 -0
  89. data/spec/models/gem_gem_distribution_response_spec.rb +101 -0
  90. data/spec/models/gem_gem_distribution_spec.rb +83 -0
  91. data/spec/models/gem_gem_publication_response_spec.rb +59 -0
  92. data/spec/models/gem_gem_publication_spec.rb +47 -0
  93. data/spec/models/gem_gem_remote_response_hidden_fields_spec.rb +47 -0
  94. data/spec/models/gem_gem_remote_response_spec.rb +173 -0
  95. data/spec/models/gem_gem_remote_spec.rb +179 -0
  96. data/spec/models/gem_gem_repository_response_spec.rb +89 -0
  97. data/spec/models/gem_gem_repository_spec.rb +65 -0
  98. data/spec/models/paginated_repository_version_response_list_spec.rb +59 -0
  99. data/spec/models/paginatedgem_gem_content_response_list_spec.rb +59 -0
  100. data/spec/models/paginatedgem_gem_distribution_response_list_spec.rb +59 -0
  101. data/spec/models/paginatedgem_gem_publication_response_list_spec.rb +59 -0
  102. data/spec/models/paginatedgem_gem_remote_response_list_spec.rb +59 -0
  103. data/spec/models/paginatedgem_gem_repository_response_list_spec.rb +59 -0
  104. data/spec/models/patchedgem_gem_distribution_spec.rb +83 -0
  105. data/spec/models/patchedgem_gem_remote_spec.rb +179 -0
  106. data/spec/models/patchedgem_gem_repository_spec.rb +65 -0
  107. data/spec/models/policy_enum_spec.rb +35 -0
  108. data/spec/models/repair_spec.rb +41 -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/spec_helper.rb +111 -0
  113. metadata +250 -0
@@ -0,0 +1,704 @@
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 PulpGemClient
16
+ # A Serializer for GemRemote.
17
+ class GemGemRemote
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 authenticate to the proxy. Extra leading and trailing whitespace characters are not trimmed.
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. Extra leading and trailing whitespace characters are not trimmed.
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. * `immediate` - When syncing, download all metadata and content now. * `on_demand` - When syncing, download metadata, but do not download content now. Instead, download content as clients request it, and save it in Pulp to be served for future client requests. * `streamed` - When syncing, download metadata, but do not download content now. Instead,download content as clients request it, but never save it in Pulp. This causes future requests for that same content to have to be downloaded again.
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
+ attr_accessor :prereleases
81
+
82
+ attr_accessor :includes
83
+
84
+ attr_accessor :excludes
85
+
86
+ # Attribute mapping from ruby-style variable name to JSON key.
87
+ def self.attribute_map
88
+ {
89
+ :'name' => :'name',
90
+ :'url' => :'url',
91
+ :'ca_cert' => :'ca_cert',
92
+ :'client_cert' => :'client_cert',
93
+ :'client_key' => :'client_key',
94
+ :'tls_validation' => :'tls_validation',
95
+ :'proxy_url' => :'proxy_url',
96
+ :'proxy_username' => :'proxy_username',
97
+ :'proxy_password' => :'proxy_password',
98
+ :'username' => :'username',
99
+ :'password' => :'password',
100
+ :'pulp_labels' => :'pulp_labels',
101
+ :'download_concurrency' => :'download_concurrency',
102
+ :'max_retries' => :'max_retries',
103
+ :'policy' => :'policy',
104
+ :'total_timeout' => :'total_timeout',
105
+ :'connect_timeout' => :'connect_timeout',
106
+ :'sock_connect_timeout' => :'sock_connect_timeout',
107
+ :'sock_read_timeout' => :'sock_read_timeout',
108
+ :'headers' => :'headers',
109
+ :'rate_limit' => :'rate_limit',
110
+ :'prereleases' => :'prereleases',
111
+ :'includes' => :'includes',
112
+ :'excludes' => :'excludes'
113
+ }
114
+ end
115
+
116
+ # Attribute type mapping.
117
+ def self.openapi_types
118
+ {
119
+ :'name' => :'String',
120
+ :'url' => :'String',
121
+ :'ca_cert' => :'String',
122
+ :'client_cert' => :'String',
123
+ :'client_key' => :'String',
124
+ :'tls_validation' => :'Boolean',
125
+ :'proxy_url' => :'String',
126
+ :'proxy_username' => :'String',
127
+ :'proxy_password' => :'String',
128
+ :'username' => :'String',
129
+ :'password' => :'String',
130
+ :'pulp_labels' => :'Hash<String, String>',
131
+ :'download_concurrency' => :'Integer',
132
+ :'max_retries' => :'Integer',
133
+ :'policy' => :'PolicyEnum',
134
+ :'total_timeout' => :'Float',
135
+ :'connect_timeout' => :'Float',
136
+ :'sock_connect_timeout' => :'Float',
137
+ :'sock_read_timeout' => :'Float',
138
+ :'headers' => :'Array<Object>',
139
+ :'rate_limit' => :'Integer',
140
+ :'prereleases' => :'Boolean',
141
+ :'includes' => :'Hash<String, String>',
142
+ :'excludes' => :'Hash<String, String>'
143
+ }
144
+ end
145
+
146
+ # List of attributes with nullable: true
147
+ def self.openapi_nullable
148
+ Set.new([
149
+ :'ca_cert',
150
+ :'client_cert',
151
+ :'client_key',
152
+ :'proxy_url',
153
+ :'proxy_username',
154
+ :'proxy_password',
155
+ :'username',
156
+ :'password',
157
+ :'download_concurrency',
158
+ :'max_retries',
159
+ :'total_timeout',
160
+ :'connect_timeout',
161
+ :'sock_connect_timeout',
162
+ :'sock_read_timeout',
163
+ :'rate_limit',
164
+ :'includes',
165
+ :'excludes'
166
+ ])
167
+ end
168
+
169
+ # Initializes the object
170
+ # @param [Hash] attributes Model attributes in the form of hash
171
+ def initialize(attributes = {})
172
+ if (!attributes.is_a?(Hash))
173
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpGemClient::GemGemRemote` initialize method"
174
+ end
175
+
176
+ # check to see if the attribute exists and convert string to symbol for hash key
177
+ attributes = attributes.each_with_object({}) { |(k, v), h|
178
+ if (!self.class.attribute_map.key?(k.to_sym))
179
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpGemClient::GemGemRemote`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
180
+ end
181
+ h[k.to_sym] = v
182
+ }
183
+
184
+ if attributes.key?(:'name')
185
+ self.name = attributes[:'name']
186
+ end
187
+
188
+ if attributes.key?(:'url')
189
+ self.url = attributes[:'url']
190
+ end
191
+
192
+ if attributes.key?(:'ca_cert')
193
+ self.ca_cert = attributes[:'ca_cert']
194
+ end
195
+
196
+ if attributes.key?(:'client_cert')
197
+ self.client_cert = attributes[:'client_cert']
198
+ end
199
+
200
+ if attributes.key?(:'client_key')
201
+ self.client_key = attributes[:'client_key']
202
+ end
203
+
204
+ if attributes.key?(:'tls_validation')
205
+ self.tls_validation = attributes[:'tls_validation']
206
+ end
207
+
208
+ if attributes.key?(:'proxy_url')
209
+ self.proxy_url = attributes[:'proxy_url']
210
+ end
211
+
212
+ if attributes.key?(:'proxy_username')
213
+ self.proxy_username = attributes[:'proxy_username']
214
+ end
215
+
216
+ if attributes.key?(:'proxy_password')
217
+ self.proxy_password = attributes[:'proxy_password']
218
+ end
219
+
220
+ if attributes.key?(:'username')
221
+ self.username = attributes[:'username']
222
+ end
223
+
224
+ if attributes.key?(:'password')
225
+ self.password = attributes[:'password']
226
+ end
227
+
228
+ if attributes.key?(:'pulp_labels')
229
+ if (value = attributes[:'pulp_labels']).is_a?(Hash)
230
+ self.pulp_labels = value
231
+ end
232
+ end
233
+
234
+ if attributes.key?(:'download_concurrency')
235
+ self.download_concurrency = attributes[:'download_concurrency']
236
+ end
237
+
238
+ if attributes.key?(:'max_retries')
239
+ self.max_retries = attributes[:'max_retries']
240
+ end
241
+
242
+ if attributes.key?(:'policy')
243
+ self.policy = attributes[:'policy']
244
+ end
245
+
246
+ if attributes.key?(:'total_timeout')
247
+ self.total_timeout = attributes[:'total_timeout']
248
+ end
249
+
250
+ if attributes.key?(:'connect_timeout')
251
+ self.connect_timeout = attributes[:'connect_timeout']
252
+ end
253
+
254
+ if attributes.key?(:'sock_connect_timeout')
255
+ self.sock_connect_timeout = attributes[:'sock_connect_timeout']
256
+ end
257
+
258
+ if attributes.key?(:'sock_read_timeout')
259
+ self.sock_read_timeout = attributes[:'sock_read_timeout']
260
+ end
261
+
262
+ if attributes.key?(:'headers')
263
+ if (value = attributes[:'headers']).is_a?(Array)
264
+ self.headers = value
265
+ end
266
+ end
267
+
268
+ if attributes.key?(:'rate_limit')
269
+ self.rate_limit = attributes[:'rate_limit']
270
+ end
271
+
272
+ if attributes.key?(:'prereleases')
273
+ self.prereleases = attributes[:'prereleases']
274
+ else
275
+ self.prereleases = false
276
+ end
277
+
278
+ if attributes.key?(:'includes')
279
+ if (value = attributes[:'includes']).is_a?(Hash)
280
+ self.includes = value
281
+ end
282
+ end
283
+
284
+ if attributes.key?(:'excludes')
285
+ if (value = attributes[:'excludes']).is_a?(Hash)
286
+ self.excludes = value
287
+ end
288
+ end
289
+ end
290
+
291
+ # Show invalid properties with the reasons. Usually used together with valid?
292
+ # @return Array for valid properties with the reasons
293
+ def list_invalid_properties
294
+ invalid_properties = Array.new
295
+ if @name.nil?
296
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
297
+ end
298
+
299
+ if @name.to_s.length < 1
300
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
301
+ end
302
+
303
+ if @url.nil?
304
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
305
+ end
306
+
307
+ if @url.to_s.length < 1
308
+ invalid_properties.push('invalid value for "url", the character length must be great than or equal to 1.')
309
+ end
310
+
311
+ if !@ca_cert.nil? && @ca_cert.to_s.length < 1
312
+ invalid_properties.push('invalid value for "ca_cert", the character length must be great than or equal to 1.')
313
+ end
314
+
315
+ if !@client_cert.nil? && @client_cert.to_s.length < 1
316
+ invalid_properties.push('invalid value for "client_cert", the character length must be great than or equal to 1.')
317
+ end
318
+
319
+ if !@client_key.nil? && @client_key.to_s.length < 1
320
+ invalid_properties.push('invalid value for "client_key", the character length must be great than or equal to 1.')
321
+ end
322
+
323
+ if !@proxy_url.nil? && @proxy_url.to_s.length < 1
324
+ invalid_properties.push('invalid value for "proxy_url", the character length must be great than or equal to 1.')
325
+ end
326
+
327
+ if !@proxy_username.nil? && @proxy_username.to_s.length < 1
328
+ invalid_properties.push('invalid value for "proxy_username", the character length must be great than or equal to 1.')
329
+ end
330
+
331
+ if !@proxy_password.nil? && @proxy_password.to_s.length < 1
332
+ invalid_properties.push('invalid value for "proxy_password", the character length must be great than or equal to 1.')
333
+ end
334
+
335
+ if !@username.nil? && @username.to_s.length < 1
336
+ invalid_properties.push('invalid value for "username", the character length must be great than or equal to 1.')
337
+ end
338
+
339
+ if !@password.nil? && @password.to_s.length < 1
340
+ invalid_properties.push('invalid value for "password", the character length must be great than or equal to 1.')
341
+ end
342
+
343
+ if !@download_concurrency.nil? && @download_concurrency < 1
344
+ invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
345
+ end
346
+
347
+ if !@total_timeout.nil? && @total_timeout < 0.0
348
+ invalid_properties.push('invalid value for "total_timeout", must be greater than or equal to 0.0.')
349
+ end
350
+
351
+ if !@connect_timeout.nil? && @connect_timeout < 0.0
352
+ invalid_properties.push('invalid value for "connect_timeout", must be greater than or equal to 0.0.')
353
+ end
354
+
355
+ if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
356
+ invalid_properties.push('invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.')
357
+ end
358
+
359
+ if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
360
+ invalid_properties.push('invalid value for "sock_read_timeout", must be greater than or equal to 0.0.')
361
+ end
362
+
363
+ invalid_properties
364
+ end
365
+
366
+ # Check to see if the all the properties in the model are valid
367
+ # @return true if the model is valid
368
+ def valid?
369
+ return false if @name.nil?
370
+ return false if @name.to_s.length < 1
371
+ return false if @url.nil?
372
+ return false if @url.to_s.length < 1
373
+ return false if !@ca_cert.nil? && @ca_cert.to_s.length < 1
374
+ return false if !@client_cert.nil? && @client_cert.to_s.length < 1
375
+ return false if !@client_key.nil? && @client_key.to_s.length < 1
376
+ return false if !@proxy_url.nil? && @proxy_url.to_s.length < 1
377
+ return false if !@proxy_username.nil? && @proxy_username.to_s.length < 1
378
+ return false if !@proxy_password.nil? && @proxy_password.to_s.length < 1
379
+ return false if !@username.nil? && @username.to_s.length < 1
380
+ return false if !@password.nil? && @password.to_s.length < 1
381
+ return false if !@download_concurrency.nil? && @download_concurrency < 1
382
+ return false if !@total_timeout.nil? && @total_timeout < 0.0
383
+ return false if !@connect_timeout.nil? && @connect_timeout < 0.0
384
+ return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
385
+ return false if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
386
+ true
387
+ end
388
+
389
+ # Custom attribute writer method with validation
390
+ # @param [Object] name Value to be assigned
391
+ def name=(name)
392
+ if name.nil?
393
+ fail ArgumentError, 'name cannot be nil'
394
+ end
395
+
396
+ if name.to_s.length < 1
397
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
398
+ end
399
+
400
+ @name = name
401
+ end
402
+
403
+ # Custom attribute writer method with validation
404
+ # @param [Object] url Value to be assigned
405
+ def url=(url)
406
+ if url.nil?
407
+ fail ArgumentError, 'url cannot be nil'
408
+ end
409
+
410
+ if url.to_s.length < 1
411
+ fail ArgumentError, 'invalid value for "url", the character length must be great than or equal to 1.'
412
+ end
413
+
414
+ @url = url
415
+ end
416
+
417
+ # Custom attribute writer method with validation
418
+ # @param [Object] ca_cert Value to be assigned
419
+ def ca_cert=(ca_cert)
420
+ if !ca_cert.nil? && ca_cert.to_s.length < 1
421
+ fail ArgumentError, 'invalid value for "ca_cert", the character length must be great than or equal to 1.'
422
+ end
423
+
424
+ @ca_cert = ca_cert
425
+ end
426
+
427
+ # Custom attribute writer method with validation
428
+ # @param [Object] client_cert Value to be assigned
429
+ def client_cert=(client_cert)
430
+ if !client_cert.nil? && client_cert.to_s.length < 1
431
+ fail ArgumentError, 'invalid value for "client_cert", the character length must be great than or equal to 1.'
432
+ end
433
+
434
+ @client_cert = client_cert
435
+ end
436
+
437
+ # Custom attribute writer method with validation
438
+ # @param [Object] client_key Value to be assigned
439
+ def client_key=(client_key)
440
+ if !client_key.nil? && client_key.to_s.length < 1
441
+ fail ArgumentError, 'invalid value for "client_key", the character length must be great than or equal to 1.'
442
+ end
443
+
444
+ @client_key = client_key
445
+ end
446
+
447
+ # Custom attribute writer method with validation
448
+ # @param [Object] proxy_url Value to be assigned
449
+ def proxy_url=(proxy_url)
450
+ if !proxy_url.nil? && proxy_url.to_s.length < 1
451
+ fail ArgumentError, 'invalid value for "proxy_url", the character length must be great than or equal to 1.'
452
+ end
453
+
454
+ @proxy_url = proxy_url
455
+ end
456
+
457
+ # Custom attribute writer method with validation
458
+ # @param [Object] proxy_username Value to be assigned
459
+ def proxy_username=(proxy_username)
460
+ if !proxy_username.nil? && proxy_username.to_s.length < 1
461
+ fail ArgumentError, 'invalid value for "proxy_username", the character length must be great than or equal to 1.'
462
+ end
463
+
464
+ @proxy_username = proxy_username
465
+ end
466
+
467
+ # Custom attribute writer method with validation
468
+ # @param [Object] proxy_password Value to be assigned
469
+ def proxy_password=(proxy_password)
470
+ if !proxy_password.nil? && proxy_password.to_s.length < 1
471
+ fail ArgumentError, 'invalid value for "proxy_password", the character length must be great than or equal to 1.'
472
+ end
473
+
474
+ @proxy_password = proxy_password
475
+ end
476
+
477
+ # Custom attribute writer method with validation
478
+ # @param [Object] username Value to be assigned
479
+ def username=(username)
480
+ if !username.nil? && username.to_s.length < 1
481
+ fail ArgumentError, 'invalid value for "username", the character length must be great than or equal to 1.'
482
+ end
483
+
484
+ @username = username
485
+ end
486
+
487
+ # Custom attribute writer method with validation
488
+ # @param [Object] password Value to be assigned
489
+ def password=(password)
490
+ if !password.nil? && password.to_s.length < 1
491
+ fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 1.'
492
+ end
493
+
494
+ @password = password
495
+ end
496
+
497
+ # Custom attribute writer method with validation
498
+ # @param [Object] download_concurrency Value to be assigned
499
+ def download_concurrency=(download_concurrency)
500
+ if !download_concurrency.nil? && download_concurrency < 1
501
+ fail ArgumentError, 'invalid value for "download_concurrency", must be greater than or equal to 1.'
502
+ end
503
+
504
+ @download_concurrency = download_concurrency
505
+ end
506
+
507
+ # Custom attribute writer method with validation
508
+ # @param [Object] total_timeout Value to be assigned
509
+ def total_timeout=(total_timeout)
510
+ if !total_timeout.nil? && total_timeout < 0.0
511
+ fail ArgumentError, 'invalid value for "total_timeout", must be greater than or equal to 0.0.'
512
+ end
513
+
514
+ @total_timeout = total_timeout
515
+ end
516
+
517
+ # Custom attribute writer method with validation
518
+ # @param [Object] connect_timeout Value to be assigned
519
+ def connect_timeout=(connect_timeout)
520
+ if !connect_timeout.nil? && connect_timeout < 0.0
521
+ fail ArgumentError, 'invalid value for "connect_timeout", must be greater than or equal to 0.0.'
522
+ end
523
+
524
+ @connect_timeout = connect_timeout
525
+ end
526
+
527
+ # Custom attribute writer method with validation
528
+ # @param [Object] sock_connect_timeout Value to be assigned
529
+ def sock_connect_timeout=(sock_connect_timeout)
530
+ if !sock_connect_timeout.nil? && sock_connect_timeout < 0.0
531
+ fail ArgumentError, 'invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.'
532
+ end
533
+
534
+ @sock_connect_timeout = sock_connect_timeout
535
+ end
536
+
537
+ # Custom attribute writer method with validation
538
+ # @param [Object] sock_read_timeout Value to be assigned
539
+ def sock_read_timeout=(sock_read_timeout)
540
+ if !sock_read_timeout.nil? && sock_read_timeout < 0.0
541
+ fail ArgumentError, 'invalid value for "sock_read_timeout", must be greater than or equal to 0.0.'
542
+ end
543
+
544
+ @sock_read_timeout = sock_read_timeout
545
+ end
546
+
547
+ # Checks equality by comparing each attribute.
548
+ # @param [Object] Object to be compared
549
+ def ==(o)
550
+ return true if self.equal?(o)
551
+ self.class == o.class &&
552
+ name == o.name &&
553
+ url == o.url &&
554
+ ca_cert == o.ca_cert &&
555
+ client_cert == o.client_cert &&
556
+ client_key == o.client_key &&
557
+ tls_validation == o.tls_validation &&
558
+ proxy_url == o.proxy_url &&
559
+ proxy_username == o.proxy_username &&
560
+ proxy_password == o.proxy_password &&
561
+ username == o.username &&
562
+ password == o.password &&
563
+ pulp_labels == o.pulp_labels &&
564
+ download_concurrency == o.download_concurrency &&
565
+ max_retries == o.max_retries &&
566
+ policy == o.policy &&
567
+ total_timeout == o.total_timeout &&
568
+ connect_timeout == o.connect_timeout &&
569
+ sock_connect_timeout == o.sock_connect_timeout &&
570
+ sock_read_timeout == o.sock_read_timeout &&
571
+ headers == o.headers &&
572
+ rate_limit == o.rate_limit &&
573
+ prereleases == o.prereleases &&
574
+ includes == o.includes &&
575
+ excludes == o.excludes
576
+ end
577
+
578
+ # @see the `==` method
579
+ # @param [Object] Object to be compared
580
+ def eql?(o)
581
+ self == o
582
+ end
583
+
584
+ # Calculates hash code according to all attributes.
585
+ # @return [Integer] Hash code
586
+ def hash
587
+ [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, prereleases, includes, excludes].hash
588
+ end
589
+
590
+ # Builds the object from hash
591
+ # @param [Hash] attributes Model attributes in the form of hash
592
+ # @return [Object] Returns the model itself
593
+ def self.build_from_hash(attributes)
594
+ new.build_from_hash(attributes)
595
+ end
596
+
597
+ # Builds the object from hash
598
+ # @param [Hash] attributes Model attributes in the form of hash
599
+ # @return [Object] Returns the model itself
600
+ def build_from_hash(attributes)
601
+ return nil unless attributes.is_a?(Hash)
602
+ self.class.openapi_types.each_pair do |key, type|
603
+ if type =~ /\AArray<(.*)>/i
604
+ # check to ensure the input is an array given that the attribute
605
+ # is documented as an array but the input is not
606
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
607
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
608
+ end
609
+ elsif !attributes[self.class.attribute_map[key]].nil?
610
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
611
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
612
+ end
613
+
614
+ self
615
+ end
616
+
617
+ # Deserializes the data based on type
618
+ # @param string type Data type
619
+ # @param string value Value to be deserialized
620
+ # @return [Object] Deserialized data
621
+ def _deserialize(type, value)
622
+ case type.to_sym
623
+ when :DateTime
624
+ DateTime.parse(value)
625
+ when :Date
626
+ Date.parse(value)
627
+ when :String
628
+ value.to_s
629
+ when :Integer
630
+ value.to_i
631
+ when :Float
632
+ value.to_f
633
+ when :Boolean
634
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
635
+ true
636
+ else
637
+ false
638
+ end
639
+ when :Object
640
+ # generic object (usually a Hash), return directly
641
+ value
642
+ when /\AArray<(?<inner_type>.+)>\z/
643
+ inner_type = Regexp.last_match[:inner_type]
644
+ value.map { |v| _deserialize(inner_type, v) }
645
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
646
+ k_type = Regexp.last_match[:k_type]
647
+ v_type = Regexp.last_match[:v_type]
648
+ {}.tap do |hash|
649
+ value.each do |k, v|
650
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
651
+ end
652
+ end
653
+ else # model
654
+ PulpGemClient.const_get(type).build_from_hash(value)
655
+ end
656
+ end
657
+
658
+ # Returns the string representation of the object
659
+ # @return [String] String presentation of the object
660
+ def to_s
661
+ to_hash.to_s
662
+ end
663
+
664
+ # to_body is an alias to to_hash (backward compatibility)
665
+ # @return [Hash] Returns the object in the form of hash
666
+ def to_body
667
+ to_hash
668
+ end
669
+
670
+ # Returns the object in the form of hash
671
+ # @return [Hash] Returns the object in the form of hash
672
+ def to_hash
673
+ hash = {}
674
+ self.class.attribute_map.each_pair do |attr, param|
675
+ value = self.send(attr)
676
+ if value.nil?
677
+ is_nullable = self.class.openapi_nullable.include?(attr)
678
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
679
+ end
680
+
681
+ hash[param] = _to_hash(value)
682
+ end
683
+ hash
684
+ end
685
+
686
+ # Outputs non-array value in the form of hash
687
+ # For object, use to_hash. Otherwise, just return the value
688
+ # @param [Object] value Any valid value
689
+ # @return [Hash] Returns the value in the form of hash
690
+ def _to_hash(value)
691
+ if value.is_a?(Array)
692
+ value.compact.map { |v| _to_hash(v) }
693
+ elsif value.is_a?(Hash)
694
+ {}.tap do |hash|
695
+ value.each { |k, v| hash[k] = _to_hash(v) }
696
+ end
697
+ elsif value.respond_to? :to_hash
698
+ value.to_hash
699
+ else
700
+ value
701
+ end
702
+ end
703
+ end
704
+ end