pulp_npm_client 0.1.0a1.dev01590542888 → 0.1.0a1.dev01591234165

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of pulp_npm_client might be problematic. Click here for more details.

Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -6
  3. data/docs/ContentPackagesApi.md +6 -6
  4. data/docs/DistributionsNpmApi.md +2 -2
  5. data/docs/InlineResponse200.md +1 -1
  6. data/docs/InlineResponse2001.md +1 -1
  7. data/docs/InlineResponse2002.md +1 -1
  8. data/docs/InlineResponse2003.md +1 -1
  9. data/docs/InlineResponse2004.md +1 -1
  10. data/docs/NpmNpmDistributionRead.md +31 -0
  11. data/docs/NpmNpmRemote.md +7 -3
  12. data/docs/NpmNpmRemoteRead.md +43 -0
  13. data/docs/NpmNpmRepositoryRead.md +27 -0
  14. data/docs/{NpmPackage.md → NpmPackageRead.md} +2 -2
  15. data/docs/RemotesNpmApi.md +4 -4
  16. data/docs/RepositoriesNpmApi.md +9 -9
  17. data/docs/RepositoriesNpmVersionsApi.md +2 -2
  18. data/docs/RepositoryVersionRead.md +25 -0
  19. data/lib/pulp_npm_client.rb +5 -1
  20. data/lib/pulp_npm_client/api/content_packages_api.rb +8 -8
  21. data/lib/pulp_npm_client/api/distributions_npm_api.rb +3 -3
  22. data/lib/pulp_npm_client/api/remotes_npm_api.rb +6 -6
  23. data/lib/pulp_npm_client/api/repositories_npm_api.rb +15 -15
  24. data/lib/pulp_npm_client/api/repositories_npm_versions_api.rb +3 -3
  25. data/lib/pulp_npm_client/models/inline_response200.rb +1 -1
  26. data/lib/pulp_npm_client/models/inline_response2001.rb +1 -1
  27. data/lib/pulp_npm_client/models/inline_response2002.rb +1 -1
  28. data/lib/pulp_npm_client/models/inline_response2003.rb +1 -1
  29. data/lib/pulp_npm_client/models/inline_response2004.rb +1 -1
  30. data/lib/pulp_npm_client/models/npm_npm_distribution_read.rb +342 -0
  31. data/lib/pulp_npm_client/models/npm_npm_remote.rb +56 -4
  32. data/lib/pulp_npm_client/models/npm_npm_remote_read.rb +531 -0
  33. data/lib/pulp_npm_client/models/npm_npm_repository_read.rb +294 -0
  34. data/lib/pulp_npm_client/models/{npm_package.rb → npm_package_read.rb} +3 -3
  35. data/lib/pulp_npm_client/models/repository_version_read.rb +244 -0
  36. data/lib/pulp_npm_client/version.rb +1 -1
  37. data/spec/api/content_packages_api_spec.rb +3 -3
  38. data/spec/api/distributions_npm_api_spec.rb +1 -1
  39. data/spec/api/remotes_npm_api_spec.rb +2 -2
  40. data/spec/api/repositories_npm_api_spec.rb +6 -6
  41. data/spec/api/repositories_npm_versions_api_spec.rb +1 -1
  42. data/spec/models/npm_npm_distribution_read_spec.rb +83 -0
  43. data/spec/models/npm_npm_remote_read_spec.rb +123 -0
  44. data/spec/models/npm_npm_remote_spec.rb +12 -0
  45. data/spec/models/npm_npm_repository_read_spec.rb +71 -0
  46. data/spec/models/{npm_package_spec.rb → npm_package_read_spec.rb} +6 -6
  47. data/spec/models/repository_version_read_spec.rb +65 -0
  48. metadata +22 -6
@@ -25,13 +25,13 @@ module PulpNpmClient
25
25
  # The URL of an external content source.
26
26
  attr_accessor :url
