pulp_ansible_client 0.2.0b12 → 0.2.0b13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +21 -11
  3. data/docs/AnsibleAnsibleDistributionRead.md +31 -0
  4. data/docs/AnsibleAnsibleRemote.md +7 -3
  5. data/docs/AnsibleAnsibleRemoteRead.md +43 -0
  6. data/docs/AnsibleAnsibleRepositoryRead.md +27 -0
  7. data/docs/{AnsibleCollection.md → AnsibleCollectionRead.md} +2 -2
  8. data/docs/AnsibleCollectionRemote.md +7 -3
  9. data/docs/AnsibleCollectionRemoteRead.md +45 -0
  10. data/docs/AnsibleCollectionVersion.md +4 -4
  11. data/docs/AnsibleCollectionVersionRead.md +67 -0
  12. data/docs/AnsibleCollectionsApi.md +1 -1
  13. data/docs/AnsibleRole.md +4 -4
  14. data/docs/AnsibleRoleRead.md +27 -0
  15. data/docs/{CollectionImportDetail.md → CollectionImportDetailRead.md} +2 -2
  16. data/docs/CollectionRead.md +31 -0
  17. data/docs/CollectionVersionRead.md +37 -0
  18. data/docs/ContentCollectionVersionsApi.md +5 -5
  19. data/docs/ContentRolesApi.md +5 -5
  20. data/docs/DistributionsAnsibleApi.md +3 -3
  21. data/docs/GalaxyCollectionRead.md +23 -0
  22. data/docs/{GalaxyCollectionVersion.md → GalaxyCollectionVersionRead.md} +2 -2
  23. data/docs/{GalaxyRole.md → GalaxyRoleRead.md} +2 -2
  24. data/docs/{GalaxyRoleVersion.md → GalaxyRoleVersionRead.md} +2 -2
  25. data/docs/InlineResponse200.md +1 -1
  26. data/docs/InlineResponse2001.md +1 -1
  27. data/docs/InlineResponse20010.md +1 -1
  28. data/docs/InlineResponse20011.md +1 -1
  29. data/docs/InlineResponse20012.md +1 -1
  30. data/docs/InlineResponse20013.md +1 -1
  31. data/docs/InlineResponse2002.md +1 -1
  32. data/docs/InlineResponse2003.md +1 -1
  33. data/docs/InlineResponse2004.md +1 -1
  34. data/docs/InlineResponse2005.md +1 -1
  35. data/docs/InlineResponse2006.md +1 -1
  36. data/docs/InlineResponse2007.md +1 -1
  37. data/docs/InlineResponse2008.md +1 -1
  38. data/docs/InlineResponse2009.md +1 -1
  39. data/docs/PulpAnsibleApiApi.md +1 -1
  40. data/docs/PulpAnsibleGalaxyApiCollectionsApi.md +5 -5
  41. data/docs/PulpAnsibleGalaxyApiRolesApi.md +1 -1
  42. data/docs/PulpAnsibleGalaxyApiV1VersionsApi.md +1 -1
  43. data/docs/PulpAnsibleGalaxyApiV2VersionsApi.md +1 -1
  44. data/docs/PulpAnsibleGalaxyApiV3CollectionsApi.md +3 -3
  45. data/docs/PulpAnsibleTagsApi.md +1 -1
  46. data/docs/RemotesAnsibleApi.md +5 -5
  47. data/docs/RemotesCollectionApi.md +5 -5
  48. data/docs/RepositoriesAnsibleApi.md +10 -10
  49. data/docs/RepositoriesAnsibleVersionsApi.md +3 -3
  50. data/docs/RepositoryVersionRead.md +25 -0
  51. data/docs/{Tag.md → TagRead.md} +2 -2
  52. data/lib/pulp_ansible_client/api/content_collection_versions_api.rb +6 -6
  53. data/lib/pulp_ansible_client/api/content_roles_api.rb +6 -6
  54. data/lib/pulp_ansible_client/api/distributions_ansible_api.rb +3 -3
  55. data/lib/pulp_ansible_client/api/pulp_ansible_galaxy_api_collections_api.rb +6 -6
  56. data/lib/pulp_ansible_client/api/pulp_ansible_galaxy_api_v3_collections_api.rb +3 -3
  57. data/lib/pulp_ansible_client/api/remotes_ansible_api.rb +6 -6
  58. data/lib/pulp_ansible_client/api/remotes_collection_api.rb +6 -6
  59. data/lib/pulp_ansible_client/api/repositories_ansible_api.rb +15 -15
  60. data/lib/pulp_ansible_client/api/repositories_ansible_versions_api.rb +3 -3
  61. data/lib/pulp_ansible_client/configuration.rb +2 -2
  62. data/lib/pulp_ansible_client/models/ansible_ansible_distribution_read.rb +327 -0
  63. data/lib/pulp_ansible_client/models/ansible_ansible_remote.rb +56 -4
  64. data/lib/pulp_ansible_client/models/ansible_ansible_remote_read.rb +531 -0
  65. data/lib/pulp_ansible_client/models/ansible_ansible_repository_read.rb +294 -0
  66. data/lib/pulp_ansible_client/models/{ansible_collection.rb → ansible_collection_read.rb} +3 -3
  67. data/lib/pulp_ansible_client/models/ansible_collection_remote.rb +56 -4
  68. data/lib/pulp_ansible_client/models/ansible_collection_remote_read.rb +557 -0
  69. data/lib/pulp_ansible_client/models/ansible_collection_version.rb +35 -35
  70. data/lib/pulp_ansible_client/models/ansible_collection_version_read.rb +816 -0
  71. data/lib/pulp_ansible_client/models/ansible_role.rb +15 -15
  72. data/lib/pulp_ansible_client/models/ansible_role_read.rb +330 -0
  73. data/lib/pulp_ansible_client/models/{collection_import_detail.rb → collection_import_detail_read.rb} +3 -3
  74. data/lib/pulp_ansible_client/models/collection_read.rb +314 -0
  75. data/lib/pulp_ansible_client/models/collection_version_read.rb +370 -0
  76. data/lib/pulp_ansible_client/models/galaxy_collection_read.rb +281 -0
  77. data/lib/pulp_ansible_client/models/{galaxy_collection_version.rb → galaxy_collection_version_read.rb} +3 -3
  78. data/lib/pulp_ansible_client/models/{galaxy_role.rb → galaxy_role_read.rb} +3 -3
  79. data/lib/pulp_ansible_client/models/{galaxy_role_version.rb → galaxy_role_version_read.rb} +3 -3
  80. data/lib/pulp_ansible_client/models/inline_response200.rb +1 -1
  81. data/lib/pulp_ansible_client/models/inline_response2001.rb +1 -1
  82. data/lib/pulp_ansible_client/models/inline_response20010.rb +1 -1
  83. data/lib/pulp_ansible_client/models/inline_response20011.rb +1 -1
  84. data/lib/pulp_ansible_client/models/inline_response20012.rb +1 -1
  85. data/lib/pulp_ansible_client/models/inline_response20013.rb +1 -1
  86. data/lib/pulp_ansible_client/models/inline_response2002.rb +1 -1
  87. data/lib/pulp_ansible_client/models/inline_response2003.rb +1 -1
  88. data/lib/pulp_ansible_client/models/inline_response2004.rb +1 -1
  89. data/lib/pulp_ansible_client/models/inline_response2005.rb +1 -1
  90. data/lib/pulp_ansible_client/models/inline_response2006.rb +1 -1
  91. data/lib/pulp_ansible_client/models/inline_response2007.rb +1 -1
  92. data/lib/pulp_ansible_client/models/inline_response2008.rb +1 -1
  93. data/lib/pulp_ansible_client/models/inline_response2009.rb +1 -1
  94. data/lib/pulp_ansible_client/models/repository_version_read.rb +244 -0
  95. data/lib/pulp_ansible_client/models/{tag.rb → tag_read.rb} +3 -3
  96. data/lib/pulp_ansible_client/version.rb +1 -1
  97. data/lib/pulp_ansible_client.rb +16 -6
  98. data/spec/api/content_collection_versions_api_spec.rb +2 -2
  99. data/spec/api/content_roles_api_spec.rb +2 -2
  100. data/spec/api/distributions_ansible_api_spec.rb +1 -1
  101. data/spec/api/pulp_ansible_galaxy_api_collections_api_spec.rb +2 -2
  102. data/spec/api/pulp_ansible_galaxy_api_v3_collections_api_spec.rb +1 -1
  103. data/spec/api/remotes_ansible_api_spec.rb +2 -2
  104. data/spec/api/remotes_collection_api_spec.rb +2 -2
  105. data/spec/api/repositories_ansible_api_spec.rb +6 -6
  106. data/spec/api/repositories_ansible_versions_api_spec.rb +1 -1
  107. data/spec/configuration_spec.rb +3 -3
  108. data/spec/models/ansible_ansible_distribution_read_spec.rb +83 -0
  109. data/spec/models/ansible_ansible_remote_read_spec.rb +123 -0
  110. data/spec/models/ansible_ansible_remote_spec.rb +12 -0
  111. data/spec/models/ansible_ansible_repository_read_spec.rb +71 -0
  112. data/spec/models/{ansible_collection_spec.rb → ansible_collection_read_spec.rb} +6 -6
  113. data/spec/models/ansible_collection_remote_read_spec.rb +129 -0
  114. data/spec/models/ansible_collection_remote_spec.rb +12 -0
  115. data/spec/models/ansible_collection_version_read_spec.rb +191 -0
  116. data/spec/models/ansible_collection_version_spec.rb +2 -2
  117. data/spec/models/ansible_role_read_spec.rb +71 -0
  118. data/spec/models/ansible_role_spec.rb +2 -2
  119. data/spec/models/{collection_import_detail_spec.rb → collection_import_detail_read_spec.rb} +6 -6
  120. data/spec/models/collection_read_spec.rb +83 -0
  121. data/spec/models/collection_version_read_spec.rb +105 -0
  122. data/spec/models/galaxy_collection_read_spec.rb +59 -0
  123. data/spec/models/{galaxy_collection_version_spec.rb → galaxy_collection_version_read_spec.rb} +6 -6
  124. data/spec/models/{galaxy_role_spec.rb → galaxy_role_read_spec.rb} +6 -6
  125. data/spec/models/{galaxy_role_version_spec.rb → galaxy_role_version_read_spec.rb} +6 -6
  126. data/spec/models/repository_version_read_spec.rb +65 -0
  127. data/spec/models/{tag_spec.rb → tag_read_spec.rb} +6 -6
  128. metadata +66 -26
