pulp_deb_client 2.3.0b1 → 2.4.0b1

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