27
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. Returns SHA256 checksum of the certificate file on GET.
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
29
  attr_accessor :ca_cert
30
30
 
31
- # A string containing the PEM encoded client certificate used for authentication. All new line characters must be escaped. Returns SHA256 checksum of the certificate file on GET.
31
+ # A string containing the PEM encoded client certificate used for authentication. All new line characters must be escaped.
32
32
  attr_accessor :client_cert
33
33
 
34
- # A PEM encoded private key used for authentication. Returns SHA256 checksum of the certificate file on GET.
34
+ # A PEM encoded private key used for authentication.
35
35
  attr_accessor :client_key
36
36
 
37
37
  # If True, TLS peer validation must be performed.
@@ -40,6 +40,12 @@ module PulpNpmClient
40
40
  # The proxy URL. Format: scheme://user:password@host:port
41
41
  attr_accessor :proxy_url
42
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
+
43
49
  # Timestamp of the most recent update of the remote.
44
50
  attr_accessor :pulp_last_updated
45
51
 
@@ -83,6 +89,8 @@ module PulpNpmClient
83
89
  :'client_key' => :'client_key',
84
90
  :'tls_validation' => :'tls_validation',
85
91
  :'proxy_url' => :'proxy_url',
92
+ :'username' => :'username',
93
+ :'password' => :'password',
86
94
  :'pulp_last_updated' => :'pulp_last_updated',
87
95
  :'download_concurrency' => :'download_concurrency',
88
96
  :'policy' => :'policy'
@@ -101,6 +109,8 @@ module PulpNpmClient
101
109
  :'client_key' => :'String',
102
110
  :'tls_validation' => :'Boolean',
103
111
  :'proxy_url' => :'String',
112
+ :'username' => :'String',
113
+ :'password' => :'String',
104
114
  :'pulp_last_updated' => :'DateTime',
105
115
  :'download_concurrency' => :'Integer',
106
116
  :'policy' => :'String'
@@ -114,6 +124,8 @@ module PulpNpmClient
114
124
  :'client_cert',
115
125
  :'client_key',
116
126
  :'proxy_url',
127
+ :'username',
128
+ :'password',
117
129
  ])
118
130
  end
119
131
 
@@ -168,6 +180,14 @@ module PulpNpmClient
168
180
  self.proxy_url = attributes[:'proxy_url']
169
181
  end
170
182
 
183
+ if attributes.key?(:'username')
184
+ self.username = attributes[:'username']
185
+ end
186
+
187
+ if attributes.key?(:'password')
188
+ self.password = attributes[:'password']
189
+ end
190
+
171
191
  if attributes.key?(:'pulp_last_updated')
172
192
  self.pulp_last_updated = attributes[:'pulp_last_updated']
173
193
  end
@@ -219,6 +239,14 @@ module PulpNpmClient
219
239
  invalid_properties.push('invalid value for "proxy_url", the character length must be great than or equal to 1.')
220
240
  end
221
241
 
242
+ if !@username.nil? && @username.to_s.length < 1
243
+ invalid_properties.push('invalid value for "username", the character length must be great than or equal to 1.')
244
+ end
245
+
246
+ if !@password.nil? && @password.to_s.length < 1
247
+ invalid_properties.push('invalid value for "password", the character length must be great than or equal to 1.')
248
+ end
249
+
222
250
  if !@download_concurrency.nil? && @download_concurrency < 1
223
251
  invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
224
252
  end
@@ -237,6 +265,8 @@ module PulpNpmClient
237
265
  return false if !@client_cert.nil? && @client_cert.to_s.length < 1
238
266
  return false if !@client_key.nil? && @client_key.to_s.length < 1
239
267
  return false if !@proxy_url.nil? && @proxy_url.to_s.length < 1
268
+ return false if !@username.nil? && @username.to_s.length < 1
269
+ return false if !@password.nil? && @password.to_s.length < 1
240
270
  return false if !@download_concurrency.nil? && @download_concurrency < 1