@@ -0,0 +1,557 @@
1
+ =begin
2
+ #Pulp 3 API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: v3
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpAnsibleClient
16
+ class AnsibleCollectionRemoteRead
17
+ attr_accessor :pulp_href
18
+
19
+ # Timestamp of creation.
20
+ attr_accessor :pulp_created
21
+
22
+ # A unique name for this remote.
23
+ attr_accessor :name
24
+
25
+ # The URL of an external content source.
26
+ attr_accessor :url
27
+
28
+ # A string containing the PEM encoded CA certificate used to validate the server certificate presented by the remote server. All new line characters must be escaped.
29
+ attr_accessor :ca_cert
30
+
31
+ # A string containing the PEM encoded client certificate used for authentication. All new line characters must be escaped.
32
+ attr_accessor :client_cert
33
+
34
+ # A PEM encoded private key used for authentication.
35
+ attr_accessor :client_key
36
+
37
+ # If True, TLS peer validation must be performed.
38
+ attr_accessor :tls_validation
39
+
40
+ # The proxy URL. Format: scheme://user:password@host:port
41
+ attr_accessor :proxy_url
42
+
43
+ # The username to be used for authentication when syncing.
44
+ attr_accessor :username
45
+
46
+ # The password to be used for authentication when syncing.
47
+ attr_accessor :password
48
+
49
+ # Timestamp of the most recent update of the remote.
50
+ attr_accessor :pulp_last_updated
51
+
52
+ # Total number of simultaneous connections.
53
+ attr_accessor :download_concurrency
54
+
55
+ # The policy to use when downloading content.
56
+ attr_accessor :policy
57
+
58
+ # The string version of Collection requirements yaml.
59
+ attr_accessor :requirements_file
60
+
61
+ class EnumAttributeValidator
62
+ attr_reader :datatype
63
+ attr_reader :allowable_values
64
+
65
+ def initialize(datatype, allowable_values)
66
+ @allowable_values = allowable_values.map do |value|
67
+ case datatype.to_s
68
+ when /Integer/i
69
+ value.to_i
70
+ when /Float/i
71
+ value.to_f
72
+ else
73
+ value
74
+ end
75
+ end
76
+ end
77
+
78
+ def valid?(value)
79
+ !value || allowable_values.include?(value)
80
+ end
81
+ end
82
+
83
+ # Attribute mapping from ruby-style variable name to JSON key.
84
+ def self.attribute_map
85
+ {
86
+ :'pulp_href' => :'pulp_href',
87
+ :'pulp_created' => :'pulp_created',
88
+ :'name' => :'name',
89
+ :'url' => :'url',
90
+ :'ca_cert' => :'ca_cert',
91
+ :'client_cert' => :'client_cert',
92
+ :'client_key' => :'client_key',
93
+ :'tls_validation' => :'tls_validation',
94
+ :'proxy_url' => :'proxy_url',
95
+ :'username' => :'username',
96
+ :'password' => :'password',
97
+ :'pulp_last_updated' => :'pulp_last_updated',
98
+ :'download_concurrency' => :'download_concurrency',
99
+ :'policy' => :'policy',
100
+ :'requirements_file' => :'requirements_file'
101
+ }
102
+ end
103
+
104
+ # Attribute type mapping.
105
+ def self.openapi_types
106
+ {
107
+ :'pulp_href' => :'String',
108
+ :'pulp_created' => :'DateTime',
109
+ :'name' => :'String',
110
+ :'url' => :'String',
111
+ :'ca_cert' => :'String',
112
+ :'client_cert' => :'String',
113
+ :'client_key' => :'String',
114
+ :'tls_validation' => :'Boolean',
115
+ :'proxy_url' => :'String',
116
+ :'username' => :'String',
117
+ :'password' => :'String',
118
+ :'pulp_last_updated' => :'DateTime',
119
+ :'download_concurrency' => :'Integer',
120
+ :'policy' => :'String',
121
+ :'requirements_file' => :'String'
122
+ }
123
+ end
124
+
125
+ # List of attributes with nullable: true
126
+ def self.openapi_nullable
127
+ Set.new([
128
+ :'ca_cert',
129
+ :'client_cert',
130
+ :'client_key',
131
+ :'proxy_url',
132
+ :'username',
133
+ :'password',
134
+ :'requirements_file'
135
+ ])
136
+ end
137
+
138
+ # Initializes the object
139
+ # @param [Hash] attributes Model attributes in the form of hash
140
+ def initialize(attributes = {})
141
+ if (!attributes.is_a?(Hash))
142
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpAnsibleClient::AnsibleCollectionRemoteRead` initialize method"
143
+ end
144
+
145
+ # check to see if the attribute exists and convert string to symbol for hash key
146
+ attributes = attributes.each_with_object({}) { |(k, v), h|
147
+ if (!self.class.attribute_map.key?(k.to_sym))
148
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpAnsibleClient::AnsibleCollectionRemoteRead`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
149
+ end
150
+ h[k.to_sym] = v
151
+ }
152
+
153
+ if attributes.key?(:'pulp_href')
154
+ self.pulp_href = attributes[:'pulp_href']
155
+ end
156
+
157
+ if attributes.key?(:'pulp_created')
158
+ self.pulp_created = attributes[:'pulp_created']
159
+ end
160
+
161
+ if attributes.key?(:'name')
162
+ self.name = attributes[:'name']
163
+ end
164
+
165
+ if attributes.key?(:'url')
166
+ self.url = attributes[:'url']
167
+ end
168
+
169
+ if attributes.key?(:'ca_cert')
170
+ self.ca_cert = attributes[:'ca_cert']
171
+ end
172
+
173
+ if attributes.key?(:'client_cert')
174
+ self.client_cert = attributes[:'client_cert']
175
+ end
176
+
177
+ if attributes.key?(:'client_key')
178
+ self.client_key = attributes[:'client_key']
179
+ end
180
+
181
+ if attributes.key?(:'tls_validation')
182
+ self.tls_validation = attributes[:'tls_validation']
183
+ end
184
+
185
+ if attributes.key?(:'proxy_url')
186
+ self.proxy_url = attributes[:'proxy_url']
187
+ end
188
+
189
+ if attributes.key?(:'username')
190
+ self.username = attributes[:'username']
191
+ end
192
+
193
+ if attributes.key?(:'password')
194
+ self.password = attributes[:'password']
195
+ end
196
+
197
+ if attributes.key?(:'pulp_last_updated')
198
+ self.pulp_last_updated = attributes[:'pulp_last_updated']
199
+ end
200
+
201
+ if attributes.key?(:'download_concurrency')
202
+ self.download_concurrency = attributes[:'download_concurrency']
203
+ end
204
+
205
+ if attributes.key?(:'policy')
206
+ self.policy = attributes[:'policy']
207
+ else
208
+ self.policy = 'immediate'
209
+ end
210
+
211
+ if attributes.key?(:'requirements_file')
212
+ self.requirements_file = attributes[:'requirements_file']
213
+ end
214
+ end
215
+
216
+ # Show invalid properties with the reasons. Usually used together with valid?
217
+ # @return Array for valid properties with the reasons
218
+ def list_invalid_properties
219
+ invalid_properties = Array.new
220
+ if @name.nil?
221
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
222
+ end
223
+
224
+ if @name.to_s.length < 1
225
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
226
+ end
227
+
228
+ if @url.nil?
229
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
230
+ end
231
+
232
+ if @url.to_s.length < 1
233
+ invalid_properties.push('invalid value for "url", the character length must be great than or equal to 1.')
234
+ end
235
+
236
+ if !@ca_cert.nil? && @ca_cert.to_s.length < 1
237
+ invalid_properties.push('invalid value for "ca_cert", the character length must be great than or equal to 1.')
238
+ end
239
+
240
+ if !@client_cert.nil? && @client_cert.to_s.length < 1
241
+ invalid_properties.push('invalid value for "client_cert", the character length must be great than or equal to 1.')
242
+ end
243
+
244
+ if !@client_key.nil? && @client_key.to_s.length < 1
245
+ invalid_properties.push('invalid value for "client_key", the character length must be great than or equal to 1.')
246
+ end
247
+
248
+ if !@proxy_url.nil? && @proxy_url.to_s.length < 1
249
+ invalid_properties.push('invalid value for "proxy_url", the character length must be great than or equal to 1.')
250
+ end
251
+
252
+ if !@username.nil? && @username.to_s.length < 1
253
+ invalid_properties.push('invalid value for "username", the character length must be great than or equal to 1.')
254
+ end
255
+
256
+ if !@password.nil? && @password.to_s.length < 1
257
+ invalid_properties.push('invalid value for "password", the character length must be great than or equal to 1.')
258
+ end
259
+
260
+ if !@download_concurrency.nil? && @download_concurrency < 1
261
+ invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
262
+ end
263
+
264
+ if !@requirements_file.nil? && @requirements_file.to_s.length < 1
265
+ invalid_properties.push('invalid value for "requirements_file", the character length must be great than or equal to 1.')
266
+ end
267
+
268
+ invalid_properties
269
+ end
270
+
271
+ # Check to see if the all the properties in the model are valid
272
+ # @return true if the model is valid
273
+ def valid?
274
+ return false if @name.nil?
275
+ return false if @name.to_s.length < 1
276
+ return false if @url.nil?
277
+ return false if @url.to_s.length < 1
278
+ return false if !@ca_cert.nil? && @ca_cert.to_s.length < 1
279
+ return false if !@client_cert.nil? && @client_cert.to_s.length < 1
280
+ return false if !@client_key.nil? && @client_key.to_s.length < 1
281
+ return false if !@proxy_url.nil? && @proxy_url.to_s.length < 1
282
+ return false if !@username.nil? && @username.to_s.length < 1
283
+ return false if !@password.nil? && @password.to_s.length < 1
284
+ return false if !@download_concurrency.nil? && @download_concurrency < 1
285
+ policy_validator = EnumAttributeValidator.new('String', ["immediate", "When syncing, download all metadata and content now."])
286
+ return false unless policy_validator.valid?(@policy)
287
+ return false if !@requirements_file.nil? && @requirements_file.to_s.length < 1
288
+ true
289
+ end
290
+
291
+ # Custom attribute writer method with validation
292
+ # @param [Object] name Value to be assigned
293
+ def name=(name)
294
+ if name.nil?
295
+ fail ArgumentError, 'name cannot be nil'
296
+ end
297
+
298
+ if name.to_s.length < 1
299
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
300
+ end
301
+
302
+ @name = name
303
+ end
304
+
305
+ # Custom attribute writer method with validation
306
+ # @param [Object] url Value to be assigned
307
+ def url=(url)
308
+ if url.nil?
309
+ fail ArgumentError, 'url cannot be nil'
310
+ end
311
+
312
+ if url.to_s.length < 1
313
+ fail ArgumentError, 'invalid value for "url", the character length must be great than or equal to 1.'
314
+ end
315
+
316
+ @url = url
317
+ end
318
+
319
+ # Custom attribute writer method with validation
320
+ # @param [Object] ca_cert Value to be assigned
321
+ def ca_cert=(ca_cert)
322
+ if !ca_cert.nil? && ca_cert.to_s.length < 1
323
+ fail ArgumentError, 'invalid value for "ca_cert", the character length must be great than or equal to 1.'
324
+ end
325
+
326
+ @ca_cert = ca_cert
327
+ end
328
+
329
+ # Custom attribute writer method with validation
330
+ # @param [Object] client_cert Value to be assigned
331
+ def client_cert=(client_cert)
332
+ if !client_cert.nil? && client_cert.to_s.length < 1
333
+ fail ArgumentError, 'invalid value for "client_cert", the character length must be great than or equal to 1.'
334
+ end
335
+
336
+ @client_cert = client_cert
337
+ end
338
+
339
+ # Custom attribute writer method with validation
340
+ # @param [Object] client_key Value to be assigned
341
+ def client_key=(client_key)
342
+ if !client_key.nil? && client_key.to_s.length < 1
343
+ fail ArgumentError, 'invalid value for "client_key", the character length must be great than or equal to 1.'
344
+ end
345
+
346
+ @client_key = client_key
347
+ end
348
+
349
+ # Custom attribute writer method with validation
350
+ # @param [Object] proxy_url Value to be assigned
351
+ def proxy_url=(proxy_url)
352
+ if !proxy_url.nil? && proxy_url.to_s.length < 1
353
+ fail ArgumentError, 'invalid value for "proxy_url", the character length must be great than or equal to 1.'
354
+ end
355
+
356
+ @proxy_url = proxy_url
357
+ end
358
+
359
+ # Custom attribute writer method with validation
360
+ # @param [Object] username Value to be assigned
361
+ def username=(username)
362
+ if !username.nil? && username.to_s.length < 1
363
+ fail ArgumentError, 'invalid value for "username", the character length must be great than or equal to 1.'
364
+ end
365
+
366
+ @username = username
367
+ end
368
+
369
+ # Custom attribute writer method with validation
370
+ # @param [Object] password Value to be assigned
371
+ def password=(password)
372
+ if !password.nil? && password.to_s.length < 1
373
+ fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 1.'
374
+ end
375
+
376
+ @password = password
377
+ end
378
+
379
+ # Custom attribute writer method with validation
380
+ # @param [Object] download_concurrency Value to be assigned
381
+ def download_concurrency=(download_concurrency)
382
+ if !download_concurrency.nil? && download_concurrency < 1
383
+ fail ArgumentError, 'invalid value for "download_concurrency", must be greater than or equal to 1.'
384
+ end
385
+
386
+ @download_concurrency = download_concurrency
387
+ end
388
+
389
+ # Custom attribute writer method checking allowed values (enum).
390
+ # @param [Object] policy Object to be assigned
391
+ def policy=(policy)
392
+ validator = EnumAttributeValidator.new('String', ["immediate", "When syncing, download all metadata and content now."])
393
+ unless validator.valid?(policy)
394
+ fail ArgumentError, "invalid value for \"policy\", must be one of #{validator.allowable_values}."
395
+ end
396
+ @policy = policy
397
+ end
398
+
399
+ # Custom attribute writer method with validation
400
+ # @param [Object] requirements_file Value to be assigned
401
+ def requirements_file=(requirements_file)
402
+ if !requirements_file.nil? && requirements_file.to_s.length < 1
403
+ fail ArgumentError, 'invalid value for "requirements_file", the character length must be great than or equal to 1.'
404
+ end
405
+
406
+ @requirements_file = requirements_file
407
+ end
408
+
409
+ # Checks equality by comparing each attribute.
410
+ # @param [Object] Object to be compared
411
+ def ==(o)
412
+ return true if self.equal?(o)
413
+ self.class == o.class &&
414
+ pulp_href == o.pulp_href &&
415
+ pulp_created == o.pulp_created &&
416
+ name == o.name &&
417
+ url == o.url &&
418
+ ca_cert == o.ca_cert &&
419
+ client_cert == o.client_cert &&
420
+ client_key == o.client_key &&
421
+ tls_validation == o.tls_validation &&
422
+ proxy_url == o.proxy_url &&
423
+ username == o.username &&
424
+ password == o.password &&
425
+ pulp_last_updated == o.pulp_last_updated &&
426
+ download_concurrency == o.download_concurrency &&
427
+ policy == o.policy &&
428
+ requirements_file == o.requirements_file
429
+ end
430
+
431
+ # @see the `==` method
432
+ # @param [Object] Object to be compared
433
+ def eql?(o)
434
+ self == o
435
+ end
436
+
437
+ # Calculates hash code according to all attributes.
438
+ # @return [Integer] Hash code
439
+ def hash
440
+ [pulp_href, pulp_created, name, url, ca_cert, client_cert, client_key, tls_validation, proxy_url, username, password, pulp_last_updated, download_concurrency, policy, requirements_file].hash
441
+ end
442
+
443
+ # Builds the object from hash
444
+ # @param [Hash] attributes Model attributes in the form of hash
445
+ # @return [Object] Returns the model itself
446
+ def self.build_from_hash(attributes)
447
+ new.build_from_hash(attributes)
448
+ end
449
+
450
+ # Builds the object from hash
451
+ # @param [Hash] attributes Model attributes in the form of hash
452
+ # @return [Object] Returns the model itself
453
+ def build_from_hash(attributes)
454
+ return nil unless attributes.is_a?(Hash)
455
+ self.class.openapi_types.each_pair do |key, type|
456
+ if type =~ /\AArray<(.*)>/i
457
+ # check to ensure the input is an array given that the attribute
458
+ # is documented as an array but the input is not
459
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
460
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
461
+ end
462
+ elsif !attributes[self.class.attribute_map[key]].nil?
463
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
464
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
465
+ end
466
+
467
+ self
468
+ end
469
+
470
+ # Deserializes the data based on type
471
+ # @param string type Data type
472
+ # @param string value Value to be deserialized
473
+ # @return [Object] Deserialized data
474
+ def _deserialize(type, value)
475
+ case type.to_sym
476
+ when :DateTime
477
+ DateTime.parse(value)
478
+ when :Date
479
+ Date.parse(value)
480
+ when :String
481
+ value.to_s
482
+ when :Integer
483
+ value.to_i
484
+ when :Float
485
+ value.to_f
486
+ when :Boolean
487
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
488
+ true
489
+ else
490
+ false
491
+ end
492
+ when :Object
493
+ # generic object (usually a Hash), return directly
494
+ value
495
+ when /\AArray<(?<inner_type>.+)>\z/
496
+ inner_type = Regexp.last_match[:inner_type]
497
+ value.map { |v| _deserialize(inner_type, v) }
498
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
499
+ k_type = Regexp.last_match[:k_type]
500
+ v_type = Regexp.last_match[:v_type]
501
+ {}.tap do |hash|
502
+ value.each do |k, v|
503
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
504
+ end
505
+ end
506
+ else # model
507
+ PulpAnsibleClient.const_get(type).build_from_hash(value)
508
+ end
509
+ end
510
+
511
+ # Returns the string representation of the object
512
+ # @return [String] String presentation of the object
513
+ def to_s
514
+ to_hash.to_s
515
+ end
516
+
517
+ # to_body is an alias to to_hash (backward compatibility)
518
+ # @return [Hash] Returns the object in the form of hash
519
+ def to_body
520
+ to_hash
521
+ end
522
+
523
+ # Returns the object in the form of hash
524
+ # @return [Hash] Returns the object in the form of hash
525
+ def to_hash
526
+ hash = {}
527
+ self.class.attribute_map.each_pair do |attr, param|
528
+ value = self.send(attr)
529
+ if value.nil?
530
+ is_nullable = self.class.openapi_nullable.include?(attr)
531
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
532
+ end
533
+
534
+ hash[param] = _to_hash(value)
535
+ end
536
+ hash
537
+ end
538
+
539
+ # Outputs non-array value in the form of hash
540
+ # For object, use to_hash. Otherwise, just return the value
541
+ # @param [Object] value Any valid value
542
+ # @return [Hash] Returns the value in the form of hash
543
+ def _to_hash(value)
544
+ if value.is_a?(Array)
545
+ value.compact.map { |v| _to_hash(v) }
546
+ elsif value.is_a?(Hash)
547
+ {}.tap do |hash|
548
+ value.each { |k, v| hash[k] = _to_hash(v) }
549
+ end
550
+ elsif value.respond_to? :to_hash
551
+ value.to_hash
552
+ else
553
+ value
554
+ end
555
+ end
556
+ end
557
+ end