pulp_ansible_client 0.10.5 → 0.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 +14 -4
- data/docs/AnsibleCollectionRemote.md +1 -1
- data/docs/AnsibleCollectionRemoteResponse.md +3 -1
- data/docs/AnsibleCollectionVersionResponse.md +4 -4
- data/docs/AnsibleGitRemote.md +59 -0
- data/docs/AnsibleGitRemoteResponse.md +55 -0
- data/docs/AnsibleRoleRemote.md +1 -1
- data/docs/AnsibleRoleRemoteResponse.md +1 -1
- data/docs/AnsibleRoleResponse.md +4 -4
- data/docs/CollectionVersionResponse.md +4 -0
- data/docs/PaginatedansibleGitRemoteResponseList.md +23 -0
- data/docs/PatchedansibleCollectionRemote.md +1 -1
- data/docs/PatchedansibleGitRemote.md +59 -0
- data/docs/PatchedansibleRoleRemote.md +1 -1
- data/docs/RemotesGitApi.md +376 -0
- data/docs/UnpaginatedCollectionVersionResponse.md +5 -1
- data/git_push.sh +58 -0
- data/lib/pulp_ansible_client/api/ansible_collections_api.rb +16 -0
- data/lib/pulp_ansible_client/api/content_collection_versions_api.rb +12 -0
- data/lib/pulp_ansible_client/api/pulp_ansible_artifacts_collections_v3_api.rb +16 -0
- data/lib/pulp_ansible_client/api/remotes_git_api.rb +463 -0
- data/lib/pulp_ansible_client/api_client.rb +5 -2
- data/lib/pulp_ansible_client/configuration.rb +0 -1
- data/lib/pulp_ansible_client/models/ansible_ansible_distribution.rb +38 -0
- data/lib/pulp_ansible_client/models/ansible_ansible_repository.rb +34 -0
- data/lib/pulp_ansible_client/models/ansible_collection.rb +38 -0
- data/lib/pulp_ansible_client/models/ansible_collection_remote.rb +192 -1
- data/lib/pulp_ansible_client/models/ansible_collection_remote_response.rb +28 -2
- data/lib/pulp_ansible_client/models/ansible_collection_version.rb +27 -0
- data/lib/pulp_ansible_client/models/ansible_collection_version_response.rb +14 -19
- data/lib/pulp_ansible_client/models/ansible_git_remote.rb +692 -0
- data/lib/pulp_ansible_client/models/ansible_git_remote_response.rb +493 -0
- data/lib/pulp_ansible_client/models/ansible_role.rb +57 -0
- data/lib/pulp_ansible_client/models/ansible_role_remote.rb +159 -1
- data/lib/pulp_ansible_client/models/ansible_role_remote_response.rb +1 -1
- data/lib/pulp_ansible_client/models/ansible_role_response.rb +14 -14
- data/lib/pulp_ansible_client/models/collection_one_shot.rb +60 -0
- data/lib/pulp_ansible_client/models/collection_version_response.rb +19 -1
- data/lib/pulp_ansible_client/models/galaxy_collection.rb +38 -0
- data/lib/pulp_ansible_client/models/paginatedansible_git_remote_response_list.rb +237 -0
- data/lib/pulp_ansible_client/models/patchedansible_ansible_distribution.rb +30 -0
- data/lib/pulp_ansible_client/models/patchedansible_ansible_repository.rb +30 -0
- data/lib/pulp_ansible_client/models/patchedansible_collection_remote.rb +184 -1
- data/lib/pulp_ansible_client/models/patchedansible_git_remote.rb +674 -0
- data/lib/pulp_ansible_client/models/patchedansible_role_remote.rb +151 -1
- data/lib/pulp_ansible_client/models/unpaginated_collection_version_response.rb +22 -4
- data/lib/pulp_ansible_client/version.rb +1 -1
- data/lib/pulp_ansible_client.rb +5 -0
- data/pulp_ansible_client.gemspec +3 -3
- data/spec/api/remotes_git_api_spec.rb +127 -0
- data/spec/models/ansible_collection_remote_response_spec.rb +6 -0
- data/spec/models/ansible_collection_version_response_spec.rb +2 -2
- data/spec/models/ansible_git_remote_response_spec.rb +155 -0
- data/spec/models/ansible_git_remote_spec.rb +167 -0
- data/spec/models/ansible_role_response_spec.rb +2 -2
- data/spec/models/collection_version_response_spec.rb +12 -0
- data/spec/models/paginatedansible_git_remote_response_list_spec.rb +59 -0
- data/spec/models/patchedansible_git_remote_spec.rb +167 -0
- data/spec/models/unpaginated_collection_version_response_spec.rb +12 -0
- metadata +94 -79
@@ -0,0 +1,493 @@
|
|
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 PulpAnsibleClient
|
16
|
+
# A serializer for Git Collection Remotes.
|
17
|
+
class AnsibleGitRemoteResponse
|
18
|
+
# 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.
|
19
|
+
attr_accessor :sock_read_timeout
|
20
|
+
|
21
|
+
attr_accessor :pulp_labels
|
22
|
+
|
23
|
+
# A PEM encoded client certificate used for authentication.
|
24
|
+
attr_accessor :client_cert
|
25
|
+
|
26
|
+
attr_accessor :pulp_href
|
27
|
+
|
28
|
+
# Limits requests per second for each concurrent downloader
|
29
|
+
attr_accessor :rate_limit
|
30
|
+
|
31
|
+
# aiohttp.ClientTimeout.total (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
|
32
|
+
attr_accessor :total_timeout
|
33
|
+
|
34
|
+
# Timestamp of the most recent update of the remote.
|
35
|
+
attr_accessor :pulp_last_updated
|
36
|
+
|
37
|
+
# The proxy URL. Format: scheme://host:port
|
38
|
+
attr_accessor :proxy_url
|
39
|
+
|
40
|
+
# If True, TLS peer validation must be performed.
|
41
|
+
attr_accessor :tls_validation
|
42
|
+
|
43
|
+
# Maximum number of retry attempts after a download failure. If not set then the default value (3) will be used.
|
44
|
+
attr_accessor :max_retries
|
45
|
+
|
46
|
+
# A unique name for this remote.
|
47
|
+
attr_accessor :name
|
48
|
+
|
49
|
+
# A PEM encoded CA certificate used to validate the server certificate presented by the remote server.
|
50
|
+
attr_accessor :ca_cert
|
51
|
+
|
52
|
+
# aiohttp.ClientTimeout.connect (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
|
53
|
+
attr_accessor :connect_timeout
|
54
|
+
|
55
|
+
# Headers for aiohttp.Clientsession
|
56
|
+
attr_accessor :headers
|
57
|
+
|
58
|
+
# 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.
|
59
|
+
attr_accessor :sock_connect_timeout
|
60
|
+
|
61
|
+
# Timestamp of creation.
|
62
|
+
attr_accessor :pulp_created
|
63
|
+
|
64
|
+
# The URL of an external content source.
|
65
|
+
attr_accessor :url
|
66
|
+
|
67
|
+
# Total number of simultaneous connections. If not set then the default value will be used.
|
68
|
+
attr_accessor :download_concurrency
|
69
|
+
|
70
|
+
# If True, only metadata about the content will be stored in Pulp. Clients will retrieve content from the remote URL.
|
71
|
+
attr_accessor :metadata_only
|
72
|
+
|
73
|
+
# A git ref. e.g.: branch, tag, or commit sha.
|
74
|
+
attr_accessor :git_ref
|
75
|
+
|
76
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
77
|
+
def self.attribute_map
|
78
|
+
{
|
79
|
+
:'sock_read_timeout' => :'sock_read_timeout',
|
80
|
+
:'pulp_labels' => :'pulp_labels',
|
81
|
+
:'client_cert' => :'client_cert',
|
82
|
+
:'pulp_href' => :'pulp_href',
|
83
|
+
:'rate_limit' => :'rate_limit',
|
84
|
+
:'total_timeout' => :'total_timeout',
|
85
|
+
:'pulp_last_updated' => :'pulp_last_updated',
|
86
|
+
:'proxy_url' => :'proxy_url',
|
87
|
+
:'tls_validation' => :'tls_validation',
|
88
|
+
:'max_retries' => :'max_retries',
|
89
|
+
:'name' => :'name',
|
90
|
+
:'ca_cert' => :'ca_cert',
|
91
|
+
:'connect_timeout' => :'connect_timeout',
|
92
|
+
:'headers' => :'headers',
|
93
|
+
:'sock_connect_timeout' => :'sock_connect_timeout',
|
94
|
+
:'pulp_created' => :'pulp_created',
|
95
|
+
:'url' => :'url',
|
96
|
+
:'download_concurrency' => :'download_concurrency',
|
97
|
+
:'metadata_only' => :'metadata_only',
|
98
|
+
:'git_ref' => :'git_ref'
|
99
|
+
}
|
100
|
+
end
|
101
|
+
|
102
|
+
# Attribute type mapping.
|
103
|
+
def self.openapi_types
|
104
|
+
{
|
105
|
+
:'sock_read_timeout' => :'Float',
|
106
|
+
:'pulp_labels' => :'Object',
|
107
|
+
:'client_cert' => :'String',
|
108
|
+
:'pulp_href' => :'String',
|
109
|
+
:'rate_limit' => :'Integer',
|
110
|
+
:'total_timeout' => :'Float',
|
111
|
+
:'pulp_last_updated' => :'DateTime',
|
112
|
+
:'proxy_url' => :'String',
|
113
|
+
:'tls_validation' => :'Boolean',
|
114
|
+
:'max_retries' => :'Integer',
|
115
|
+
:'name' => :'String',
|
116
|
+
:'ca_cert' => :'String',
|
117
|
+
:'connect_timeout' => :'Float',
|
118
|
+
:'headers' => :'Array<Object>',
|
119
|
+
:'sock_connect_timeout' => :'Float',
|
120
|
+
:'pulp_created' => :'DateTime',
|
121
|
+
:'url' => :'String',
|
122
|
+
:'download_concurrency' => :'Integer',
|
123
|
+
:'metadata_only' => :'Boolean',
|
124
|
+
:'git_ref' => :'String'
|
125
|
+
}
|
126
|
+
end
|
127
|
+
|
128
|
+
# List of attributes with nullable: true
|
129
|
+
def self.openapi_nullable
|
130
|
+
Set.new([
|
131
|
+
:'sock_read_timeout',
|
132
|
+
:'client_cert',
|
133
|
+
:'rate_limit',
|
134
|
+
:'total_timeout',
|
135
|
+
:'proxy_url',
|
136
|
+
:'max_retries',
|
137
|
+
:'ca_cert',
|
138
|
+
:'connect_timeout',
|
139
|
+
:'sock_connect_timeout',
|
140
|
+
:'download_concurrency',
|
141
|
+
])
|
142
|
+
end
|
143
|
+
|
144
|
+
# Initializes the object
|
145
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
146
|
+
def initialize(attributes = {})
|
147
|
+
if (!attributes.is_a?(Hash))
|
148
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpAnsibleClient::AnsibleGitRemoteResponse` initialize method"
|
149
|
+
end
|
150
|
+
|
151
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
152
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
153
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
154
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpAnsibleClient::AnsibleGitRemoteResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
155
|
+
end
|
156
|
+
h[k.to_sym] = v
|
157
|
+
}
|
158
|
+
|
159
|
+
if attributes.key?(:'sock_read_timeout')
|
160
|
+
self.sock_read_timeout = attributes[:'sock_read_timeout']
|
161
|
+
end
|
162
|
+
|
163
|
+
if attributes.key?(:'pulp_labels')
|
164
|
+
self.pulp_labels = attributes[:'pulp_labels']
|
165
|
+
end
|
166
|
+
|
167
|
+
if attributes.key?(:'client_cert')
|
168
|
+
self.client_cert = attributes[:'client_cert']
|
169
|
+
end
|
170
|
+
|
171
|
+
if attributes.key?(:'pulp_href')
|
172
|
+
self.pulp_href = attributes[:'pulp_href']
|
173
|
+
end
|
174
|
+
|
175
|
+
if attributes.key?(:'rate_limit')
|
176
|
+
self.rate_limit = attributes[:'rate_limit']
|
177
|
+
end
|
178
|
+
|
179
|
+
if attributes.key?(:'total_timeout')
|
180
|
+
self.total_timeout = attributes[:'total_timeout']
|
181
|
+
end
|
182
|
+
|
183
|
+
if attributes.key?(:'pulp_last_updated')
|
184
|
+
self.pulp_last_updated = attributes[:'pulp_last_updated']
|
185
|
+
end
|
186
|
+
|
187
|
+
if attributes.key?(:'proxy_url')
|
188
|
+
self.proxy_url = attributes[:'proxy_url']
|
189
|
+
end
|
190
|
+
|
191
|
+
if attributes.key?(:'tls_validation')
|
192
|
+
self.tls_validation = attributes[:'tls_validation']
|
193
|
+
end
|
194
|
+
|
195
|
+
if attributes.key?(:'max_retries')
|
196
|
+
self.max_retries = attributes[:'max_retries']
|
197
|
+
end
|
198
|
+
|
199
|
+
if attributes.key?(:'name')
|
200
|
+
self.name = attributes[:'name']
|
201
|
+
end
|
202
|
+
|
203
|
+
if attributes.key?(:'ca_cert')
|
204
|
+
self.ca_cert = attributes[:'ca_cert']
|
205
|
+
end
|
206
|
+
|
207
|
+
if attributes.key?(:'connect_timeout')
|
208
|
+
self.connect_timeout = attributes[:'connect_timeout']
|
209
|
+
end
|
210
|
+
|
211
|
+
if attributes.key?(:'headers')
|
212
|
+
if (value = attributes[:'headers']).is_a?(Array)
|
213
|
+
self.headers = value
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
if attributes.key?(:'sock_connect_timeout')
|
218
|
+
self.sock_connect_timeout = attributes[:'sock_connect_timeout']
|
219
|
+
end
|
220
|
+
|
221
|
+
if attributes.key?(:'pulp_created')
|
222
|
+
self.pulp_created = attributes[:'pulp_created']
|
223
|
+
end
|
224
|
+
|
225
|
+
if attributes.key?(:'url')
|
226
|
+
self.url = attributes[:'url']
|
227
|
+
end
|
228
|
+
|
229
|
+
if attributes.key?(:'download_concurrency')
|
230
|
+
self.download_concurrency = attributes[:'download_concurrency']
|
231
|
+
end
|
232
|
+
|
233
|
+
if attributes.key?(:'metadata_only')
|
234
|
+
self.metadata_only = attributes[:'metadata_only']
|
235
|
+
end
|
236
|
+
|
237
|
+
if attributes.key?(:'git_ref')
|
238
|
+
self.git_ref = attributes[:'git_ref']
|
239
|
+
end
|
240
|
+
end
|
241
|
+
|
242
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
243
|
+
# @return Array for valid properties with the reasons
|
244
|
+
def list_invalid_properties
|
245
|
+
invalid_properties = Array.new
|
246
|
+
if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
|
247
|
+
invalid_properties.push('invalid value for "sock_read_timeout", must be greater than or equal to 0.0.')
|
248
|
+
end
|
249
|
+
|
250
|
+
if !@total_timeout.nil? && @total_timeout < 0.0
|
251
|
+
invalid_properties.push('invalid value for "total_timeout", must be greater than or equal to 0.0.')
|
252
|
+
end
|
253
|
+
|
254
|
+
if @name.nil?
|
255
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
256
|
+
end
|
257
|
+
|
258
|
+
if !@connect_timeout.nil? && @connect_timeout < 0.0
|
259
|
+
invalid_properties.push('invalid value for "connect_timeout", must be greater than or equal to 0.0.')
|
260
|
+
end
|
261
|
+
|
262
|
+
if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
|
263
|
+
invalid_properties.push('invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.')
|
264
|
+
end
|
265
|
+
|
266
|
+
if @url.nil?
|
267
|
+
invalid_properties.push('invalid value for "url", url cannot be nil.')
|
268
|
+
end
|
269
|
+
|
270
|
+
if !@download_concurrency.nil? && @download_concurrency < 1
|
271
|
+
invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
|
272
|
+
end
|
273
|
+
|
274
|
+
invalid_properties
|
275
|
+
end
|
276
|
+
|
277
|
+
# Check to see if the all the properties in the model are valid
|
278
|
+
# @return true if the model is valid
|
279
|
+
def valid?
|
280
|
+
return false if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
|
281
|
+
return false if !@total_timeout.nil? && @total_timeout < 0.0
|
282
|
+
return false if @name.nil?
|
283
|
+
return false if !@connect_timeout.nil? && @connect_timeout < 0.0
|
284
|
+
return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
|
285
|
+
return false if @url.nil?
|
286
|
+
return false if !@download_concurrency.nil? && @download_concurrency < 1
|
287
|
+
true
|
288
|
+
end
|
289
|
+
|
290
|
+
# Custom attribute writer method with validation
|
291
|
+
# @param [Object] sock_read_timeout Value to be assigned
|
292
|
+
def sock_read_timeout=(sock_read_timeout)
|
293
|
+
if !sock_read_timeout.nil? && sock_read_timeout < 0.0
|
294
|
+
fail ArgumentError, 'invalid value for "sock_read_timeout", must be greater than or equal to 0.0.'
|
295
|
+
end
|
296
|
+
|
297
|
+
@sock_read_timeout = sock_read_timeout
|
298
|
+
end
|
299
|
+
|
300
|
+
# Custom attribute writer method with validation
|
301
|
+
# @param [Object] total_timeout Value to be assigned
|
302
|
+
def total_timeout=(total_timeout)
|
303
|
+
if !total_timeout.nil? && total_timeout < 0.0
|
304
|
+
fail ArgumentError, 'invalid value for "total_timeout", must be greater than or equal to 0.0.'
|
305
|
+
end
|
306
|
+
|
307
|
+
@total_timeout = total_timeout
|
308
|
+
end
|
309
|
+
|
310
|
+
# Custom attribute writer method with validation
|
311
|
+
# @param [Object] connect_timeout Value to be assigned
|
312
|
+
def connect_timeout=(connect_timeout)
|
313
|
+
if !connect_timeout.nil? && connect_timeout < 0.0
|
314
|
+
fail ArgumentError, 'invalid value for "connect_timeout", must be greater than or equal to 0.0.'
|
315
|
+
end
|
316
|
+
|
317
|
+
@connect_timeout = connect_timeout
|
318
|
+
end
|
319
|
+
|
320
|
+
# Custom attribute writer method with validation
|
321
|
+
# @param [Object] sock_connect_timeout Value to be assigned
|
322
|
+
def sock_connect_timeout=(sock_connect_timeout)
|
323
|
+
if !sock_connect_timeout.nil? && sock_connect_timeout < 0.0
|
324
|
+
fail ArgumentError, 'invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.'
|
325
|
+
end
|
326
|
+
|
327
|
+
@sock_connect_timeout = sock_connect_timeout
|
328
|
+
end
|
329
|
+
|
330
|
+
# Custom attribute writer method with validation
|
331
|
+
# @param [Object] download_concurrency Value to be assigned
|
332
|
+
def download_concurrency=(download_concurrency)
|
333
|
+
if !download_concurrency.nil? && download_concurrency < 1
|
334
|
+
fail ArgumentError, 'invalid value for "download_concurrency", must be greater than or equal to 1.'
|
335
|
+
end
|
336
|
+
|
337
|
+
@download_concurrency = download_concurrency
|
338
|
+
end
|
339
|
+
|
340
|
+
# Checks equality by comparing each attribute.
|
341
|
+
# @param [Object] Object to be compared
|
342
|
+
def ==(o)
|
343
|
+
return true if self.equal?(o)
|
344
|
+
self.class == o.class &&
|
345
|
+
sock_read_timeout == o.sock_read_timeout &&
|
346
|
+
pulp_labels == o.pulp_labels &&
|
347
|
+
client_cert == o.client_cert &&
|
348
|
+
pulp_href == o.pulp_href &&
|
349
|
+
rate_limit == o.rate_limit &&
|
350
|
+
total_timeout == o.total_timeout &&
|
351
|
+
pulp_last_updated == o.pulp_last_updated &&
|
352
|
+
proxy_url == o.proxy_url &&
|
353
|
+
tls_validation == o.tls_validation &&
|
354
|
+
max_retries == o.max_retries &&
|
355
|
+
name == o.name &&
|
356
|
+
ca_cert == o.ca_cert &&
|
357
|
+
connect_timeout == o.connect_timeout &&
|
358
|
+
headers == o.headers &&
|
359
|
+
sock_connect_timeout == o.sock_connect_timeout &&
|
360
|
+
pulp_created == o.pulp_created &&
|
361
|
+
url == o.url &&
|
362
|
+
download_concurrency == o.download_concurrency &&
|
363
|
+
metadata_only == o.metadata_only &&
|
364
|
+
git_ref == o.git_ref
|
365
|
+
end
|
366
|
+
|
367
|
+
# @see the `==` method
|
368
|
+
# @param [Object] Object to be compared
|
369
|
+
def eql?(o)
|
370
|
+
self == o
|
371
|
+
end
|
372
|
+
|
373
|
+
# Calculates hash code according to all attributes.
|
374
|
+
# @return [Integer] Hash code
|
375
|
+
def hash
|
376
|
+
[sock_read_timeout, pulp_labels, client_cert, pulp_href, rate_limit, total_timeout, pulp_last_updated, proxy_url, tls_validation, max_retries, name, ca_cert, connect_timeout, headers, sock_connect_timeout, pulp_created, url, download_concurrency, metadata_only, git_ref].hash
|
377
|
+
end
|
378
|
+
|
379
|
+
# Builds the object from hash
|
380
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
381
|
+
# @return [Object] Returns the model itself
|
382
|
+
def self.build_from_hash(attributes)
|
383
|
+
new.build_from_hash(attributes)
|
384
|
+
end
|
385
|
+
|
386
|
+
# Builds the object from hash
|
387
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
388
|
+
# @return [Object] Returns the model itself
|
389
|
+
def build_from_hash(attributes)
|
390
|
+
return nil unless attributes.is_a?(Hash)
|
391
|
+
self.class.openapi_types.each_pair do |key, type|
|
392
|
+
if type =~ /\AArray<(.*)>/i
|
393
|
+
# check to ensure the input is an array given that the attribute
|
394
|
+
# is documented as an array but the input is not
|
395
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
396
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
397
|
+
end
|
398
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
399
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
400
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
401
|
+
end
|
402
|
+
|
403
|
+
self
|
404
|
+
end
|
405
|
+
|
406
|
+
# Deserializes the data based on type
|
407
|
+
# @param string type Data type
|
408
|
+
# @param string value Value to be deserialized
|
409
|
+
# @return [Object] Deserialized data
|
410
|
+
def _deserialize(type, value)
|
411
|
+
case type.to_sym
|
412
|
+
when :DateTime
|
413
|
+
DateTime.parse(value)
|
414
|
+
when :Date
|
415
|
+
Date.parse(value)
|
416
|
+
when :String
|
417
|
+
value.to_s
|
418
|
+
when :Integer
|
419
|
+
value.to_i
|
420
|
+
when :Float
|
421
|
+
value.to_f
|
422
|
+
when :Boolean
|
423
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
424
|
+
true
|
425
|
+
else
|
426
|
+
false
|
427
|
+
end
|
428
|
+
when :Object
|
429
|
+
# generic object (usually a Hash), return directly
|
430
|
+
value
|
431
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
432
|
+
inner_type = Regexp.last_match[:inner_type]
|
433
|
+
value.map { |v| _deserialize(inner_type, v) }
|
434
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
435
|
+
k_type = Regexp.last_match[:k_type]
|
436
|
+
v_type = Regexp.last_match[:v_type]
|
437
|
+
{}.tap do |hash|
|
438
|
+
value.each do |k, v|
|
439
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
440
|
+
end
|
441
|
+
end
|
442
|
+
else # model
|
443
|
+
PulpAnsibleClient.const_get(type).build_from_hash(value)
|
444
|
+
end
|
445
|
+
end
|
446
|
+
|
447
|
+
# Returns the string representation of the object
|
448
|
+
# @return [String] String presentation of the object
|
449
|
+
def to_s
|
450
|
+
to_hash.to_s
|
451
|
+
end
|
452
|
+
|
453
|
+
# to_body is an alias to to_hash (backward compatibility)
|
454
|
+
# @return [Hash] Returns the object in the form of hash
|
455
|
+
def to_body
|
456
|
+
to_hash
|
457
|
+
end
|
458
|
+
|
459
|
+
# Returns the object in the form of hash
|
460
|
+
# @return [Hash] Returns the object in the form of hash
|
461
|
+
def to_hash
|
462
|
+
hash = {}
|
463
|
+
self.class.attribute_map.each_pair do |attr, param|
|
464
|
+
value = self.send(attr)
|
465
|
+
if value.nil?
|
466
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
467
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
468
|
+
end
|
469
|
+
|
470
|
+
hash[param] = _to_hash(value)
|
471
|
+
end
|
472
|
+
hash
|
473
|
+
end
|
474
|
+
|
475
|
+
# Outputs non-array value in the form of hash
|
476
|
+
# For object, use to_hash. Otherwise, just return the value
|
477
|
+
# @param [Object] value Any valid value
|
478
|
+
# @return [Hash] Returns the value in the form of hash
|
479
|
+
def _to_hash(value)
|
480
|
+
if value.is_a?(Array)
|
481
|
+
value.compact.map { |v| _to_hash(v) }
|
482
|
+
elsif value.is_a?(Hash)
|
483
|
+
{}.tap do |hash|
|
484
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
485
|
+
end
|
486
|
+
elsif value.respond_to? :to_hash
|
487
|
+
value.to_hash
|
488
|
+
else
|
489
|
+
value
|
490
|
+
end
|
491
|
+
end
|
492
|
+
end
|
493
|
+
end
|
@@ -94,14 +94,26 @@ module PulpAnsibleClient
|
|
94
94
|
invalid_properties.push('invalid value for "version", version cannot be nil.')
|
95
95
|
end
|
96
96
|
|
97
|
+
if @version.to_s.length < 1
|
98
|
+
invalid_properties.push('invalid value for "version", the character length must be great than or equal to 1.')
|
99
|
+
end
|
100
|
+
|
97
101
|
if @name.nil?
|
98
102
|
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
99
103
|
end
|
100
104
|
|
105
|
+
if @name.to_s.length < 1
|
106
|
+
invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
|
107
|
+
end
|
108
|
+
|
101
109
|
if @namespace.nil?
|
102
110
|
invalid_properties.push('invalid value for "namespace", namespace cannot be nil.')
|
103
111
|
end
|
104
112
|
|
113
|
+
if @namespace.to_s.length < 1
|
114
|
+
invalid_properties.push('invalid value for "namespace", the character length must be great than or equal to 1.')
|
115
|
+
end
|
116
|
+
|
105
117
|
invalid_properties
|
106
118
|
end
|
107
119
|
|
@@ -110,11 +122,56 @@ module PulpAnsibleClient
|
|
110
122
|
def valid?
|
111
123
|
return false if @artifact.nil?
|
112
124
|
return false if @version.nil?
|
125
|
+
return false if @version.to_s.length < 1
|
113
126
|
return false if @name.nil?
|
127
|
+
return false if @name.to_s.length < 1
|
114
128
|
return false if @namespace.nil?
|
129
|
+
return false if @namespace.to_s.length < 1
|
115
130
|
true
|
116
131
|
end
|
117
132
|
|
133
|
+
# Custom attribute writer method with validation
|
134
|
+
# @param [Object] version Value to be assigned
|
135
|
+
def version=(version)
|
136
|
+
if version.nil?
|
137
|
+
fail ArgumentError, 'version cannot be nil'
|
138
|
+
end
|
139
|
+
|
140
|
+
if version.to_s.length < 1
|
141
|
+
fail ArgumentError, 'invalid value for "version", the character length must be great than or equal to 1.'
|
142
|
+
end
|
143
|
+
|
144
|
+
@version = version
|
145
|
+
end
|
146
|
+
|
147
|
+
# Custom attribute writer method with validation
|
148
|
+
# @param [Object] name Value to be assigned
|
149
|
+
def name=(name)
|
150
|
+
if name.nil?
|
151
|
+
fail ArgumentError, 'name cannot be nil'
|
152
|
+
end
|
153
|
+
|
154
|
+
if name.to_s.length < 1
|
155
|
+
fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
|
156
|
+
end
|
157
|
+
|
158
|
+
@name = name
|
159
|
+
end
|
160
|
+
|
161
|
+
# Custom attribute writer method with validation
|
162
|
+
# @param [Object] namespace Value to be assigned
|
163
|
+
def namespace=(namespace)
|
164
|
+
if namespace.nil?
|
165
|
+
fail ArgumentError, 'namespace cannot be nil'
|
166
|
+
end
|
167
|
+
|
168
|
+
if namespace.to_s.length < 1
|
169
|
+
fail ArgumentError, 'invalid value for "namespace", the character length must be great than or equal to 1.'
|
170
|
+
end
|
171
|
+
|
172
|
+
@namespace = namespace
|
173
|
+
end
|
174
|
+
|
118
175
|
# Checks equality by comparing each attribute.
|
119
176
|
# @param [Object] Object to be compared
|
120
177
|
def ==(o)
|