241
271
  policy_validator = EnumAttributeValidator.new('String', ["immediate", "on_demand", "streamed"])
242
272
  return false unless policy_validator.valid?(@policy)
@@ -311,6 +341,26 @@ module PulpNpmClient
311
341
  @proxy_url = proxy_url
312
342
  end
313
343
 
344
+ # Custom attribute writer method with validation
345
+ # @param [Object] username Value to be assigned
346
+ def username=(username)
347
+ if !username.nil? && username.to_s.length < 1
348
+ fail ArgumentError, 'invalid value for "username", the character length must be great than or equal to 1.'
349
+ end
350
+
351
+ @username = username
352
+ end
353
+
354
+ # Custom attribute writer method with validation
355
+ # @param [Object] password Value to be assigned
356
+ def password=(password)
357
+ if !password.nil? && password.to_s.length < 1
358
+ fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 1.'
359
+ end
360
+
361
+ @password = password
362
+ end
363
+
314
364
  # Custom attribute writer method with validation
315
365
  # @param [Object] download_concurrency Value to be assigned
316
366
  def download_concurrency=(download_concurrency)
@@ -345,6 +395,8 @@ module PulpNpmClient
345
395
  client_key == o.client_key &&
346
396
  tls_validation == o.tls_validation &&
347
397
  proxy_url == o.proxy_url &&
398
+ username == o.username &&
399
+ password == o.password &&
348
400
  pulp_last_updated == o.pulp_last_updated &&
349
401
  download_concurrency == o.download_concurrency &&
350
402
  policy == o.policy
@@ -359,7 +411,7 @@ module PulpNpmClient
359
411
  # Calculates hash code according to all attributes.
360
412
  # @return [Integer] Hash code
361
413
  def hash
362
- [pulp_href, pulp_created, name, url, ca_cert, client_cert, client_key, tls_validation, proxy_url, pulp_last_updated, download_concurrency, policy].hash
414
+ [pulp_href, pulp_created, name, url, ca_cert, client_cert, client_key, tls_validation, proxy_url, username, password, pulp_last_updated, download_concurrency, policy].hash
363
415
  end
364
416
 
365
417
  # Builds the object from hash
