pulp_gem_client 0.7.5 → 0.8.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 +12 -6
- data/docs/ContentGemApi.md +17 -9
- data/docs/DistributionsGemApi.md +4 -4
- data/docs/GemGemDistribution.md +2 -0
- data/docs/GemGemDistributionResponse.md +4 -0
- data/docs/GemGemRemote.md +6 -6
- data/docs/GemGemRemoteResponse.md +8 -8
- data/docs/GemGemRepository.md +2 -0
- data/docs/GemGemRepositoryResponse.md +2 -0
- data/docs/PatchedgemGemDistribution.md +2 -0
- data/docs/PatchedgemGemRemote.md +6 -6
- data/docs/PatchedgemGemRepository.md +2 -0
- data/docs/PublicationsGemApi.md +2 -2
- data/docs/RemoteNetworkConfig.md +50 -0
- data/docs/RemoteNetworkConfigResponse.md +40 -0
- data/docs/RepositoriesGemApi.md +20 -4
- data/docs/RepositoryAddRemoveContent.md +3 -1
- data/lib/pulp_gem_client/api/content_gem_api.rb +25 -9
- data/lib/pulp_gem_client/api/distributions_gem_api.rb +4 -4
- data/lib/pulp_gem_client/api/publications_gem_api.rb +2 -2
- data/lib/pulp_gem_client/api/repositories_gem_api.rb +29 -5
- data/lib/pulp_gem_client/models/gem_gem_distribution.rb +12 -1
- data/lib/pulp_gem_client/models/gem_gem_distribution_response.rb +22 -1
- data/lib/pulp_gem_client/models/gem_gem_remote.rb +48 -33
- data/lib/pulp_gem_client/models/gem_gem_remote_response.rb +60 -45
- data/lib/pulp_gem_client/models/gem_gem_repository.rb +42 -1
- data/lib/pulp_gem_client/models/gem_gem_repository_response.rb +42 -1
- data/lib/pulp_gem_client/models/patchedgem_gem_distribution.rb +12 -1
- data/lib/pulp_gem_client/models/patchedgem_gem_remote.rb +48 -33
- data/lib/pulp_gem_client/models/patchedgem_gem_repository.rb +42 -1
- data/lib/pulp_gem_client/models/remote_network_config.rb +588 -0
- data/lib/pulp_gem_client/models/remote_network_config_response.rb +413 -0
- data/lib/pulp_gem_client/models/repository_add_remove_content.rb +16 -4
- data/lib/pulp_gem_client/models/set_label.rb +0 -11
- data/lib/pulp_gem_client/models/set_label_response.rb +0 -21
- data/lib/pulp_gem_client/models/unset_label.rb +0 -11
- data/lib/pulp_gem_client/models/unset_label_response.rb +0 -21
- data/lib/pulp_gem_client/version.rb +1 -1
- data/lib/pulp_gem_client.rb +2 -0
- data/spec/api/content_gem_api_spec.rb +8 -4
- data/spec/api/distributions_gem_api_spec.rb +2 -2
- data/spec/api/publications_gem_api_spec.rb +1 -1
- data/spec/api/repositories_gem_api_spec.rb +10 -2
- data/spec/models/gem_gem_distribution_response_spec.rb +12 -0
- data/spec/models/gem_gem_distribution_spec.rb +6 -0
- data/spec/models/gem_gem_remote_response_spec.rb +10 -10
- data/spec/models/gem_gem_remote_spec.rb +17 -17
- data/spec/models/gem_gem_repository_response_spec.rb +6 -0
- data/spec/models/gem_gem_repository_spec.rb +6 -0
- data/spec/models/patchedgem_gem_distribution_spec.rb +6 -0
- data/spec/models/patchedgem_gem_remote_spec.rb +17 -17
- data/spec/models/patchedgem_gem_repository_spec.rb +6 -0
- data/spec/models/remote_network_config_response_spec.rb +102 -0
- data/spec/models/remote_network_config_spec.rb +132 -0
- data/spec/models/repository_add_remove_content_spec.rb +6 -0
- metadata +39 -31
|
@@ -0,0 +1,413 @@
|
|
|
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
|
+
Generator version: 7.10.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module PulpGemClient
|
|
17
|
+
# Shared network configuration fields and validation logic used by both RemoteSerializer and UploadSerializerFieldsMixin.
|
|
18
|
+
class RemoteNetworkConfigResponse
|
|
19
|
+
# A PEM encoded CA certificate used to validate the server certificate presented by the remote server.
|
|
20
|
+
attr_accessor :ca_cert
|
|
21
|
+
|
|
22
|
+
# A PEM encoded client certificate used for authentication.
|
|
23
|
+
attr_accessor :client_cert
|
|
24
|
+
|
|
25
|
+
# If True, TLS peer validation must be performed.
|
|
26
|
+
attr_accessor :tls_validation
|
|
27
|
+
|
|
28
|
+
# The proxy URL. Format: scheme://host:port
|
|
29
|
+
attr_accessor :proxy_url
|
|
30
|
+
|
|
31
|
+
# Maximum number of retry attempts after a download failure. If not set then the default value (3) will be used.
|
|
32
|
+
attr_accessor :max_retries
|
|
33
|
+
|
|
34
|
+
# aiohttp.ClientTimeout.total (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
|
|
35
|
+
attr_accessor :total_timeout
|
|
36
|
+
|
|
37
|
+
# aiohttp.ClientTimeout.connect (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
|
|
38
|
+
attr_accessor :connect_timeout
|
|
39
|
+
|
|
40
|
+
# aiohttp.ClientTimeout.sock_connect (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
|
|
41
|
+
attr_accessor :sock_connect_timeout
|
|
42
|
+
|
|
43
|
+
# aiohttp.ClientTimeout.sock_read (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
|
|
44
|
+
attr_accessor :sock_read_timeout
|
|
45
|
+
|
|
46
|
+
# Headers for aiohttp.Clientsession
|
|
47
|
+
attr_accessor :headers
|
|
48
|
+
|
|
49
|
+
# Total number of simultaneous connections. If not set then the default value will be used.
|
|
50
|
+
attr_accessor :download_concurrency
|
|
51
|
+
|
|
52
|
+
# Limits requests per second for each concurrent downloader
|
|
53
|
+
attr_accessor :rate_limit
|
|
54
|
+
|
|
55
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
56
|
+
def self.attribute_map
|
|
57
|
+
{
|
|
58
|
+
:'ca_cert' => :'ca_cert',
|
|
59
|
+
:'client_cert' => :'client_cert',
|
|
60
|
+
:'tls_validation' => :'tls_validation',
|
|
61
|
+
:'proxy_url' => :'proxy_url',
|
|
62
|
+
:'max_retries' => :'max_retries',
|
|
63
|
+
:'total_timeout' => :'total_timeout',
|
|
64
|
+
:'connect_timeout' => :'connect_timeout',
|
|
65
|
+
:'sock_connect_timeout' => :'sock_connect_timeout',
|
|
66
|
+
:'sock_read_timeout' => :'sock_read_timeout',
|
|
67
|
+
:'headers' => :'headers',
|
|
68
|
+
:'download_concurrency' => :'download_concurrency',
|
|
69
|
+
:'rate_limit' => :'rate_limit'
|
|
70
|
+
}
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Returns all the JSON keys this model knows about
|
|
74
|
+
def self.acceptable_attributes
|
|
75
|
+
attribute_map.values
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Attribute type mapping.
|
|
79
|
+
def self.openapi_types
|
|
80
|
+
{
|
|
81
|
+
:'ca_cert' => :'String',
|
|
82
|
+
:'client_cert' => :'String',
|
|
83
|
+
:'tls_validation' => :'Boolean',
|
|
84
|
+
:'proxy_url' => :'String',
|
|
85
|
+
:'max_retries' => :'Integer',
|
|
86
|
+
:'total_timeout' => :'Float',
|
|
87
|
+
:'connect_timeout' => :'Float',
|
|
88
|
+
:'sock_connect_timeout' => :'Float',
|
|
89
|
+
:'sock_read_timeout' => :'Float',
|
|
90
|
+
:'headers' => :'Array<Object>',
|
|
91
|
+
:'download_concurrency' => :'Integer',
|
|
92
|
+
:'rate_limit' => :'Integer'
|
|
93
|
+
}
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# List of attributes with nullable: true
|
|
97
|
+
def self.openapi_nullable
|
|
98
|
+
Set.new([
|
|
99
|
+
:'ca_cert',
|
|
100
|
+
:'client_cert',
|
|
101
|
+
:'proxy_url',
|
|
102
|
+
:'max_retries',
|
|
103
|
+
:'total_timeout',
|
|
104
|
+
:'connect_timeout',
|
|
105
|
+
:'sock_connect_timeout',
|
|
106
|
+
:'sock_read_timeout',
|
|
107
|
+
:'download_concurrency',
|
|
108
|
+
:'rate_limit'
|
|
109
|
+
])
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Initializes the object
|
|
113
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
114
|
+
def initialize(attributes = {})
|
|
115
|
+
if (!attributes.is_a?(Hash))
|
|
116
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpGemClient::RemoteNetworkConfigResponse` initialize method"
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
120
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
121
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
122
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpGemClient::RemoteNetworkConfigResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
123
|
+
end
|
|
124
|
+
h[k.to_sym] = v
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if attributes.key?(:'ca_cert')
|
|
128
|
+
self.ca_cert = attributes[:'ca_cert']
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
if attributes.key?(:'client_cert')
|
|
132
|
+
self.client_cert = attributes[:'client_cert']
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
if attributes.key?(:'tls_validation')
|
|
136
|
+
self.tls_validation = attributes[:'tls_validation']
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
if attributes.key?(:'proxy_url')
|
|
140
|
+
self.proxy_url = attributes[:'proxy_url']
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
if attributes.key?(:'max_retries')
|
|
144
|
+
self.max_retries = attributes[:'max_retries']
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if attributes.key?(:'total_timeout')
|
|
148
|
+
self.total_timeout = attributes[:'total_timeout']
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
if attributes.key?(:'connect_timeout')
|
|
152
|
+
self.connect_timeout = attributes[:'connect_timeout']
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
if attributes.key?(:'sock_connect_timeout')
|
|
156
|
+
self.sock_connect_timeout = attributes[:'sock_connect_timeout']
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
if attributes.key?(:'sock_read_timeout')
|
|
160
|
+
self.sock_read_timeout = attributes[:'sock_read_timeout']
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
if attributes.key?(:'headers')
|
|
164
|
+
if (value = attributes[:'headers']).is_a?(Array)
|
|
165
|
+
self.headers = value
|
|
166
|
+
end
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
if attributes.key?(:'download_concurrency')
|
|
170
|
+
self.download_concurrency = attributes[:'download_concurrency']
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
if attributes.key?(:'rate_limit')
|
|
174
|
+
self.rate_limit = attributes[:'rate_limit']
|
|
175
|
+
end
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
179
|
+
# @return Array for valid properties with the reasons
|
|
180
|
+
def list_invalid_properties
|
|
181
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
182
|
+
invalid_properties = Array.new
|
|
183
|
+
if !@total_timeout.nil? && @total_timeout < 0.0
|
|
184
|
+
invalid_properties.push('invalid value for "total_timeout", must be greater than or equal to 0.0.')
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
if !@connect_timeout.nil? && @connect_timeout < 0.0
|
|
188
|
+
invalid_properties.push('invalid value for "connect_timeout", must be greater than or equal to 0.0.')
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
|
|
192
|
+
invalid_properties.push('invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.')
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
|
|
196
|
+
invalid_properties.push('invalid value for "sock_read_timeout", must be greater than or equal to 0.0.')
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
if !@download_concurrency.nil? && @download_concurrency < 1
|
|
200
|
+
invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
invalid_properties
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# Check to see if the all the properties in the model are valid
|
|
207
|
+
# @return true if the model is valid
|
|
208
|
+
def valid?
|
|
209
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
210
|
+
return false if !@total_timeout.nil? && @total_timeout < 0.0
|
|
211
|
+
return false if !@connect_timeout.nil? && @connect_timeout < 0.0
|
|
212
|
+
return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
|
|
213
|
+
return false if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
|
|
214
|
+
return false if !@download_concurrency.nil? && @download_concurrency < 1
|
|
215
|
+
true
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# Custom attribute writer method with validation
|
|
219
|
+
# @param [Object] total_timeout Value to be assigned
|
|
220
|
+
def total_timeout=(total_timeout)
|
|
221
|
+
if !total_timeout.nil? && total_timeout < 0.0
|
|
222
|
+
fail ArgumentError, 'invalid value for "total_timeout", must be greater than or equal to 0.0.'
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
@total_timeout = total_timeout
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Custom attribute writer method with validation
|
|
229
|
+
# @param [Object] connect_timeout Value to be assigned
|
|
230
|
+
def connect_timeout=(connect_timeout)
|
|
231
|
+
if !connect_timeout.nil? && connect_timeout < 0.0
|
|
232
|
+
fail ArgumentError, 'invalid value for "connect_timeout", must be greater than or equal to 0.0.'
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
@connect_timeout = connect_timeout
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
# Custom attribute writer method with validation
|
|
239
|
+
# @param [Object] sock_connect_timeout Value to be assigned
|
|
240
|
+
def sock_connect_timeout=(sock_connect_timeout)
|
|
241
|
+
if !sock_connect_timeout.nil? && sock_connect_timeout < 0.0
|
|
242
|
+
fail ArgumentError, 'invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.'
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
@sock_connect_timeout = sock_connect_timeout
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
# Custom attribute writer method with validation
|
|
249
|
+
# @param [Object] sock_read_timeout Value to be assigned
|
|
250
|
+
def sock_read_timeout=(sock_read_timeout)
|
|
251
|
+
if !sock_read_timeout.nil? && sock_read_timeout < 0.0
|
|
252
|
+
fail ArgumentError, 'invalid value for "sock_read_timeout", must be greater than or equal to 0.0.'
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
@sock_read_timeout = sock_read_timeout
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# Custom attribute writer method with validation
|
|
259
|
+
# @param [Object] download_concurrency Value to be assigned
|
|
260
|
+
def download_concurrency=(download_concurrency)
|
|
261
|
+
if !download_concurrency.nil? && download_concurrency < 1
|
|
262
|
+
fail ArgumentError, 'invalid value for "download_concurrency", must be greater than or equal to 1.'
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
@download_concurrency = download_concurrency
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
# Checks equality by comparing each attribute.
|
|
269
|
+
# @param [Object] Object to be compared
|
|
270
|
+
def ==(o)
|
|
271
|
+
return true if self.equal?(o)
|
|
272
|
+
self.class == o.class &&
|
|
273
|
+
ca_cert == o.ca_cert &&
|
|
274
|
+
client_cert == o.client_cert &&
|
|
275
|
+
tls_validation == o.tls_validation &&
|
|
276
|
+
proxy_url == o.proxy_url &&
|
|
277
|
+
max_retries == o.max_retries &&
|
|
278
|
+
total_timeout == o.total_timeout &&
|
|
279
|
+
connect_timeout == o.connect_timeout &&
|
|
280
|
+
sock_connect_timeout == o.sock_connect_timeout &&
|
|
281
|
+
sock_read_timeout == o.sock_read_timeout &&
|
|
282
|
+
headers == o.headers &&
|
|
283
|
+
download_concurrency == o.download_concurrency &&
|
|
284
|
+
rate_limit == o.rate_limit
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
# @see the `==` method
|
|
288
|
+
# @param [Object] Object to be compared
|
|
289
|
+
def eql?(o)
|
|
290
|
+
self == o
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
# Calculates hash code according to all attributes.
|
|
294
|
+
# @return [Integer] Hash code
|
|
295
|
+
def hash
|
|
296
|
+
[ca_cert, client_cert, tls_validation, proxy_url, max_retries, total_timeout, connect_timeout, sock_connect_timeout, sock_read_timeout, headers, download_concurrency, rate_limit].hash
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
# Builds the object from hash
|
|
300
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
301
|
+
# @return [Object] Returns the model itself
|
|
302
|
+
def self.build_from_hash(attributes)
|
|
303
|
+
return nil unless attributes.is_a?(Hash)
|
|
304
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
305
|
+
transformed_hash = {}
|
|
306
|
+
openapi_types.each_pair do |key, type|
|
|
307
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
308
|
+
transformed_hash["#{key}"] = nil
|
|
309
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
310
|
+
# check to ensure the input is an array given that the attribute
|
|
311
|
+
# is documented as an array but the input is not
|
|
312
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
313
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
314
|
+
end
|
|
315
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
316
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
317
|
+
end
|
|
318
|
+
end
|
|
319
|
+
new(transformed_hash)
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
# Deserializes the data based on type
|
|
323
|
+
# @param string type Data type
|
|
324
|
+
# @param string value Value to be deserialized
|
|
325
|
+
# @return [Object] Deserialized data
|
|
326
|
+
def self._deserialize(type, value)
|
|
327
|
+
case type.to_sym
|
|
328
|
+
when :Time
|
|
329
|
+
Time.parse(value)
|
|
330
|
+
when :Date
|
|
331
|
+
Date.parse(value)
|
|
332
|
+
when :String
|
|
333
|
+
value.to_s
|
|
334
|
+
when :Integer
|
|
335
|
+
value.to_i
|
|
336
|
+
when :Float
|
|
337
|
+
value.to_f
|
|
338
|
+
when :Boolean
|
|
339
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
340
|
+
true
|
|
341
|
+
else
|
|
342
|
+
false
|
|
343
|
+
end
|
|
344
|
+
when :Object
|
|
345
|
+
# generic object (usually a Hash), return directly
|
|
346
|
+
value
|
|
347
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
348
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
349
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
350
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
351
|
+
k_type = Regexp.last_match[:k_type]
|
|
352
|
+
v_type = Regexp.last_match[:v_type]
|
|
353
|
+
{}.tap do |hash|
|
|
354
|
+
value.each do |k, v|
|
|
355
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
356
|
+
end
|
|
357
|
+
end
|
|
358
|
+
else # model
|
|
359
|
+
# models (e.g. Pet) or oneOf
|
|
360
|
+
klass = PulpGemClient.const_get(type)
|
|
361
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
362
|
+
end
|
|
363
|
+
end
|
|
364
|
+
|
|
365
|
+
# Returns the string representation of the object
|
|
366
|
+
# @return [String] String presentation of the object
|
|
367
|
+
def to_s
|
|
368
|
+
to_hash.to_s
|
|
369
|
+
end
|
|
370
|
+
|
|
371
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
372
|
+
# @return [Hash] Returns the object in the form of hash
|
|
373
|
+
def to_body
|
|
374
|
+
to_hash
|
|
375
|
+
end
|
|
376
|
+
|
|
377
|
+
# Returns the object in the form of hash
|
|
378
|
+
# @return [Hash] Returns the object in the form of hash
|
|
379
|
+
def to_hash
|
|
380
|
+
hash = {}
|
|
381
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
382
|
+
value = self.send(attr)
|
|
383
|
+
if value.nil?
|
|
384
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
385
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
386
|
+
end
|
|
387
|
+
|
|
388
|
+
hash[param] = _to_hash(value)
|
|
389
|
+
end
|
|
390
|
+
hash
|
|
391
|
+
end
|
|
392
|
+
|
|
393
|
+
# Outputs non-array value in the form of hash
|
|
394
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
395
|
+
# @param [Object] value Any valid value
|
|
396
|
+
# @return [Hash] Returns the value in the form of hash
|
|
397
|
+
def _to_hash(value)
|
|
398
|
+
if value.is_a?(Array)
|
|
399
|
+
value.compact.map { |v| _to_hash(v) }
|
|
400
|
+
elsif value.is_a?(Hash)
|
|
401
|
+
{}.tap do |hash|
|
|
402
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
403
|
+
end
|
|
404
|
+
elsif value.respond_to? :to_hash
|
|
405
|
+
value.to_hash
|
|
406
|
+
else
|
|
407
|
+
value
|
|
408
|
+
end
|
|
409
|
+
end
|
|
410
|
+
|
|
411
|
+
end
|
|
412
|
+
|
|
413
|
+
end
|
|
@@ -25,12 +25,16 @@ module PulpGemClient
|
|
|
25
25
|
# A repository version whose content will be used as the initial set of content for the new repository version
|
|
26
26
|
attr_accessor :base_version
|
|
27
27
|
|
|
28
|
+
# When set to true, existing content in the repository with the same unique key will be silently overwritten. When set to false, the task will fail if content would be overwritten. Defaults to true.
|
|
29
|
+
attr_accessor :overwrite
|
|
30
|
+
|
|
28
31
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
32
|
def self.attribute_map
|
|
30
33
|
{
|
|
31
34
|
:'add_content_units' => :'add_content_units',
|
|
32
35
|
:'remove_content_units' => :'remove_content_units',
|
|
33
|
-
:'base_version' => :'base_version'
|
|
36
|
+
:'base_version' => :'base_version',
|
|
37
|
+
:'overwrite' => :'overwrite'
|
|
34
38
|
}
|
|
35
39
|
end
|
|
36
40
|
|
|
@@ -44,7 +48,8 @@ module PulpGemClient
|
|
|
44
48
|
{
|
|
45
49
|
:'add_content_units' => :'Array<String>',
|
|
46
50
|
:'remove_content_units' => :'Array<String>',
|
|
47
|
-
:'base_version' => :'String'
|
|
51
|
+
:'base_version' => :'String',
|
|
52
|
+
:'overwrite' => :'Boolean'
|
|
48
53
|
}
|
|
49
54
|
end
|
|
50
55
|
|
|
@@ -84,6 +89,12 @@ module PulpGemClient
|
|
|
84
89
|
if attributes.key?(:'base_version')
|
|
85
90
|
self.base_version = attributes[:'base_version']
|
|
86
91
|
end
|
|
92
|
+
|
|
93
|
+
if attributes.key?(:'overwrite')
|
|
94
|
+
self.overwrite = attributes[:'overwrite']
|
|
95
|
+
else
|
|
96
|
+
self.overwrite = true
|
|
97
|
+
end
|
|
87
98
|
end
|
|
88
99
|
|
|
89
100
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -108,7 +119,8 @@ module PulpGemClient
|
|
|
108
119
|
self.class == o.class &&
|
|
109
120
|
add_content_units == o.add_content_units &&
|
|
110
121
|
remove_content_units == o.remove_content_units &&
|
|
111
|
-
base_version == o.base_version
|
|
122
|
+
base_version == o.base_version &&
|
|
123
|
+
overwrite == o.overwrite
|
|
112
124
|
end
|
|
113
125
|
|
|
114
126
|
# @see the `==` method
|
|
@@ -120,7 +132,7 @@ module PulpGemClient
|
|
|
120
132
|
# Calculates hash code according to all attributes.
|
|
121
133
|
# @return [Integer] Hash code
|
|
122
134
|
def hash
|
|
123
|
-
[add_content_units, remove_content_units, base_version].hash
|
|
135
|
+
[add_content_units, remove_content_units, base_version, overwrite].hash
|
|
124
136
|
end
|
|
125
137
|
|
|
126
138
|
# Builds the object from hash
|
|
@@ -89,11 +89,6 @@ module PulpGemClient
|
|
|
89
89
|
invalid_properties.push('invalid value for "key", the character length must be great than or equal to 1.')
|
|
90
90
|
end
|
|
91
91
|
|
|
92
|
-
pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
|
93
|
-
if @key !~ pattern
|
|
94
|
-
invalid_properties.push("invalid value for \"key\", must conform to the pattern #{pattern}.")
|
|
95
|
-
end
|
|
96
|
-
|
|
97
92
|
invalid_properties
|
|
98
93
|
end
|
|
99
94
|
|
|
@@ -103,7 +98,6 @@ module PulpGemClient
|
|
|
103
98
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
104
99
|
return false if @key.nil?
|
|
105
100
|
return false if @key.to_s.length < 1
|
|
106
|
-
return false if @key !~ Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
|
107
101
|
true
|
|
108
102
|
end
|
|
109
103
|
|
|
@@ -118,11 +112,6 @@ module PulpGemClient
|
|
|
118
112
|
fail ArgumentError, 'invalid value for "key", the character length must be great than or equal to 1.'
|
|
119
113
|
end
|
|
120
114
|
|
|
121
|
-
pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
|
122
|
-
if key !~ pattern
|
|
123
|
-
fail ArgumentError, "invalid value for \"key\", must conform to the pattern #{pattern}."
|
|
124
|
-
end
|
|
125
|
-
|
|
126
115
|
@key = key
|
|
127
116
|
end
|
|
128
117
|
|
|
@@ -85,11 +85,6 @@ module PulpGemClient
|
|
|
85
85
|
invalid_properties.push('invalid value for "key", key cannot be nil.')
|
|
86
86
|
end
|
|
87
87
|
|
|
88
|
-
pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
|
89
|
-
if @key !~ pattern
|
|
90
|
-
invalid_properties.push("invalid value for \"key\", must conform to the pattern #{pattern}.")
|
|
91
|
-
end
|
|
92
|
-
|
|
93
88
|
invalid_properties
|
|
94
89
|
end
|
|
95
90
|
|
|
@@ -98,25 +93,9 @@ module PulpGemClient
|
|
|
98
93
|
def valid?
|
|
99
94
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
100
95
|
return false if @key.nil?
|
|
101
|
-
return false if @key !~ Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
|
102
96
|
true
|
|
103
97
|
end
|
|
104
98
|
|
|
105
|
-
# Custom attribute writer method with validation
|
|
106
|
-
# @param [Object] key Value to be assigned
|
|
107
|
-
def key=(key)
|
|
108
|
-
if key.nil?
|
|
109
|
-
fail ArgumentError, 'key cannot be nil'
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
|
113
|
-
if key !~ pattern
|
|
114
|
-
fail ArgumentError, "invalid value for \"key\", must conform to the pattern #{pattern}."
|
|
115
|
-
end
|
|
116
|
-
|
|
117
|
-
@key = key
|
|
118
|
-
end
|
|
119
|
-
|
|
120
99
|
# Checks equality by comparing each attribute.
|
|
121
100
|
# @param [Object] Object to be compared
|
|
122
101
|
def ==(o)
|
|
@@ -78,11 +78,6 @@ module PulpGemClient
|
|
|
78
78
|
invalid_properties.push('invalid value for "key", the character length must be great than or equal to 1.')
|
|
79
79
|
end
|
|
80
80
|
|
|
81
|
-
pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
|
82
|
-
if @key !~ pattern
|
|
83
|
-
invalid_properties.push("invalid value for \"key\", must conform to the pattern #{pattern}.")
|
|
84
|
-
end
|
|
85
|
-
|
|
86
81
|
invalid_properties
|
|
87
82
|
end
|
|
88
83
|
|
|
@@ -92,7 +87,6 @@ module PulpGemClient
|
|
|
92
87
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
93
88
|
return false if @key.nil?
|
|
94
89
|
return false if @key.to_s.length < 1
|
|
95
|
-
return false if @key !~ Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
|
96
90
|
true
|
|
97
91
|
end
|
|
98
92
|
|
|
@@ -107,11 +101,6 @@ module PulpGemClient
|
|
|
107
101
|
fail ArgumentError, 'invalid value for "key", the character length must be great than or equal to 1.'
|
|
108
102
|
end
|
|
109
103
|
|
|
110
|
-
pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
|
111
|
-
if key !~ pattern
|
|
112
|
-
fail ArgumentError, "invalid value for \"key\", must conform to the pattern #{pattern}."
|
|
113
|
-
end
|
|
114
|
-
|
|
115
104
|
@key = key
|
|
116
105
|
end
|
|
117
106
|
|
|
@@ -82,11 +82,6 @@ module PulpGemClient
|
|
|
82
82
|
invalid_properties.push('invalid value for "key", key cannot be nil.')
|
|
83
83
|
end
|
|
84
84
|
|
|
85
|
-
pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
|
86
|
-
if @key !~ pattern
|
|
87
|
-
invalid_properties.push("invalid value for \"key\", must conform to the pattern #{pattern}.")
|
|
88
|
-
end
|
|
89
|
-
|
|
90
85
|
invalid_properties
|
|
91
86
|
end
|
|
92
87
|
|
|
@@ -95,25 +90,9 @@ module PulpGemClient
|
|
|
95
90
|
def valid?
|
|
96
91
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
97
92
|
return false if @key.nil?
|
|
98
|
-
return false if @key !~ Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
|
99
93
|
true
|
|
100
94
|
end
|
|
101
95
|
|
|
102
|
-
# Custom attribute writer method with validation
|
|
103
|
-
# @param [Object] key Value to be assigned
|
|
104
|
-
def key=(key)
|
|
105
|
-
if key.nil?
|
|
106
|
-
fail ArgumentError, 'key cannot be nil'
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
|
110
|
-
if key !~ pattern
|
|
111
|
-
fail ArgumentError, "invalid value for \"key\", must conform to the pattern #{pattern}."
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
@key = key
|
|
115
|
-
end
|
|
116
|
-
|
|
117
96
|
# Checks equality by comparing each attribute.
|
|
118
97
|
# @param [Object] Object to be compared
|
|
119
98
|
def ==(o)
|
data/lib/pulp_gem_client.rb
CHANGED
|
@@ -43,6 +43,8 @@ require 'pulp_gem_client/models/patchedgem_gem_distribution'
|
|
|
43
43
|
require 'pulp_gem_client/models/patchedgem_gem_remote'
|
|
44
44
|
require 'pulp_gem_client/models/patchedgem_gem_repository'
|
|
45
45
|
require 'pulp_gem_client/models/policy_enum'
|
|
46
|
+
require 'pulp_gem_client/models/remote_network_config'
|
|
47
|
+
require 'pulp_gem_client/models/remote_network_config_response'
|
|
46
48
|
require 'pulp_gem_client/models/repair'
|
|
47
49
|
require 'pulp_gem_client/models/repository_add_remove_content'
|
|
48
50
|
require 'pulp_gem_client/models/repository_sync_url'
|
|
@@ -38,9 +38,13 @@ describe 'ContentGemApi' do
|
|
|
38
38
|
# @param [Hash] opts the optional parameters
|
|
39
39
|
# @option opts [Array<String>] :x_task_diagnostics List of profilers to use on tasks.
|
|
40
40
|
# @option opts [String] :repository A URI of a repository the new content unit should be associated with.
|
|
41
|
+
# @option opts [Boolean] :overwrite When set to true, existing content in the repository with the same unique key will be silently overwritten. When set to false, the task will fail if content would be overwritten. Only used when 'repository' is specified. Defaults to true.
|
|
41
42
|
# @option opts [Hash<String, String>] :pulp_labels A dictionary of arbitrary key/value pairs used to describe a specific Content instance.
|
|
43
|
+
# @option opts [File] :file An uploaded file that may be turned into the content unit.
|
|
44
|
+
# @option opts [String] :upload An uncommitted upload that may be turned into the content unit.
|
|
45
|
+
# @option opts [String] :file_url A url that Pulp can download and turn into the content unit.
|
|
46
|
+
# @option opts [RemoteNetworkConfig] :downloader_config Configuration for the download process (e.g., proxies, auth, timeouts). Only applicable when providing a 'file_url.
|
|
42
47
|
# @option opts [String] :artifact Artifact file representing the physical content
|
|
43
|
-
# @option opts [File] :file An uploaded file that should be turned into the artifact of the content unit.
|
|
44
48
|
# @return [AsyncOperationResponse]
|
|
45
49
|
describe 'create test' do
|
|
46
50
|
it 'should work' do
|
|
@@ -65,9 +69,9 @@ describe 'ContentGemApi' do
|
|
|
65
69
|
# @option opts [Array<String>] :pulp_id__in Multiple values may be separated by commas.
|
|
66
70
|
# @option opts [String] :pulp_label_select Filter labels by search string
|
|
67
71
|
# @option opts [String] :q Filter results by using NOT, AND and OR operations on other filters
|
|
68
|
-
# @option opts [String] :repository_version
|
|
69
|
-
# @option opts [String] :repository_version_added
|
|
70
|
-
# @option opts [String] :repository_version_removed
|
|
72
|
+
# @option opts [String] :repository_version
|
|
73
|
+
# @option opts [String] :repository_version_added
|
|
74
|
+
# @option opts [String] :repository_version_removed
|
|
71
75
|
# @option opts [String] :version Filter results where version matches value
|
|
72
76
|
# @option opts [Array<String>] :fields A list of fields to include in the response.
|
|
73
77
|
# @option opts [Array<String>] :exclude_fields A list of fields to exclude from the response.
|
|
@@ -99,8 +99,8 @@ describe 'DistributionsGemApi' do
|
|
|
99
99
|
# @option opts [Array<String>] :pulp_id__in Multiple values may be separated by commas.
|
|
100
100
|
# @option opts [String] :pulp_label_select Filter labels by search string
|
|
101
101
|
# @option opts [String] :q Filter results by using NOT, AND and OR operations on other filters
|
|
102
|
-
# @option opts [String] :repository
|
|
103
|
-
# @option opts [Array<String>] :repository__in
|
|
102
|
+
# @option opts [String] :repository
|
|
103
|
+
# @option opts [Array<String>] :repository__in
|
|
104
104
|
# @option opts [String] :with_content Filter distributions based on the content served by them
|
|
105
105
|
# @option opts [Array<String>] :fields A list of fields to include in the response.
|
|
106
106
|
# @option opts [Array<String>] :exclude_fields A list of fields to exclude from the response.
|
|
@@ -95,7 +95,7 @@ describe 'PublicationsGemApi' do
|
|
|
95
95
|
# @option opts [Array<String>] :pulp_id__in Multiple values may be separated by commas.
|
|
96
96
|
# @option opts [String] :q Filter results by using NOT, AND and OR operations on other filters
|
|
97
97
|
# @option opts [String] :repository Repository referenced by HREF/PRN
|
|
98
|
-
# @option opts [String] :repository_version
|
|
98
|
+
# @option opts [String] :repository_version
|
|
99
99
|
# @option opts [Array<String>] :fields A list of fields to include in the response.
|
|
100
100
|
# @option opts [Array<String>] :exclude_fields A list of fields to exclude from the response.
|
|
101
101
|
# @return [PaginatedgemGemPublicationResponseList]
|