pulp_file_client 1.10.5 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +35 -12
- data/docs/AcsFileApi.md +235 -8
- data/docs/ContentFilesApi.md +5 -3
- data/docs/DistributionsFileApi.md +230 -2
- data/docs/FileFileContent.md +3 -1
- data/docs/FileFileRemote.md +3 -3
- data/docs/FileFileRemoteResponse.md +1 -1
- data/docs/MyPermissionsResponse.md +17 -0
- data/docs/NestedRole.md +21 -0
- data/docs/NestedRoleResponse.md +21 -0
- data/docs/ObjectRolesResponse.md +17 -0
- data/docs/PatchedfileFileRemote.md +3 -3
- data/docs/PublicationsFileApi.md +232 -2
- data/docs/RemotesFileApi.md +230 -2
- data/docs/Repair.md +17 -0
- data/docs/RepositoriesFileApi.md +233 -4
- data/docs/RepositoriesFileVersionsApi.md +6 -6
- data/lib/pulp_file_client/api/acs_file_api.rb +281 -15
- data/lib/pulp_file_client/api/content_files_api.rb +14 -3
- data/lib/pulp_file_client/api/distributions_file_api.rb +275 -3
- data/lib/pulp_file_client/api/publications_file_api.rb +278 -3
- data/lib/pulp_file_client/api/remotes_file_api.rb +275 -3
- data/lib/pulp_file_client/api/repositories_file_api.rb +277 -3
- data/lib/pulp_file_client/api/repositories_file_versions_api.rb +16 -12
- data/lib/pulp_file_client/api_client.rb +1 -1
- data/lib/pulp_file_client/models/file_file_alternate_content_source.rb +19 -0
- data/lib/pulp_file_client/models/file_file_content.rb +33 -4
- data/lib/pulp_file_client/models/file_file_distribution.rb +38 -0
- data/lib/pulp_file_client/models/file_file_publication.rb +15 -0
- data/lib/pulp_file_client/models/file_file_remote.rb +161 -3
- data/lib/pulp_file_client/models/file_file_remote_response.rb +1 -1
- data/lib/pulp_file_client/models/file_file_repository.rb +49 -0
- data/lib/pulp_file_client/models/{repository_version.rb → my_permissions_response.rb} +17 -12
- data/lib/pulp_file_client/models/{content_summary.rb → nested_role.rb} +28 -40
- data/lib/pulp_file_client/models/nested_role_response.rb +234 -0
- data/lib/pulp_file_client/models/object_roles_response.rb +213 -0
- data/lib/pulp_file_client/models/patchedfile_file_alternate_content_source.rb +15 -0
- data/lib/pulp_file_client/models/patchedfile_file_distribution.rb +30 -0
- data/lib/pulp_file_client/models/patchedfile_file_remote.rb +153 -3
- data/lib/pulp_file_client/models/patchedfile_file_repository.rb +45 -0
- data/lib/pulp_file_client/models/repair.rb +209 -0
- data/lib/pulp_file_client/version.rb +1 -1
- data/lib/pulp_file_client.rb +5 -2
- data/pulp_file_client.gemspec +1 -1
- data/spec/api/acs_file_api_spec.rb +52 -2
- data/spec/api/content_files_api_spec.rb +2 -1
- data/spec/api/distributions_file_api_spec.rb +51 -1
- data/spec/api/publications_file_api_spec.rb +52 -1
- data/spec/api/remotes_file_api_spec.rb +51 -1
- data/spec/api/repositories_file_api_spec.rb +52 -1
- data/spec/api/repositories_file_versions_api_spec.rb +2 -2
- data/spec/models/file_file_content_spec.rb +6 -0
- data/spec/models/my_permissions_response_spec.rb +41 -0
- data/spec/models/nested_role_response_spec.rb +53 -0
- data/spec/models/{content_summary_spec.rb → nested_role_spec.rb} +9 -9
- data/spec/models/object_roles_response_spec.rb +41 -0
- data/spec/models/{repository_version_spec.rb → repair_spec.rb} +7 -7
- metadata +48 -36
- data/docs/ContentSummary.md +0 -21
- data/docs/RepositoryVersion.md +0 -17
@@ -109,15 +109,45 @@ module PulpFileClient
|
|
109
109
|
# @return Array for valid properties with the reasons
|
110
110
|
def list_invalid_properties
|
111
111
|
invalid_properties = Array.new
|
112
|
+
if !@base_path.nil? && @base_path.to_s.length < 1
|
113
|
+
invalid_properties.push('invalid value for "base_path", the character length must be great than or equal to 1.')
|
114
|
+
end
|
115
|
+
|
116
|
+
if !@name.nil? && @name.to_s.length < 1
|
117
|
+
invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
|
118
|
+
end
|
119
|
+
|
112
120
|
invalid_properties
|
113
121
|
end
|
114
122
|
|
115
123
|
# Check to see if the all the properties in the model are valid
|
116
124
|
# @return true if the model is valid
|
117
125
|
def valid?
|
126
|
+
return false if !@base_path.nil? && @base_path.to_s.length < 1
|
127
|
+
return false if !@name.nil? && @name.to_s.length < 1
|
118
128
|
true
|
119
129
|
end
|
120
130
|
|
131
|
+
# Custom attribute writer method with validation
|
132
|
+
# @param [Object] base_path Value to be assigned
|
133
|
+
def base_path=(base_path)
|
134
|
+
if !base_path.nil? && base_path.to_s.length < 1
|
135
|
+
fail ArgumentError, 'invalid value for "base_path", the character length must be great than or equal to 1.'
|
136
|
+
end
|
137
|
+
|
138
|
+
@base_path = base_path
|
139
|
+
end
|
140
|
+
|
141
|
+
# Custom attribute writer method with validation
|
142
|
+
# @param [Object] name Value to be assigned
|
143
|
+
def name=(name)
|
144
|
+
if !name.nil? && name.to_s.length < 1
|
145
|
+
fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
|
146
|
+
end
|
147
|
+
|
148
|
+
@name = name
|
149
|
+
end
|
150
|
+
|
121
151
|
# Checks equality by comparing each attribute.
|
122
152
|
# @param [Object] Object to be compared
|
123
153
|
def ==(o)
|
@@ -39,13 +39,13 @@ module PulpFileClient
|
|
39
39
|
# The username to authenticte to the proxy.
|
40
40
|
attr_accessor :proxy_username
|
41
41
|
|
42
|
-
# The password to
|
42
|
+
# The password to authenticate to the proxy. Extra leading and trailing whitespace characters are not trimmed.
|
43
43
|
attr_accessor :proxy_password
|
44
44
|
|
45
45
|
# The username to be used for authentication when syncing.
|
46
46
|
attr_accessor :username
|
47
47
|
|
48
|
-
# The password to be used for authentication when syncing.
|
48
|
+
# The password to be used for authentication when syncing. Extra leading and trailing whitespace characters are not trimmed.
|
49
49
|
attr_accessor :password
|
50
50
|
|
51
51
|
attr_accessor :pulp_labels
|
@@ -74,7 +74,7 @@ module PulpFileClient
|
|
74
74
|
# Headers for aiohttp.Clientsession
|
75
75
|
attr_accessor :headers
|
76
76
|
|
77
|
-
# Limits
|
77
|
+
# Limits requests per second for each concurrent downloader
|
78
78
|
attr_accessor :rate_limit
|
79
79
|
|
80
80
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -258,6 +258,46 @@ module PulpFileClient
|
|
258
258
|
# @return Array for valid properties with the reasons
|
259
259
|
def list_invalid_properties
|
260
260
|
invalid_properties = Array.new
|
261
|
+
if !@name.nil? && @name.to_s.length < 1
|
262
|
+
invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
|
263
|
+
end
|
264
|
+
|
265
|
+
if !@url.nil? && @url.to_s.length < 1
|
266
|
+
invalid_properties.push('invalid value for "url", the character length must be great than or equal to 1.')
|
267
|
+
end
|
268
|
+
|
269
|
+
if !@ca_cert.nil? && @ca_cert.to_s.length < 1
|
270
|
+
invalid_properties.push('invalid value for "ca_cert", the character length must be great than or equal to 1.')
|
271
|
+
end
|
272
|
+
|
273
|
+
if !@client_cert.nil? && @client_cert.to_s.length < 1
|
274
|
+
invalid_properties.push('invalid value for "client_cert", the character length must be great than or equal to 1.')
|
275
|
+
end
|
276
|
+
|
277
|
+
if !@client_key.nil? && @client_key.to_s.length < 1
|
278
|
+
invalid_properties.push('invalid value for "client_key", the character length must be great than or equal to 1.')
|
279
|
+
end
|
280
|
+
|
281
|
+
if !@proxy_url.nil? && @proxy_url.to_s.length < 1
|
282
|
+
invalid_properties.push('invalid value for "proxy_url", the character length must be great than or equal to 1.')
|
283
|
+
end
|
284
|
+
|
285
|
+
if !@proxy_username.nil? && @proxy_username.to_s.length < 1
|
286
|
+
invalid_properties.push('invalid value for "proxy_username", the character length must be great than or equal to 1.')
|
287
|
+
end
|
288
|
+
|
289
|
+
if !@proxy_password.nil? && @proxy_password.to_s.length < 1
|
290
|
+
invalid_properties.push('invalid value for "proxy_password", the character length must be great than or equal to 1.')
|
291
|
+
end
|
292
|
+
|
293
|
+
if !@username.nil? && @username.to_s.length < 1
|
294
|
+
invalid_properties.push('invalid value for "username", the character length must be great than or equal to 1.')
|
295
|
+
end
|
296
|
+
|
297
|
+
if !@password.nil? && @password.to_s.length < 1
|
298
|
+
invalid_properties.push('invalid value for "password", the character length must be great than or equal to 1.')
|
299
|
+
end
|
300
|
+
|
261
301
|
if !@download_concurrency.nil? && @download_concurrency < 1
|
262
302
|
invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
|
263
303
|
end
|
@@ -284,6 +324,16 @@ module PulpFileClient
|
|
284
324
|
# Check to see if the all the properties in the model are valid
|
285
325
|
# @return true if the model is valid
|
286
326
|
def valid?
|
327
|
+
return false if !@name.nil? && @name.to_s.length < 1
|
328
|
+
return false if !@url.nil? && @url.to_s.length < 1
|
329
|
+
return false if !@ca_cert.nil? && @ca_cert.to_s.length < 1
|
330
|
+
return false if !@client_cert.nil? && @client_cert.to_s.length < 1
|
331
|
+
return false if !@client_key.nil? && @client_key.to_s.length < 1
|
332
|
+
return false if !@proxy_url.nil? && @proxy_url.to_s.length < 1
|
333
|
+
return false if !@proxy_username.nil? && @proxy_username.to_s.length < 1
|
334
|
+
return false if !@proxy_password.nil? && @proxy_password.to_s.length < 1
|
335
|
+
return false if !@username.nil? && @username.to_s.length < 1
|
336
|
+
return false if !@password.nil? && @password.to_s.length < 1
|
287
337
|
return false if !@download_concurrency.nil? && @download_concurrency < 1
|
288
338
|
return false if !@total_timeout.nil? && @total_timeout < 0.0
|
289
339
|
return false if !@connect_timeout.nil? && @connect_timeout < 0.0
|
@@ -292,6 +342,106 @@ module PulpFileClient
|
|
292
342
|
true
|
293
343
|
end
|
294
344
|
|
345
|
+
# Custom attribute writer method with validation
|
346
|
+
# @param [Object] name Value to be assigned
|
347
|
+
def name=(name)
|
348
|
+
if !name.nil? && name.to_s.length < 1
|
349
|
+
fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
|
350
|
+
end
|
351
|
+
|
352
|
+
@name = name
|
353
|
+
end
|
354
|
+
|
355
|
+
# Custom attribute writer method with validation
|
356
|
+
# @param [Object] url Value to be assigned
|
357
|
+
def url=(url)
|
358
|
+
if !url.nil? && url.to_s.length < 1
|
359
|
+
fail ArgumentError, 'invalid value for "url", the character length must be great than or equal to 1.'
|
360
|
+
end
|
361
|
+
|
362
|
+
@url = url
|
363
|
+
end
|
364
|
+
|
365
|
+
# Custom attribute writer method with validation
|
366
|
+
# @param [Object] ca_cert Value to be assigned
|
367
|
+
def ca_cert=(ca_cert)
|
368
|
+
if !ca_cert.nil? && ca_cert.to_s.length < 1
|
369
|
+
fail ArgumentError, 'invalid value for "ca_cert", the character length must be great than or equal to 1.'
|
370
|
+
end
|
371
|
+
|
372
|
+
@ca_cert = ca_cert
|
373
|
+
end
|
374
|
+
|
375
|
+
# Custom attribute writer method with validation
|
376
|
+
# @param [Object] client_cert Value to be assigned
|
377
|
+
def client_cert=(client_cert)
|
378
|
+
if !client_cert.nil? && client_cert.to_s.length < 1
|
379
|
+
fail ArgumentError, 'invalid value for "client_cert", the character length must be great than or equal to 1.'
|
380
|
+
end
|
381
|
+
|
382
|
+
@client_cert = client_cert
|
383
|
+
end
|
384
|
+
|
385
|
+
# Custom attribute writer method with validation
|
386
|
+
# @param [Object] client_key Value to be assigned
|
387
|
+
def client_key=(client_key)
|
388
|
+
if !client_key.nil? && client_key.to_s.length < 1
|
389
|
+
fail ArgumentError, 'invalid value for "client_key", the character length must be great than or equal to 1.'
|
390
|
+
end
|
391
|
+
|
392
|
+
@client_key = client_key
|
393
|
+
end
|
394
|
+
|
395
|
+
# Custom attribute writer method with validation
|
396
|
+
# @param [Object] proxy_url Value to be assigned
|
397
|
+
def proxy_url=(proxy_url)
|
398
|
+
if !proxy_url.nil? && proxy_url.to_s.length < 1
|
399
|
+
fail ArgumentError, 'invalid value for "proxy_url", the character length must be great than or equal to 1.'
|
400
|
+
end
|
401
|
+
|
402
|
+
@proxy_url = proxy_url
|
403
|
+
end
|
404
|
+
|
405
|
+
# Custom attribute writer method with validation
|
406
|
+
# @param [Object] proxy_username Value to be assigned
|
407
|
+
def proxy_username=(proxy_username)
|
408
|
+
if !proxy_username.nil? && proxy_username.to_s.length < 1
|
409
|
+
fail ArgumentError, 'invalid value for "proxy_username", the character length must be great than or equal to 1.'
|
410
|
+
end
|
411
|
+
|
412
|
+
@proxy_username = proxy_username
|
413
|
+
end
|
414
|
+
|
415
|
+
# Custom attribute writer method with validation
|
416
|
+
# @param [Object] proxy_password Value to be assigned
|
417
|
+
def proxy_password=(proxy_password)
|
418
|
+
if !proxy_password.nil? && proxy_password.to_s.length < 1
|
419
|
+
fail ArgumentError, 'invalid value for "proxy_password", the character length must be great than or equal to 1.'
|
420
|
+
end
|
421
|
+
|
422
|
+
@proxy_password = proxy_password
|
423
|
+
end
|
424
|
+
|
425
|
+
# Custom attribute writer method with validation
|
426
|
+
# @param [Object] username Value to be assigned
|
427
|
+
def username=(username)
|
428
|
+
if !username.nil? && username.to_s.length < 1
|
429
|
+
fail ArgumentError, 'invalid value for "username", the character length must be great than or equal to 1.'
|
430
|
+
end
|
431
|
+
|
432
|
+
@username = username
|
433
|
+
end
|
434
|
+
|
435
|
+
# Custom attribute writer method with validation
|
436
|
+
# @param [Object] password Value to be assigned
|
437
|
+
def password=(password)
|
438
|
+
if !password.nil? && password.to_s.length < 1
|
439
|
+
fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 1.'
|
440
|
+
end
|
441
|
+
|
442
|
+
@password = password
|
443
|
+
end
|
444
|
+
|
295
445
|
# Custom attribute writer method with validation
|
296
446
|
# @param [Object] download_concurrency Value to be assigned
|
297
447
|
def download_concurrency=(download_concurrency)
|
@@ -122,20 +122,55 @@ module PulpFileClient
|
|
122
122
|
# @return Array for valid properties with the reasons
|
123
123
|
def list_invalid_properties
|
124
124
|
invalid_properties = Array.new
|
125
|
+
if !@name.nil? && @name.to_s.length < 1
|
126
|
+
invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
|
127
|
+
end
|
128
|
+
|
129
|
+
if !@description.nil? && @description.to_s.length < 1
|
130
|
+
invalid_properties.push('invalid value for "description", the character length must be great than or equal to 1.')
|
131
|
+
end
|
132
|
+
|
125
133
|
if !@retain_repo_versions.nil? && @retain_repo_versions < 1
|
126
134
|
invalid_properties.push('invalid value for "retain_repo_versions", must be greater than or equal to 1.')
|
127
135
|
end
|
128
136
|
|
137
|
+
if !@manifest.nil? && @manifest.to_s.length < 1
|
138
|
+
invalid_properties.push('invalid value for "manifest", the character length must be great than or equal to 1.')
|
139
|
+
end
|
140
|
+
|
129
141
|
invalid_properties
|
130
142
|
end
|
131
143
|
|
132
144
|
# Check to see if the all the properties in the model are valid
|
133
145
|
# @return true if the model is valid
|
134
146
|
def valid?
|
147
|
+
return false if !@name.nil? && @name.to_s.length < 1
|
148
|
+
return false if !@description.nil? && @description.to_s.length < 1
|
135
149
|
return false if !@retain_repo_versions.nil? && @retain_repo_versions < 1
|
150
|
+
return false if !@manifest.nil? && @manifest.to_s.length < 1
|
136
151
|
true
|
137
152
|
end
|
138
153
|
|
154
|
+
# Custom attribute writer method with validation
|
155
|
+
# @param [Object] name Value to be assigned
|
156
|
+
def name=(name)
|
157
|
+
if !name.nil? && name.to_s.length < 1
|
158
|
+
fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
|
159
|
+
end
|
160
|
+
|
161
|
+
@name = name
|
162
|
+
end
|
163
|
+
|
164
|
+
# Custom attribute writer method with validation
|
165
|
+
# @param [Object] description Value to be assigned
|
166
|
+
def description=(description)
|
167
|
+
if !description.nil? && description.to_s.length < 1
|
168
|
+
fail ArgumentError, 'invalid value for "description", the character length must be great than or equal to 1.'
|
169
|
+
end
|
170
|
+
|
171
|
+
@description = description
|
172
|
+
end
|
173
|
+
|
139
174
|
# Custom attribute writer method with validation
|
140
175
|
# @param [Object] retain_repo_versions Value to be assigned
|
141
176
|
def retain_repo_versions=(retain_repo_versions)
|
@@ -146,6 +181,16 @@ module PulpFileClient
|
|
146
181
|
@retain_repo_versions = retain_repo_versions
|
147
182
|
end
|
148
183
|
|
184
|
+
# Custom attribute writer method with validation
|
185
|
+
# @param [Object] manifest Value to be assigned
|
186
|
+
def manifest=(manifest)
|
187
|
+
if !manifest.nil? && manifest.to_s.length < 1
|
188
|
+
fail ArgumentError, 'invalid value for "manifest", the character length must be great than or equal to 1.'
|
189
|
+
end
|
190
|
+
|
191
|
+
@manifest = manifest
|
192
|
+
end
|
193
|
+
|
149
194
|
# Checks equality by comparing each attribute.
|
150
195
|
# @param [Object] Object to be compared
|
151
196
|
def ==(o)
|
@@ -0,0 +1,209 @@
|
|
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 PulpFileClient
|
16
|
+
class Repair
|
17
|
+
# Will verify that the checksum of all stored files matches what saved in the database. Otherwise only the existence of the files will be checked. Enabled by default
|
18
|
+
attr_accessor :verify_checksums
|
19
|
+
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'verify_checksums' => :'verify_checksums'
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
# Attribute type mapping.
|
28
|
+
def self.openapi_types
|
29
|
+
{
|
30
|
+
:'verify_checksums' => :'Boolean'
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
# List of attributes with nullable: true
|
35
|
+
def self.openapi_nullable
|
36
|
+
Set.new([
|
37
|
+
])
|
38
|
+
end
|
39
|
+
|
40
|
+
# Initializes the object
|
41
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
42
|
+
def initialize(attributes = {})
|
43
|
+
if (!attributes.is_a?(Hash))
|
44
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpFileClient::Repair` initialize method"
|
45
|
+
end
|
46
|
+
|
47
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
48
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
49
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
50
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpFileClient::Repair`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
51
|
+
end
|
52
|
+
h[k.to_sym] = v
|
53
|
+
}
|
54
|
+
|
55
|
+
if attributes.key?(:'verify_checksums')
|
56
|
+
self.verify_checksums = attributes[:'verify_checksums']
|
57
|
+
else
|
58
|
+
self.verify_checksums = true
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
63
|
+
# @return Array for valid properties with the reasons
|
64
|
+
def list_invalid_properties
|
65
|
+
invalid_properties = Array.new
|
66
|
+
invalid_properties
|
67
|
+
end
|
68
|
+
|
69
|
+
# Check to see if the all the properties in the model are valid
|
70
|
+
# @return true if the model is valid
|
71
|
+
def valid?
|
72
|
+
true
|
73
|
+
end
|
74
|
+
|
75
|
+
# Checks equality by comparing each attribute.
|
76
|
+
# @param [Object] Object to be compared
|
77
|
+
def ==(o)
|
78
|
+
return true if self.equal?(o)
|
79
|
+
self.class == o.class &&
|
80
|
+
verify_checksums == o.verify_checksums
|
81
|
+
end
|
82
|
+
|
83
|
+
# @see the `==` method
|
84
|
+
# @param [Object] Object to be compared
|
85
|
+
def eql?(o)
|
86
|
+
self == o
|
87
|
+
end
|
88
|
+
|
89
|
+
# Calculates hash code according to all attributes.
|
90
|
+
# @return [Integer] Hash code
|
91
|
+
def hash
|
92
|
+
[verify_checksums].hash
|
93
|
+
end
|
94
|
+
|
95
|
+
# Builds the object from hash
|
96
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
97
|
+
# @return [Object] Returns the model itself
|
98
|
+
def self.build_from_hash(attributes)
|
99
|
+
new.build_from_hash(attributes)
|
100
|
+
end
|
101
|
+
|
102
|
+
# Builds the object from hash
|
103
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
104
|
+
# @return [Object] Returns the model itself
|
105
|
+
def build_from_hash(attributes)
|
106
|
+
return nil unless attributes.is_a?(Hash)
|
107
|
+
self.class.openapi_types.each_pair do |key, type|
|
108
|
+
if type =~ /\AArray<(.*)>/i
|
109
|
+
# check to ensure the input is an array given that the attribute
|
110
|
+
# is documented as an array but the input is not
|
111
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
112
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
113
|
+
end
|
114
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
115
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
116
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
117
|
+
end
|
118
|
+
|
119
|
+
self
|
120
|
+
end
|
121
|
+
|
122
|
+
# Deserializes the data based on type
|
123
|
+
# @param string type Data type
|
124
|
+
# @param string value Value to be deserialized
|
125
|
+
# @return [Object] Deserialized data
|
126
|
+
def _deserialize(type, value)
|
127
|
+
case type.to_sym
|
128
|
+
when :DateTime
|
129
|
+
DateTime.parse(value)
|
130
|
+
when :Date
|
131
|
+
Date.parse(value)
|
132
|
+
when :String
|
133
|
+
value.to_s
|
134
|
+
when :Integer
|
135
|
+
value.to_i
|
136
|
+
when :Float
|
137
|
+
value.to_f
|
138
|
+
when :Boolean
|
139
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
140
|
+
true
|
141
|
+
else
|
142
|
+
false
|
143
|
+
end
|
144
|
+
when :Object
|
145
|
+
# generic object (usually a Hash), return directly
|
146
|
+
value
|
147
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
148
|
+
inner_type = Regexp.last_match[:inner_type]
|
149
|
+
value.map { |v| _deserialize(inner_type, v) }
|
150
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
151
|
+
k_type = Regexp.last_match[:k_type]
|
152
|
+
v_type = Regexp.last_match[:v_type]
|
153
|
+
{}.tap do |hash|
|
154
|
+
value.each do |k, v|
|
155
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
156
|
+
end
|
157
|
+
end
|
158
|
+
else # model
|
159
|
+
PulpFileClient.const_get(type).build_from_hash(value)
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
# Returns the string representation of the object
|
164
|
+
# @return [String] String presentation of the object
|
165
|
+
def to_s
|
166
|
+
to_hash.to_s
|
167
|
+
end
|
168
|
+
|
169
|
+
# to_body is an alias to to_hash (backward compatibility)
|
170
|
+
# @return [Hash] Returns the object in the form of hash
|
171
|
+
def to_body
|
172
|
+
to_hash
|
173
|
+
end
|
174
|
+
|
175
|
+
# Returns the object in the form of hash
|
176
|
+
# @return [Hash] Returns the object in the form of hash
|
177
|
+
def to_hash
|
178
|
+
hash = {}
|
179
|
+
self.class.attribute_map.each_pair do |attr, param|
|
180
|
+
value = self.send(attr)
|
181
|
+
if value.nil?
|
182
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
183
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
184
|
+
end
|
185
|
+
|
186
|
+
hash[param] = _to_hash(value)
|
187
|
+
end
|
188
|
+
hash
|
189
|
+
end
|
190
|
+
|
191
|
+
# Outputs non-array value in the form of hash
|
192
|
+
# For object, use to_hash. Otherwise, just return the value
|
193
|
+
# @param [Object] value Any valid value
|
194
|
+
# @return [Hash] Returns the value in the form of hash
|
195
|
+
def _to_hash(value)
|
196
|
+
if value.is_a?(Array)
|
197
|
+
value.compact.map { |v| _to_hash(v) }
|
198
|
+
elsif value.is_a?(Hash)
|
199
|
+
{}.tap do |hash|
|
200
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
201
|
+
end
|
202
|
+
elsif value.respond_to? :to_hash
|
203
|
+
value.to_hash
|
204
|
+
else
|
205
|
+
value
|
206
|
+
end
|
207
|
+
end
|
208
|
+
end
|
209
|
+
end
|
data/lib/pulp_file_client.rb
CHANGED
@@ -18,7 +18,6 @@ require 'pulp_file_client/configuration'
|
|
18
18
|
|
19
19
|
# Models
|
20
20
|
require 'pulp_file_client/models/async_operation_response'
|
21
|
-
require 'pulp_file_client/models/content_summary'
|
22
21
|
require 'pulp_file_client/models/content_summary_response'
|
23
22
|
require 'pulp_file_client/models/file_file_alternate_content_source'
|
24
23
|
require 'pulp_file_client/models/file_file_alternate_content_source_response'
|
@@ -32,6 +31,10 @@ require 'pulp_file_client/models/file_file_remote'
|
|
32
31
|
require 'pulp_file_client/models/file_file_remote_response'
|
33
32
|
require 'pulp_file_client/models/file_file_repository'
|
34
33
|
require 'pulp_file_client/models/file_file_repository_response'
|
34
|
+
require 'pulp_file_client/models/my_permissions_response'
|
35
|
+
require 'pulp_file_client/models/nested_role'
|
36
|
+
require 'pulp_file_client/models/nested_role_response'
|
37
|
+
require 'pulp_file_client/models/object_roles_response'
|
35
38
|
require 'pulp_file_client/models/paginated_repository_version_response_list'
|
36
39
|
require 'pulp_file_client/models/paginatedfile_file_alternate_content_source_response_list'
|
37
40
|
require 'pulp_file_client/models/paginatedfile_file_content_response_list'
|
@@ -44,9 +47,9 @@ require 'pulp_file_client/models/patchedfile_file_distribution'
|
|
44
47
|
require 'pulp_file_client/models/patchedfile_file_remote'
|
45
48
|
require 'pulp_file_client/models/patchedfile_file_repository'
|
46
49
|
require 'pulp_file_client/models/policy_enum'
|
50
|
+
require 'pulp_file_client/models/repair'
|
47
51
|
require 'pulp_file_client/models/repository_add_remove_content'
|
48
52
|
require 'pulp_file_client/models/repository_sync_url'
|
49
|
-
require 'pulp_file_client/models/repository_version'
|
50
53
|
require 'pulp_file_client/models/repository_version_response'
|
51
54
|
require 'pulp_file_client/models/task_group_operation_response'
|
52
55
|
|
data/pulp_file_client.gemspec
CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |s|
|
|
27
27
|
s.license = 'GPLv2+'
|
28
28
|
s.required_ruby_version = ">= 1.9"
|
29
29
|
|
30
|
-
s.add_runtime_dependency 'faraday', '>=
|
30
|
+
s.add_runtime_dependency 'faraday', '>= 0.17', '< 1.9.0'
|
31
31
|
s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'
|
32
32
|
|
33
33
|
s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
|
@@ -32,6 +32,18 @@ describe 'AcsFileApi' do
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
+
# unit tests for add_role
|
36
|
+
# Add a role for this object to users/groups.
|
37
|
+
# @param file_file_alternate_content_source_href
|
38
|
+
# @param nested_role
|
39
|
+
# @param [Hash] opts the optional parameters
|
40
|
+
# @return [NestedRoleResponse]
|
41
|
+
describe 'add_role test' do
|
42
|
+
it 'should work' do
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
35
47
|
# unit tests for create
|
36
48
|
# Create a file alternate content source
|
37
49
|
# Alternate Content Source ViewSet for File ACS support is provided as a tech preview in pulp_file.
|
@@ -67,7 +79,7 @@ describe 'AcsFileApi' do
|
|
67
79
|
# @option opts [Array<String>] :name__in Filter results where name is in a comma-separated list of values
|
68
80
|
# @option opts [String] :name__startswith Filter results where name starts with value
|
69
81
|
# @option opts [Integer] :offset The initial index from which to return the results.
|
70
|
-
# @option opts [String] :ordering
|
82
|
+
# @option opts [Array<String>] :ordering Ordering
|
71
83
|
# @option opts [String] :fields A list of fields to include in the response.
|
72
84
|
# @option opts [String] :exclude_fields A list of fields to exclude from the response.
|
73
85
|
# @return [PaginatedfileFileAlternateContentSourceResponseList]
|
@@ -77,6 +89,32 @@ describe 'AcsFileApi' do
|
|
77
89
|
end
|
78
90
|
end
|
79
91
|
|
92
|
+
# unit tests for list_roles
|
93
|
+
# List roles assigned to this object.
|
94
|
+
# @param file_file_alternate_content_source_href
|
95
|
+
# @param [Hash] opts the optional parameters
|
96
|
+
# @option opts [String] :fields A list of fields to include in the response.
|
97
|
+
# @option opts [String] :exclude_fields A list of fields to exclude from the response.
|
98
|
+
# @return [ObjectRolesResponse]
|
99
|
+
describe 'list_roles test' do
|
100
|
+
it 'should work' do
|
101
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
# unit tests for my_permissions
|
106
|
+
# List permissions available to the current user on this object.
|
107
|
+
# @param file_file_alternate_content_source_href
|
108
|
+
# @param [Hash] opts the optional parameters
|
109
|
+
# @option opts [String] :fields A list of fields to include in the response.
|
110
|
+
# @option opts [String] :exclude_fields A list of fields to exclude from the response.
|
111
|
+
# @return [MyPermissionsResponse]
|
112
|
+
describe 'my_permissions test' do
|
113
|
+
it 'should work' do
|
114
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
80
118
|
# unit tests for partial_update
|
81
119
|
# Update a file alternate content source
|
82
120
|
# Trigger an asynchronous partial update task
|
@@ -105,9 +143,9 @@ describe 'AcsFileApi' do
|
|
105
143
|
end
|
106
144
|
|
107
145
|
# unit tests for refresh
|
146
|
+
# Refresh metadata
|
108
147
|
# Trigger an asynchronous task to create Alternate Content Source content.
|
109
148
|
# @param file_file_alternate_content_source_href
|
110
|
-
# @param file_file_alternate_content_source
|
111
149
|
# @param [Hash] opts the optional parameters
|
112
150
|
# @return [TaskGroupOperationResponse]
|
113
151
|
describe 'refresh test' do
|
@@ -116,6 +154,18 @@ describe 'AcsFileApi' do
|
|
116
154
|
end
|
117
155
|
end
|
118
156
|
|
157
|
+
# unit tests for remove_role
|
158
|
+
# Remove a role for this object from users/groups.
|
159
|
+
# @param file_file_alternate_content_source_href
|
160
|
+
# @param nested_role
|
161
|
+
# @param [Hash] opts the optional parameters
|
162
|
+
# @return [NestedRoleResponse]
|
163
|
+
describe 'remove_role test' do
|
164
|
+
it 'should work' do
|
165
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
119
169
|
# unit tests for update
|
120
170
|
# Update a file alternate content source
|
121
171
|
# Trigger an asynchronous update task
|
@@ -40,6 +40,7 @@ describe 'ContentFilesApi' do
|
|
40
40
|
# @option opts [String] :artifact Artifact file representing the physical content
|
41
41
|
# @option opts [File] :file An uploaded file that may be turned into the artifact of the content unit.
|
42
42
|
# @option opts [String] :repository A URI of a repository the new content unit should be associated with.
|
43
|
+
# @option opts [String] :upload An uncommitted upload that may be turned into the artifact of the content unit.
|
43
44
|
# @return [AsyncOperationResponse]
|
44
45
|
describe 'create test' do
|
45
46
|
it 'should work' do
|
@@ -53,7 +54,7 @@ describe 'ContentFilesApi' do
|
|
53
54
|
# @param [Hash] opts the optional parameters
|
54
55
|
# @option opts [Integer] :limit Number of results to return per page.
|
55
56
|
# @option opts [Integer] :offset The initial index from which to return the results.
|
56
|
-
# @option opts [String] :ordering
|
57
|
+
# @option opts [Array<String>] :ordering Ordering
|
57
58
|
# @option opts [String] :relative_path Filter results where relative_path matches value
|
58
59
|
# @option opts [String] :repository_version Repository Version referenced by HREF
|
59
60
|
# @option opts [String] :repository_version_added Repository Version referenced by HREF
|