@@ -0,0 +1,531 @@
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 PulpNpmClient
16
+ class NpmNpmRemoteRead
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
+ class EnumAttributeValidator
59
+ attr_reader :datatype
60
+ attr_reader :allowable_values
61
+
62
+ def initialize(datatype, allowable_values)
63
+ @allowable_values = allowable_values.map do |value|
64
+ case datatype.to_s
65
+ when /Integer/i
66
+ value.to_i
67
+ when /Float/i
68
+ value.to_f
69
+ else
70
+ value
71
+ end
72
+ end
73
+ end
74
+
75
+ def valid?(value)
76
+ !value || allowable_values.include?(value)
77
+ end
78
+ end
79
+
80
+ # Attribute mapping from ruby-style variable name to JSON key.
81
+ def self.attribute_map
82
+ {
83
+ :'pulp_href' => :'pulp_href',
84
+ :'pulp_created' => :'pulp_created',
85
+ :'name' => :'name',
86
+ :'url' => :'url',
87
+ :'ca_cert' => :'ca_cert',
88
+ :'client_cert' => :'client_cert',
89
+ :'client_key' => :'client_key',
90
+ :'tls_validation' => :'tls_validation',
91
+ :'proxy_url' => :'proxy_url',
92
+ :'username' => :'username',
93
+ :'password' => :'password',
94
+ :'pulp_last_updated' => :'pulp_last_updated',
95
+ :'download_concurrency' => :'download_concurrency',
96
+ :'policy' => :'policy'
97
+ }
98
+ end
99
+
100
+ # Attribute type mapping.
101
+ def self.openapi_types
102
+ {
103
+ :'pulp_href' => :'String',
104
+ :'pulp_created' => :'DateTime',
105
+ :'name' => :'String',
106
+ :'url' => :'String',
107
+ :'ca_cert' => :'String',
108
+ :'client_cert' => :'String',
109
+ :'client_key' => :'String',
110
+ :'tls_validation' => :'Boolean',
111
+ :'proxy_url' => :'String',
112
+ :'username' => :'String',
113
+ :'password' => :'String',
114
+ :'pulp_last_updated' => :'DateTime',
115
+ :'download_concurrency' => :'Integer',
116
+ :'policy' => :'String'
117
+ }
118
+ end
119
+
120
+ # List of attributes with nullable: true
121
+ def self.openapi_nullable
122
+ Set.new([
123
+ :'ca_cert',
124
+ :'client_cert',
125
+ :'client_key',
126
+ :'proxy_url',
127
+ :'username',
128
+ :'password',
129
+ ])
130
+ end
131
+
132
+ # Initializes the object
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ def initialize(attributes = {})
135
+ if (!attributes.is_a?(Hash))
136
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpNpmClient::NpmNpmRemoteRead` initialize method"
137
+ end
138
+
139
+ # check to see if the attribute exists and convert string to symbol for hash key
140
+ attributes = attributes.each_with_object({}) { |(k, v), h|
141
+ if (!self.class.attribute_map.key?(k.to_sym))
142
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpNpmClient::NpmNpmRemoteRead`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
143
+ end
144
+ h[k.to_sym] = v
145
+ }
146
+
147
+ if attributes.key?(:'pulp_href')
148
+ self.pulp_href = attributes[:'pulp_href']
149
+ end
150
+
151
+ if attributes.key?(:'pulp_created')
152
+ self.pulp_created = attributes[:'pulp_created']
153
+ end
154
+
155
+ if attributes.key?(:'name')
156
+ self.name = attributes[:'name']
157
+ end
158
+
159
+ if attributes.key?(:'url')
160
+ self.url = attributes[:'url']
161
+ end
162
+
163
+ if attributes.key?(:'ca_cert')
164
+ self.ca_cert = attributes[:'ca_cert']
165
+ end
166
+
167
+ if attributes.key?(:'client_cert')
168
+ self.client_cert = attributes[:'client_cert']
169
+ end
170
+
171
+ if attributes.key?(:'client_key')
172
+ self.client_key = attributes[:'client_key']
173
+ end
174
+
175
+ if attributes.key?(:'tls_validation')
176
+ self.tls_validation = attributes[:'tls_validation']
177
+ end
178
+
179
+ if attributes.key?(:'proxy_url')
180
+ self.proxy_url = attributes[:'proxy_url']
181
+ end
182
+
183
+ if attributes.key?(:'username')
184
+ self.username = attributes[:'username']
185
+ end
186
+
187
+ if attributes.key?(:'password')
188
+ self.password = attributes[:'password']
189
+ end
190
+
191
+ if attributes.key?(:'pulp_last_updated')
192
+ self.pulp_last_updated = attributes[:'pulp_last_updated']
193
+ end
194
+
195
+ if attributes.key?(:'download_concurrency')
196
+ self.download_concurrency = attributes[:'download_concurrency']
197
+ end
198
+
199
+ if attributes.key?(:'policy')
200
+ self.policy = attributes[:'policy']
201
+ else
202
+ self.policy = 'immediate'
203
+ end
204
+ end
205
+
206
+ # Show invalid properties with the reasons. Usually used together with valid?
207
+ # @return Array for valid properties with the reasons
208
+ def list_invalid_properties
209
+ invalid_properties = Array.new
210
+ if @name.nil?
211
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
212
+ end
213
+
214
+ if @name.to_s.length < 1
215
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
216
+ end
217
+
218
+ if @url.nil?
219
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
220
+ end
221
+
222
+ if @url.to_s.length < 1
223
+ invalid_properties.push('invalid value for "url", the character length must be great than or equal to 1.')
224
+ end
225
+
226
+ if !@ca_cert.nil? && @ca_cert.to_s.length < 1
227
+ invalid_properties.push('invalid value for "ca_cert", the character length must be great than or equal to 1.')
228
+ end
229
+
230
+ if !@client_cert.nil? && @client_cert.to_s.length < 1
231
+ invalid_properties.push('invalid value for "client_cert", the character length must be great than or equal to 1.')
232
+ end
233
+
234
+ if !@client_key.nil? && @client_key.to_s.length < 1
235
+ invalid_properties.push('invalid value for "client_key", the character length must be great than or equal to 1.')
236
+ end
237
+
238
+ if !@proxy_url.nil? && @proxy_url.to_s.length < 1
239
+ invalid_properties.push('invalid value for "proxy_url", the character length must be great than or equal to 1.')
240
+ end
241
+
242
+ if !@username.nil? && @username.to_s.length < 1
243
+ invalid_properties.push('invalid value for "username", the character length must be great than or equal to 1.')
244
+ end
245
+
246
+ if !@password.nil? && @password.to_s.length < 1
247
+ invalid_properties.push('invalid value for "password", the character length must be great than or equal to 1.')
248
+ end
249
+
250
+ if !@download_concurrency.nil? && @download_concurrency < 1
251
+ invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
252
+ end
253
+
254
+ invalid_properties
255
+ end
256
+
257
+ # Check to see if the all the properties in the model are valid
258
+ # @return true if the model is valid
259
+ def valid?
260
+ return false if @name.nil?
261
+ return false if @name.to_s.length < 1
262
+ return false if @url.nil?
263
+ return false if @url.to_s.length < 1
264
+ return false if !@ca_cert.nil? && @ca_cert.to_s.length < 1
265
+ return false if !@client_cert.nil? && @client_cert.to_s.length < 1
266
+ return false if !@client_key.nil? && @client_key.to_s.length < 1
267
+ return false if !@proxy_url.nil? && @proxy_url.to_s.length < 1
268
+ return false if !@username.nil? && @username.to_s.length < 1
269
+ return false if !@password.nil? && @password.to_s.length < 1
270
+ return false if !@download_concurrency.nil? && @download_concurrency < 1
271
+ policy_validator = EnumAttributeValidator.new('String', ["immediate", "on_demand", "streamed"])
272
+ return false unless policy_validator.valid?(@policy)
273
+ true
274
+ end
275
+
276
+ # Custom attribute writer method with validation
277
+ # @param [Object] name Value to be assigned
278
+ def name=(name)
279
+ if name.nil?
280
+ fail ArgumentError, 'name cannot be nil'
281
+ end
282
+
283
+ if name.to_s.length < 1
284
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
285
+ end
286
+
287
+ @name = name
288
+ end
289
+
290
+ # Custom attribute writer method with validation
291
+ # @param [Object] url Value to be assigned
292
+ def url=(url)
293
+ if url.nil?
294
+ fail ArgumentError, 'url cannot be nil'
295
+ end
296
+
297
+ if url.to_s.length < 1
298
+ fail ArgumentError, 'invalid value for "url", the character length must be great than or equal to 1.'
299
+ end
300
+
301
+ @url = url
302
+ end
303
+
304
+ # Custom attribute writer method with validation
305
+ # @param [Object] ca_cert Value to be assigned
306
+ def ca_cert=(ca_cert)
307
+ if !ca_cert.nil? && ca_cert.to_s.length < 1
308
+ fail ArgumentError, 'invalid value for "ca_cert", the character length must be great than or equal to 1.'
309
+ end
310
+
311
+ @ca_cert = ca_cert
312
+ end
313
+
314
+ # Custom attribute writer method with validation
315
+ # @param [Object] client_cert Value to be assigned
316
+ def client_cert=(client_cert)
317
+ if !client_cert.nil? && client_cert.to_s.length < 1
318
+ fail ArgumentError, 'invalid value for "client_cert", the character length must be great than or equal to 1.'
319
+ end
320
+
321
+ @client_cert = client_cert
322
+ end
323
+
324
+ # Custom attribute writer method with validation
325
+ # @param [Object] client_key Value to be assigned
326
+ def client_key=(client_key)
327
+ if !client_key.nil? && client_key.to_s.length < 1
328
+ fail ArgumentError, 'invalid value for "client_key", the character length must be great than or equal to 1.'
329
+ end
330
+
331
+ @client_key = client_key
332
+ end
333
+
334
+ # Custom attribute writer method with validation
335
+ # @param [Object] proxy_url Value to be assigned
336
+ def proxy_url=(proxy_url)
337
+ if !proxy_url.nil? && proxy_url.to_s.length < 1
338
+ fail ArgumentError, 'invalid value for "proxy_url", the character length must be great than or equal to 1.'
339
+ end
340
+
341
+ @proxy_url = proxy_url
342
+ end
343
+
344
+ # Custom attribute writer method with validation
345
+ # @param [Object] username Value to be assigned
346
+ def username=(username)
347
+ if !username.nil? && username.to_s.length < 1
348
+ fail ArgumentError, 'invalid value for "username", the character length must be great than or equal to 1.'
349
+ end
350
+
351
+ @username = username
352
+ end
353
+
354
+ # Custom attribute writer method with validation
355
+ # @param [Object] password Value to be assigned
356
+ def password=(password)
357
+ if !password.nil? && password.to_s.length < 1
358
+ fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 1.'
359
+ end
360
+
361
+ @password = password
362
+ end
363
+
364
+ # Custom attribute writer method with validation
365
+ # @param [Object] download_concurrency Value to be assigned
366
+ def download_concurrency=(download_concurrency)
367
+ if !download_concurrency.nil? && download_concurrency < 1
368
+ fail ArgumentError, 'invalid value for "download_concurrency", must be greater than or equal to 1.'
369
+ end
370
+
371
+ @download_concurrency = download_concurrency
372
+ end
373
+
374
+ # Custom attribute writer method checking allowed values (enum).
375
+ # @param [Object] policy Object to be assigned
376
+ def policy=(policy)
377
+ validator = EnumAttributeValidator.new('String', ["immediate", "on_demand", "streamed"])
378
+ unless validator.valid?(policy)
379
+ fail ArgumentError, "invalid value for \"policy\", must be one of #{validator.allowable_values}."
380
+ end
381
+ @policy = policy
382
+ end
383
+
384
+ # Checks equality by comparing each attribute.
385
+ # @param [Object] Object to be compared
386
+ def ==(o)
387
+ return true if self.equal?(o)
388
+ self.class == o.class &&
389
+ pulp_href == o.pulp_href &&
390
+ pulp_created == o.pulp_created &&
391
+ name == o.name &&
392
+ url == o.url &&
393
+ ca_cert == o.ca_cert &&
394
+ client_cert == o.client_cert &&
395
+ client_key == o.client_key &&
396
+ tls_validation == o.tls_validation &&
397
+ proxy_url == o.proxy_url &&
398
+ username == o.username &&
399
+ password == o.password &&
400
+ pulp_last_updated == o.pulp_last_updated &&
401
+ download_concurrency == o.download_concurrency &&
402
+ policy == o.policy
403
+ end
404
+
405
+ # @see the `==` method
406
+ # @param [Object] Object to be compared
407
+ def eql?(o)
408
+ self == o
409
+ end
410
+
411
+ # Calculates hash code according to all attributes.
412
+ # @return [Integer] Hash code
413
+ def hash
414
+ [pulp_href, pulp_created, name, url, ca_cert, client_cert, client_key, tls_validation, proxy_url, username, password, pulp_last_updated, download_concurrency, policy].hash
415
+ end
416
+
417
+ # Builds the object from hash
418
+ # @param [Hash] attributes Model attributes in the form of hash
419
+ # @return [Object] Returns the model itself
420
+ def self.build_from_hash(attributes)
421
+ new.build_from_hash(attributes)
422
+ end
423
+
424
+ # Builds the object from hash
425
+ # @param [Hash] attributes Model attributes in the form of hash
426
+ # @return [Object] Returns the model itself
427
+ def build_from_hash(attributes)
428
+ return nil unless attributes.is_a?(Hash)
429
+ self.class.openapi_types.each_pair do |key, type|
430
+ if type =~ /\AArray<(.*)>/i
431
+ # check to ensure the input is an array given that the attribute
432
+ # is documented as an array but the input is not
433
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
434
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
435
+ end
436
+ elsif !attributes[self.class.attribute_map[key]].nil?
437
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
438
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
439
+ end
440
+
441
+ self
442
+ end
443
+
444
+ # Deserializes the data based on type
445
+ # @param string type Data type
446
+ # @param string value Value to be deserialized
447
+ # @return [Object] Deserialized data
448
+ def _deserialize(type, value)
449
+ case type.to_sym
450
+ when :DateTime
451
+ DateTime.parse(value)
452
+ when :Date
453
+ Date.parse(value)
454
+ when :String
455
+ value.to_s
456
+ when :Integer
457
+ value.to_i
458
+ when :Float
459
+ value.to_f
460
+ when :Boolean
461
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
462
+ true
463
+ else
464
+ false
465
+ end
466
+ when :Object
467
+ # generic object (usually a Hash), return directly
468
+ value
469
+ when /\AArray<(?<inner_type>.+)>\z/
470
+ inner_type = Regexp.last_match[:inner_type]
471
+ value.map { |v| _deserialize(inner_type, v) }
472
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
473
+ k_type = Regexp.last_match[:k_type]
474
+ v_type = Regexp.last_match[:v_type]
475
+ {}.tap do |hash|
476
+ value.each do |k, v|
477
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
478
+ end
479
+ end
480
+ else # model
481
+ PulpNpmClient.const_get(type).build_from_hash(value)
482
+ end
483
+ end
484
+
485
+ # Returns the string representation of the object
486
+ # @return [String] String presentation of the object
487
+ def to_s
488
+ to_hash.to_s
489
+ end
490
+
491
+ # to_body is an alias to to_hash (backward compatibility)
492
+ # @return [Hash] Returns the object in the form of hash
493
+ def to_body
494
+ to_hash
495
+ end
496
+
497
+ # Returns the object in the form of hash
498
+ # @return [Hash] Returns the object in the form of hash
499
+ def to_hash
500
+ hash = {}
501
+ self.class.attribute_map.each_pair do |attr, param|
502
+ value = self.send(attr)
503
+ if value.nil?
504
+ is_nullable = self.class.openapi_nullable.include?(attr)
505
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
506
+ end
507
+
508
+ hash[param] = _to_hash(value)
509
+ end
510
+ hash
511
+ end
512
+
513
+ # Outputs non-array value in the form of hash
514
+ # For object, use to_hash. Otherwise, just return the value
515
+ # @param [Object] value Any valid value
516
+ # @return [Hash] Returns the value in the form of hash
517
+ def _to_hash(value)
518
+ if value.is_a?(Array)
519
+ value.compact.map { |v| _to_hash(v) }
520
+ elsif value.is_a?(Hash)
521
+ {}.tap do |hash|
522
+ value.each { |k, v| hash[k] = _to_hash(v) }
523
+ end
524
+ elsif value.respond_to? :to_hash
525
+ value.to_hash
526
+ else
527
+ value
528
+ end
529
+ end
530
+ end
531
+ end