pulp_gem_client 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +160 -0
- data/Rakefile +10 -0
- data/docs/AsyncOperationResponse.md +17 -0
- data/docs/ContentGemApi.md +210 -0
- data/docs/ContentSummaryResponse.md +21 -0
- data/docs/DistributionsGemApi.md +382 -0
- data/docs/GemGemContent.md +21 -0
- data/docs/GemGemContentResponse.md +35 -0
- data/docs/GemGemDistribution.md +31 -0
- data/docs/GemGemDistributionResponse.md +37 -0
- data/docs/GemGemPublication.md +19 -0
- data/docs/GemGemPublicationResponse.md +23 -0
- data/docs/GemGemRemote.md +63 -0
- data/docs/GemGemRemoteResponse.md +61 -0
- data/docs/GemGemRemoteResponseHiddenFields.md +19 -0
- data/docs/GemGemRepository.md +25 -0
- data/docs/GemGemRepositoryResponse.md +33 -0
- data/docs/PaginatedRepositoryVersionResponseList.md +23 -0
- data/docs/PaginatedgemGemContentResponseList.md +23 -0
- data/docs/PaginatedgemGemDistributionResponseList.md +23 -0
- data/docs/PaginatedgemGemPublicationResponseList.md +23 -0
- data/docs/PaginatedgemGemRemoteResponseList.md +23 -0
- data/docs/PaginatedgemGemRepositoryResponseList.md +23 -0
- data/docs/PatchedgemGemDistribution.md +31 -0
- data/docs/PatchedgemGemRemote.md +63 -0
- data/docs/PatchedgemGemRepository.md +25 -0
- data/docs/PolicyEnum.md +16 -0
- data/docs/PublicationsGemApi.md +263 -0
- data/docs/RemotesGemApi.md +380 -0
- data/docs/Repair.md +17 -0
- data/docs/RepositoriesGemApi.md +502 -0
- data/docs/RepositoriesGemVersionsApi.md +273 -0
- data/docs/RepositoryAddRemoveContent.md +21 -0
- data/docs/RepositorySyncURL.md +19 -0
- data/docs/RepositoryVersionResponse.md +27 -0
- data/lib/pulp_gem_client/api/content_gem_api.rb +259 -0
- data/lib/pulp_gem_client/api/distributions_gem_api.rb +476 -0
- data/lib/pulp_gem_client/api/publications_gem_api.rb +325 -0
- data/lib/pulp_gem_client/api/remotes_gem_api.rb +473 -0
- data/lib/pulp_gem_client/api/repositories_gem_api.rb +628 -0
- data/lib/pulp_gem_client/api/repositories_gem_versions_api.rb +346 -0
- data/lib/pulp_gem_client/api_client.rb +403 -0
- data/lib/pulp_gem_client/api_error.rb +57 -0
- data/lib/pulp_gem_client/configuration.rb +251 -0
- data/lib/pulp_gem_client/models/async_operation_response.rb +213 -0
- data/lib/pulp_gem_client/models/content_summary_response.rb +246 -0
- data/lib/pulp_gem_client/models/gem_gem_content.rb +228 -0
- data/lib/pulp_gem_client/models/gem_gem_content_response.rb +303 -0
- data/lib/pulp_gem_client/models/gem_gem_distribution.rb +333 -0
- data/lib/pulp_gem_client/models/gem_gem_distribution_response.rb +324 -0
- data/lib/pulp_gem_client/models/gem_gem_publication.rb +217 -0
- data/lib/pulp_gem_client/models/gem_gem_publication_response.rb +236 -0
- data/lib/pulp_gem_client/models/gem_gem_remote.rb +704 -0
- data/lib/pulp_gem_client/models/gem_gem_remote_response.rb +532 -0
- data/lib/pulp_gem_client/models/gem_gem_remote_response_hidden_fields.rb +215 -0
- data/lib/pulp_gem_client/models/gem_gem_repository.rb +306 -0
- data/lib/pulp_gem_client/models/gem_gem_repository_response.rb +309 -0
- data/lib/pulp_gem_client/models/paginated_repository_version_response_list.rb +237 -0
- data/lib/pulp_gem_client/models/paginatedgem_gem_content_response_list.rb +237 -0
- data/lib/pulp_gem_client/models/paginatedgem_gem_distribution_response_list.rb +237 -0
- data/lib/pulp_gem_client/models/paginatedgem_gem_publication_response_list.rb +237 -0
- data/lib/pulp_gem_client/models/paginatedgem_gem_remote_response_list.rb +237 -0
- data/lib/pulp_gem_client/models/paginatedgem_gem_repository_response_list.rb +237 -0
- data/lib/pulp_gem_client/models/patchedgem_gem_distribution.rb +315 -0
- data/lib/pulp_gem_client/models/patchedgem_gem_remote.rb +686 -0
- data/lib/pulp_gem_client/models/patchedgem_gem_repository.rb +297 -0
- data/lib/pulp_gem_client/models/policy_enum.rb +37 -0
- data/lib/pulp_gem_client/models/repair.rb +209 -0
- data/lib/pulp_gem_client/models/repository_add_remove_content.rb +232 -0
- data/lib/pulp_gem_client/models/repository_sync_url.rb +220 -0
- data/lib/pulp_gem_client/models/repository_version_response.rb +255 -0
- data/lib/pulp_gem_client/version.rb +15 -0
- data/lib/pulp_gem_client.rb +72 -0
- data/pulp_gem_client.gemspec +39 -0
- data/spec/api/content_gem_api_spec.rb +88 -0
- data/spec/api/distributions_gem_api_spec.rb +130 -0
- data/spec/api/publications_gem_api_spec.rb +101 -0
- data/spec/api/remotes_gem_api_spec.rb +129 -0
- data/spec/api/repositories_gem_api_spec.rb +160 -0
- data/spec/api/repositories_gem_versions_api_spec.rb +105 -0
- data/spec/api_client_spec.rb +188 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/async_operation_response_spec.rb +41 -0
- data/spec/models/content_summary_response_spec.rb +53 -0
- data/spec/models/gem_gem_content_response_spec.rb +95 -0
- data/spec/models/gem_gem_content_spec.rb +53 -0
- data/spec/models/gem_gem_distribution_response_spec.rb +101 -0
- data/spec/models/gem_gem_distribution_spec.rb +83 -0
- data/spec/models/gem_gem_publication_response_spec.rb +59 -0
- data/spec/models/gem_gem_publication_spec.rb +47 -0
- data/spec/models/gem_gem_remote_response_hidden_fields_spec.rb +47 -0
- data/spec/models/gem_gem_remote_response_spec.rb +173 -0
- data/spec/models/gem_gem_remote_spec.rb +179 -0
- data/spec/models/gem_gem_repository_response_spec.rb +89 -0
- data/spec/models/gem_gem_repository_spec.rb +65 -0
- data/spec/models/paginated_repository_version_response_list_spec.rb +59 -0
- data/spec/models/paginatedgem_gem_content_response_list_spec.rb +59 -0
- data/spec/models/paginatedgem_gem_distribution_response_list_spec.rb +59 -0
- data/spec/models/paginatedgem_gem_publication_response_list_spec.rb +59 -0
- data/spec/models/paginatedgem_gem_remote_response_list_spec.rb +59 -0
- data/spec/models/paginatedgem_gem_repository_response_list_spec.rb +59 -0
- data/spec/models/patchedgem_gem_distribution_spec.rb +83 -0
- data/spec/models/patchedgem_gem_remote_spec.rb +179 -0
- data/spec/models/patchedgem_gem_repository_spec.rb +65 -0
- data/spec/models/policy_enum_spec.rb +35 -0
- data/spec/models/repair_spec.rb +41 -0
- data/spec/models/repository_add_remove_content_spec.rb +53 -0
- data/spec/models/repository_sync_url_spec.rb +47 -0
- data/spec/models/repository_version_response_spec.rb +71 -0
- data/spec/spec_helper.rb +111 -0
- metadata +250 -0
@@ -0,0 +1,532 @@
|
|
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 PulpGemClient
|
16
|
+
# A Serializer for GemRemote.
|
17
|
+
class GemGemRemoteResponse
|
18
|
+
attr_accessor :pulp_href
|
19
|
+
|
20
|
+
# Timestamp of creation.
|
21
|
+
attr_accessor :pulp_created
|
22
|
+
|
23
|
+
# A unique name for this remote.
|
24
|
+
attr_accessor :name
|
25
|
+
|
26
|
+
# The URL of an external content source.
|
27
|
+
attr_accessor :url
|
28
|
+
|
29
|
+
# A PEM encoded CA certificate used to validate the server certificate presented by the remote server.
|
30
|
+
attr_accessor :ca_cert
|
31
|
+
|
32
|
+
# A PEM encoded client certificate used for authentication.
|
33
|
+
attr_accessor :client_cert
|
34
|
+
|
35
|
+
# If True, TLS peer validation must be performed.
|
36
|
+
attr_accessor :tls_validation
|
37
|
+
|
38
|
+
# The proxy URL. Format: scheme://host:port
|
39
|
+
attr_accessor :proxy_url
|
40
|
+
|
41
|
+
attr_accessor :pulp_labels
|
42
|
+
|
43
|
+
# Timestamp of the most recent update of the remote.
|
44
|
+
attr_accessor :pulp_last_updated
|
45
|
+
|
46
|
+
# Total number of simultaneous connections. If not set then the default value will be used.
|
47
|
+
attr_accessor :download_concurrency
|
48
|
+
|
49
|
+
# Maximum number of retry attempts after a download failure. If not set then the default value (3) will be used.
|
50
|
+
attr_accessor :max_retries
|
51
|
+
|
52
|
+
# The policy to use when downloading content. The possible values include: 'immediate', 'on_demand', and 'streamed'. 'immediate' is the default. * `immediate` - When syncing, download all metadata and content now. * `on_demand` - When syncing, download metadata, but do not download content now. Instead, download content as clients request it, and save it in Pulp to be served for future client requests. * `streamed` - When syncing, download metadata, but do not download content now. Instead,download content as clients request it, but never save it in Pulp. This causes future requests for that same content to have to be downloaded again.
|
53
|
+
attr_accessor :policy
|
54
|
+
|
55
|
+
# aiohttp.ClientTimeout.total (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
|
56
|
+
attr_accessor :total_timeout
|
57
|
+
|
58
|
+
# aiohttp.ClientTimeout.connect (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
|
59
|
+
attr_accessor :connect_timeout
|
60
|
+
|
61
|
+
# 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.
|
62
|
+
attr_accessor :sock_connect_timeout
|
63
|
+
|
64
|
+
# 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.
|
65
|
+
attr_accessor :sock_read_timeout
|
66
|
+
|
67
|
+
# Headers for aiohttp.Clientsession
|
68
|
+
attr_accessor :headers
|
69
|
+
|
70
|
+
# Limits requests per second for each concurrent downloader
|
71
|
+
attr_accessor :rate_limit
|
72
|
+
|
73
|
+
# List of hidden (write only) fields
|
74
|
+
attr_accessor :hidden_fields
|
75
|
+
|
76
|
+
attr_accessor :prereleases
|
77
|
+
|
78
|
+
attr_accessor :includes
|
79
|
+
|
80
|
+
attr_accessor :excludes
|
81
|
+
|
82
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
83
|
+
def self.attribute_map
|
84
|
+
{
|
85
|
+
:'pulp_href' => :'pulp_href',
|
86
|
+
:'pulp_created' => :'pulp_created',
|
87
|
+
:'name' => :'name',
|
88
|
+
:'url' => :'url',
|
89
|
+
:'ca_cert' => :'ca_cert',
|
90
|
+
:'client_cert' => :'client_cert',
|
91
|
+
:'tls_validation' => :'tls_validation',
|
92
|
+
:'proxy_url' => :'proxy_url',
|
93
|
+
:'pulp_labels' => :'pulp_labels',
|
94
|
+
:'pulp_last_updated' => :'pulp_last_updated',
|
95
|
+
:'download_concurrency' => :'download_concurrency',
|
96
|
+
:'max_retries' => :'max_retries',
|
97
|
+
:'policy' => :'policy',
|
98
|
+
:'total_timeout' => :'total_timeout',
|
99
|
+
:'connect_timeout' => :'connect_timeout',
|
100
|
+
:'sock_connect_timeout' => :'sock_connect_timeout',
|
101
|
+
:'sock_read_timeout' => :'sock_read_timeout',
|
102
|
+
:'headers' => :'headers',
|
103
|
+
:'rate_limit' => :'rate_limit',
|
104
|
+
:'hidden_fields' => :'hidden_fields',
|
105
|
+
:'prereleases' => :'prereleases',
|
106
|
+
:'includes' => :'includes',
|
107
|
+
:'excludes' => :'excludes'
|
108
|
+
}
|
109
|
+
end
|
110
|
+
|
111
|
+
# Attribute type mapping.
|
112
|
+
def self.openapi_types
|
113
|
+
{
|
114
|
+
:'pulp_href' => :'String',
|
115
|
+
:'pulp_created' => :'DateTime',
|
116
|
+
:'name' => :'String',
|
117
|
+
:'url' => :'String',
|
118
|
+
:'ca_cert' => :'String',
|
119
|
+
:'client_cert' => :'String',
|
120
|
+
:'tls_validation' => :'Boolean',
|
121
|
+
:'proxy_url' => :'String',
|
122
|
+
:'pulp_labels' => :'Hash<String, String>',
|
123
|
+
:'pulp_last_updated' => :'DateTime',
|
124
|
+
:'download_concurrency' => :'Integer',
|
125
|
+
:'max_retries' => :'Integer',
|
126
|
+
:'policy' => :'PolicyEnum',
|
127
|
+
:'total_timeout' => :'Float',
|
128
|
+
:'connect_timeout' => :'Float',
|
129
|
+
:'sock_connect_timeout' => :'Float',
|
130
|
+
:'sock_read_timeout' => :'Float',
|
131
|
+
:'headers' => :'Array<Object>',
|
132
|
+
:'rate_limit' => :'Integer',
|
133
|
+
:'hidden_fields' => :'Array<GemGemRemoteResponseHiddenFields>',
|
134
|
+
:'prereleases' => :'Boolean',
|
135
|
+
:'includes' => :'Hash<String, String>',
|
136
|
+
:'excludes' => :'Hash<String, String>'
|
137
|
+
}
|
138
|
+
end
|
139
|
+
|
140
|
+
# List of attributes with nullable: true
|
141
|
+
def self.openapi_nullable
|
142
|
+
Set.new([
|
143
|
+
:'ca_cert',
|
144
|
+
:'client_cert',
|
145
|
+
:'proxy_url',
|
146
|
+
:'download_concurrency',
|
147
|
+
:'max_retries',
|
148
|
+
:'total_timeout',
|
149
|
+
:'connect_timeout',
|
150
|
+
:'sock_connect_timeout',
|
151
|
+
:'sock_read_timeout',
|
152
|
+
:'rate_limit',
|
153
|
+
:'includes',
|
154
|
+
:'excludes'
|
155
|
+
])
|
156
|
+
end
|
157
|
+
|
158
|
+
# Initializes the object
|
159
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
160
|
+
def initialize(attributes = {})
|
161
|
+
if (!attributes.is_a?(Hash))
|
162
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpGemClient::GemGemRemoteResponse` initialize method"
|
163
|
+
end
|
164
|
+
|
165
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
166
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
167
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
168
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpGemClient::GemGemRemoteResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
169
|
+
end
|
170
|
+
h[k.to_sym] = v
|
171
|
+
}
|
172
|
+
|
173
|
+
if attributes.key?(:'pulp_href')
|
174
|
+
self.pulp_href = attributes[:'pulp_href']
|
175
|
+
end
|
176
|
+
|
177
|
+
if attributes.key?(:'pulp_created')
|
178
|
+
self.pulp_created = attributes[:'pulp_created']
|
179
|
+
end
|
180
|
+
|
181
|
+
if attributes.key?(:'name')
|
182
|
+
self.name = attributes[:'name']
|
183
|
+
end
|
184
|
+
|
185
|
+
if attributes.key?(:'url')
|
186
|
+
self.url = attributes[:'url']
|
187
|
+
end
|
188
|
+
|
189
|
+
if attributes.key?(:'ca_cert')
|
190
|
+
self.ca_cert = attributes[:'ca_cert']
|
191
|
+
end
|
192
|
+
|
193
|
+
if attributes.key?(:'client_cert')
|
194
|
+
self.client_cert = attributes[:'client_cert']
|
195
|
+
end
|
196
|
+
|
197
|
+
if attributes.key?(:'tls_validation')
|
198
|
+
self.tls_validation = attributes[:'tls_validation']
|
199
|
+
end
|
200
|
+
|
201
|
+
if attributes.key?(:'proxy_url')
|
202
|
+
self.proxy_url = attributes[:'proxy_url']
|
203
|
+
end
|
204
|
+
|
205
|
+
if attributes.key?(:'pulp_labels')
|
206
|
+
if (value = attributes[:'pulp_labels']).is_a?(Hash)
|
207
|
+
self.pulp_labels = value
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
if attributes.key?(:'pulp_last_updated')
|
212
|
+
self.pulp_last_updated = attributes[:'pulp_last_updated']
|
213
|
+
end
|
214
|
+
|
215
|
+
if attributes.key?(:'download_concurrency')
|
216
|
+
self.download_concurrency = attributes[:'download_concurrency']
|
217
|
+
end
|
218
|
+
|
219
|
+
if attributes.key?(:'max_retries')
|
220
|
+
self.max_retries = attributes[:'max_retries']
|
221
|
+
end
|
222
|
+
|
223
|
+
if attributes.key?(:'policy')
|
224
|
+
self.policy = attributes[:'policy']
|
225
|
+
end
|
226
|
+
|
227
|
+
if attributes.key?(:'total_timeout')
|
228
|
+
self.total_timeout = attributes[:'total_timeout']
|
229
|
+
end
|
230
|
+
|
231
|
+
if attributes.key?(:'connect_timeout')
|
232
|
+
self.connect_timeout = attributes[:'connect_timeout']
|
233
|
+
end
|
234
|
+
|
235
|
+
if attributes.key?(:'sock_connect_timeout')
|
236
|
+
self.sock_connect_timeout = attributes[:'sock_connect_timeout']
|
237
|
+
end
|
238
|
+
|
239
|
+
if attributes.key?(:'sock_read_timeout')
|
240
|
+
self.sock_read_timeout = attributes[:'sock_read_timeout']
|
241
|
+
end
|
242
|
+
|
243
|
+
if attributes.key?(:'headers')
|
244
|
+
if (value = attributes[:'headers']).is_a?(Array)
|
245
|
+
self.headers = value
|
246
|
+
end
|
247
|
+
end
|
248
|
+
|
249
|
+
if attributes.key?(:'rate_limit')
|
250
|
+
self.rate_limit = attributes[:'rate_limit']
|
251
|
+
end
|
252
|
+
|
253
|
+
if attributes.key?(:'hidden_fields')
|
254
|
+
if (value = attributes[:'hidden_fields']).is_a?(Array)
|
255
|
+
self.hidden_fields = value
|
256
|
+
end
|
257
|
+
end
|
258
|
+
|
259
|
+
if attributes.key?(:'prereleases')
|
260
|
+
self.prereleases = attributes[:'prereleases']
|
261
|
+
else
|
262
|
+
self.prereleases = false
|
263
|
+
end
|
264
|
+
|
265
|
+
if attributes.key?(:'includes')
|
266
|
+
if (value = attributes[:'includes']).is_a?(Hash)
|
267
|
+
self.includes = value
|
268
|
+
end
|
269
|
+
end
|
270
|
+
|
271
|
+
if attributes.key?(:'excludes')
|
272
|
+
if (value = attributes[:'excludes']).is_a?(Hash)
|
273
|
+
self.excludes = value
|
274
|
+
end
|
275
|
+
end
|
276
|
+
end
|
277
|
+
|
278
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
279
|
+
# @return Array for valid properties with the reasons
|
280
|
+
def list_invalid_properties
|
281
|
+
invalid_properties = Array.new
|
282
|
+
if @name.nil?
|
283
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
284
|
+
end
|
285
|
+
|
286
|
+
if @url.nil?
|
287
|
+
invalid_properties.push('invalid value for "url", url cannot be nil.')
|
288
|
+
end
|
289
|
+
|
290
|
+
if !@download_concurrency.nil? && @download_concurrency < 1
|
291
|
+
invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
|
292
|
+
end
|
293
|
+
|
294
|
+
if !@total_timeout.nil? && @total_timeout < 0.0
|
295
|
+
invalid_properties.push('invalid value for "total_timeout", must be greater than or equal to 0.0.')
|
296
|
+
end
|
297
|
+
|
298
|
+
if !@connect_timeout.nil? && @connect_timeout < 0.0
|
299
|
+
invalid_properties.push('invalid value for "connect_timeout", must be greater than or equal to 0.0.')
|
300
|
+
end
|
301
|
+
|
302
|
+
if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
|
303
|
+
invalid_properties.push('invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.')
|
304
|
+
end
|
305
|
+
|
306
|
+
if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
|
307
|
+
invalid_properties.push('invalid value for "sock_read_timeout", must be greater than or equal to 0.0.')
|
308
|
+
end
|
309
|
+
|
310
|
+
invalid_properties
|
311
|
+
end
|
312
|
+
|
313
|
+
# Check to see if the all the properties in the model are valid
|
314
|
+
# @return true if the model is valid
|
315
|
+
def valid?
|
316
|
+
return false if @name.nil?
|
317
|
+
return false if @url.nil?
|
318
|
+
return false if !@download_concurrency.nil? && @download_concurrency < 1
|
319
|
+
return false if !@total_timeout.nil? && @total_timeout < 0.0
|
320
|
+
return false if !@connect_timeout.nil? && @connect_timeout < 0.0
|
321
|
+
return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
|
322
|
+
return false if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
|
323
|
+
true
|
324
|
+
end
|
325
|
+
|
326
|
+
# Custom attribute writer method with validation
|
327
|
+
# @param [Object] download_concurrency Value to be assigned
|
328
|
+
def download_concurrency=(download_concurrency)
|
329
|
+
if !download_concurrency.nil? && download_concurrency < 1
|
330
|
+
fail ArgumentError, 'invalid value for "download_concurrency", must be greater than or equal to 1.'
|
331
|
+
end
|
332
|
+
|
333
|
+
@download_concurrency = download_concurrency
|
334
|
+
end
|
335
|
+
|
336
|
+
# Custom attribute writer method with validation
|
337
|
+
# @param [Object] total_timeout Value to be assigned
|
338
|
+
def total_timeout=(total_timeout)
|
339
|
+
if !total_timeout.nil? && total_timeout < 0.0
|
340
|
+
fail ArgumentError, 'invalid value for "total_timeout", must be greater than or equal to 0.0.'
|
341
|
+
end
|
342
|
+
|
343
|
+
@total_timeout = total_timeout
|
344
|
+
end
|
345
|
+
|
346
|
+
# Custom attribute writer method with validation
|
347
|
+
# @param [Object] connect_timeout Value to be assigned
|
348
|
+
def connect_timeout=(connect_timeout)
|
349
|
+
if !connect_timeout.nil? && connect_timeout < 0.0
|
350
|
+
fail ArgumentError, 'invalid value for "connect_timeout", must be greater than or equal to 0.0.'
|
351
|
+
end
|
352
|
+
|
353
|
+
@connect_timeout = connect_timeout
|
354
|
+
end
|
355
|
+
|
356
|
+
# Custom attribute writer method with validation
|
357
|
+
# @param [Object] sock_connect_timeout Value to be assigned
|
358
|
+
def sock_connect_timeout=(sock_connect_timeout)
|
359
|
+
if !sock_connect_timeout.nil? && sock_connect_timeout < 0.0
|
360
|
+
fail ArgumentError, 'invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.'
|
361
|
+
end
|
362
|
+
|
363
|
+
@sock_connect_timeout = sock_connect_timeout
|
364
|
+
end
|
365
|
+
|
366
|
+
# Custom attribute writer method with validation
|
367
|
+
# @param [Object] sock_read_timeout Value to be assigned
|
368
|
+
def sock_read_timeout=(sock_read_timeout)
|
369
|
+
if !sock_read_timeout.nil? && sock_read_timeout < 0.0
|
370
|
+
fail ArgumentError, 'invalid value for "sock_read_timeout", must be greater than or equal to 0.0.'
|
371
|
+
end
|
372
|
+
|
373
|
+
@sock_read_timeout = sock_read_timeout
|
374
|
+
end
|
375
|
+
|
376
|
+
# Checks equality by comparing each attribute.
|
377
|
+
# @param [Object] Object to be compared
|
378
|
+
def ==(o)
|
379
|
+
return true if self.equal?(o)
|
380
|
+
self.class == o.class &&
|
381
|
+
pulp_href == o.pulp_href &&
|
382
|
+
pulp_created == o.pulp_created &&
|
383
|
+
name == o.name &&
|
384
|
+
url == o.url &&
|
385
|
+
ca_cert == o.ca_cert &&
|
386
|
+
client_cert == o.client_cert &&
|
387
|
+
tls_validation == o.tls_validation &&
|
388
|
+
proxy_url == o.proxy_url &&
|
389
|
+
pulp_labels == o.pulp_labels &&
|
390
|
+
pulp_last_updated == o.pulp_last_updated &&
|
391
|
+
download_concurrency == o.download_concurrency &&
|
392
|
+
max_retries == o.max_retries &&
|
393
|
+
policy == o.policy &&
|
394
|
+
total_timeout == o.total_timeout &&
|
395
|
+
connect_timeout == o.connect_timeout &&
|
396
|
+
sock_connect_timeout == o.sock_connect_timeout &&
|
397
|
+
sock_read_timeout == o.sock_read_timeout &&
|
398
|
+
headers == o.headers &&
|
399
|
+
rate_limit == o.rate_limit &&
|
400
|
+
hidden_fields == o.hidden_fields &&
|
401
|
+
prereleases == o.prereleases &&
|
402
|
+
includes == o.includes &&
|
403
|
+
excludes == o.excludes
|
404
|
+
end
|
405
|
+
|
406
|
+
# @see the `==` method
|
407
|
+
# @param [Object] Object to be compared
|
408
|
+
def eql?(o)
|
409
|
+
self == o
|
410
|
+
end
|
411
|
+
|
412
|
+
# Calculates hash code according to all attributes.
|
413
|
+
# @return [Integer] Hash code
|
414
|
+
def hash
|
415
|
+
[pulp_href, pulp_created, name, url, ca_cert, client_cert, tls_validation, proxy_url, pulp_labels, pulp_last_updated, download_concurrency, max_retries, policy, total_timeout, connect_timeout, sock_connect_timeout, sock_read_timeout, headers, rate_limit, hidden_fields, prereleases, includes, excludes].hash
|
416
|
+
end
|
417
|
+
|
418
|
+
# Builds the object from hash
|
419
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
420
|
+
# @return [Object] Returns the model itself
|
421
|
+
def self.build_from_hash(attributes)
|
422
|
+
new.build_from_hash(attributes)
|
423
|
+
end
|
424
|
+
|
425
|
+
# Builds the object from hash
|
426
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
427
|
+
# @return [Object] Returns the model itself
|
428
|
+
def build_from_hash(attributes)
|
429
|
+
return nil unless attributes.is_a?(Hash)
|
430
|
+
self.class.openapi_types.each_pair do |key, type|
|
431
|
+
if type =~ /\AArray<(.*)>/i
|
432
|
+
# check to ensure the input is an array given that the attribute
|
433
|
+
# is documented as an array but the input is not
|
434
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
435
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
436
|
+
end
|
437
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
438
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
439
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
440
|
+
end
|
441
|
+
|
442
|
+
self
|
443
|
+
end
|
444
|
+
|
445
|
+
# Deserializes the data based on type
|
446
|
+
# @param string type Data type
|
447
|
+
# @param string value Value to be deserialized
|
448
|
+
# @return [Object] Deserialized data
|
449
|
+
def _deserialize(type, value)
|
450
|
+
case type.to_sym
|
451
|
+
when :DateTime
|
452
|
+
DateTime.parse(value)
|
453
|
+
when :Date
|
454
|
+
Date.parse(value)
|
455
|
+
when :String
|
456
|
+
value.to_s
|
457
|
+
when :Integer
|
458
|
+
value.to_i
|
459
|
+
when :Float
|
460
|
+
value.to_f
|
461
|
+
when :Boolean
|
462
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
463
|
+
true
|
464
|
+
else
|
465
|
+
false
|
466
|
+
end
|
467
|
+
when :Object
|
468
|
+
# generic object (usually a Hash), return directly
|
469
|
+
value
|
470
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
471
|
+
inner_type = Regexp.last_match[:inner_type]
|
472
|
+
value.map { |v| _deserialize(inner_type, v) }
|
473
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
474
|
+
k_type = Regexp.last_match[:k_type]
|
475
|
+
v_type = Regexp.last_match[:v_type]
|
476
|
+
{}.tap do |hash|
|
477
|
+
value.each do |k, v|
|
478
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
479
|
+
end
|
480
|
+
end
|
481
|
+
else # model
|
482
|
+
PulpGemClient.const_get(type).build_from_hash(value)
|
483
|
+
end
|
484
|
+
end
|
485
|
+
|
486
|
+
# Returns the string representation of the object
|
487
|
+
# @return [String] String presentation of the object
|
488
|
+
def to_s
|
489
|
+
to_hash.to_s
|
490
|
+
end
|
491
|
+
|
492
|
+
# to_body is an alias to to_hash (backward compatibility)
|
493
|
+
# @return [Hash] Returns the object in the form of hash
|
494
|
+
def to_body
|
495
|
+
to_hash
|
496
|
+
end
|
497
|
+
|
498
|
+
# Returns the object in the form of hash
|
499
|
+
# @return [Hash] Returns the object in the form of hash
|
500
|
+
def to_hash
|
501
|
+
hash = {}
|
502
|
+
self.class.attribute_map.each_pair do |attr, param|
|
503
|
+
value = self.send(attr)
|
504
|
+
if value.nil?
|
505
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
506
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
507
|
+
end
|
508
|
+
|
509
|
+
hash[param] = _to_hash(value)
|
510
|
+
end
|
511
|
+
hash
|
512
|
+
end
|
513
|
+
|
514
|
+
# Outputs non-array value in the form of hash
|
515
|
+
# For object, use to_hash. Otherwise, just return the value
|
516
|
+
# @param [Object] value Any valid value
|
517
|
+
# @return [Hash] Returns the value in the form of hash
|
518
|
+
def _to_hash(value)
|
519
|
+
if value.is_a?(Array)
|
520
|
+
value.compact.map { |v| _to_hash(v) }
|
521
|
+
elsif value.is_a?(Hash)
|
522
|
+
{}.tap do |hash|
|
523
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
524
|
+
end
|
525
|
+
elsif value.respond_to? :to_hash
|
526
|
+
value.to_hash
|
527
|
+
else
|
528
|
+
value
|
529
|
+
end
|
530
|
+
end
|
531
|
+
end
|
532
|
+
end
|