pulp_deb_client 2.0.0b2

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