pulp_cookbook_client 0.1.0b9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +162 -0
  4. data/Rakefile +10 -0
  5. data/docs/AsyncOperationResponse.md +17 -0
  6. data/docs/ContentCookbooksApi.md +208 -0
  7. data/docs/ContentSummary.md +21 -0
  8. data/docs/ContentSummaryResponse.md +21 -0
  9. data/docs/CookbookCookbookDistribution.md +27 -0
  10. data/docs/CookbookCookbookDistributionResponse.md +33 -0
  11. data/docs/CookbookCookbookPackageContent.md +25 -0
  12. data/docs/CookbookCookbookPackageContentResponse.md +29 -0
  13. data/docs/CookbookCookbookPublication.md +19 -0
  14. data/docs/CookbookCookbookPublicationResponse.md +25 -0
  15. data/docs/CookbookCookbookRemote.md +59 -0
  16. data/docs/CookbookCookbookRemoteResponse.md +55 -0
  17. data/docs/CookbookCookbookRepository.md +25 -0
  18. data/docs/CookbookCookbookRepositoryResponse.md +33 -0
  19. data/docs/DistributionsCookbookApi.md +372 -0
  20. data/docs/PaginatedRepositoryVersionResponseList.md +23 -0
  21. data/docs/PaginatedcookbookCookbookDistributionResponseList.md +23 -0
  22. data/docs/PaginatedcookbookCookbookPackageContentResponseList.md +23 -0
  23. data/docs/PaginatedcookbookCookbookPublicationResponseList.md +23 -0
  24. data/docs/PaginatedcookbookCookbookRemoteResponseList.md +23 -0
  25. data/docs/PaginatedcookbookCookbookRepositoryResponseList.md +23 -0
  26. data/docs/PatchedcookbookCookbookDistribution.md +27 -0
  27. data/docs/PatchedcookbookCookbookRemote.md +59 -0
  28. data/docs/PatchedcookbookCookbookRepository.md +25 -0
  29. data/docs/PolicyEnum.md +16 -0
  30. data/docs/PublicationsCookbookApi.md +257 -0
  31. data/docs/RemotesCookbookApi.md +376 -0
  32. data/docs/RepositoriesCookbookApi.md +475 -0
  33. data/docs/RepositoriesCookbookVersionsApi.md +271 -0
  34. data/docs/RepositoryAddRemoveContent.md +21 -0
  35. data/docs/RepositorySyncURL.md +19 -0
  36. data/docs/RepositoryVersion.md +17 -0
  37. data/docs/RepositoryVersionResponse.md +27 -0
  38. data/git_push.sh +58 -0
  39. data/lib/pulp_cookbook_client/api/content_cookbooks_api.rb +264 -0
  40. data/lib/pulp_cookbook_client/api/distributions_cookbook_api.rb +457 -0
  41. data/lib/pulp_cookbook_client/api/publications_cookbook_api.rb +312 -0
  42. data/lib/pulp_cookbook_client/api/remotes_cookbook_api.rb +463 -0
  43. data/lib/pulp_cookbook_client/api/repositories_cookbook_api.rb +583 -0
  44. data/lib/pulp_cookbook_client/api/repositories_cookbook_versions_api.rb +339 -0
  45. data/lib/pulp_cookbook_client/api_client.rb +406 -0
  46. data/lib/pulp_cookbook_client/api_error.rb +57 -0
  47. data/lib/pulp_cookbook_client/configuration.rb +250 -0
  48. data/lib/pulp_cookbook_client/models/async_operation_response.rb +213 -0
  49. data/lib/pulp_cookbook_client/models/content_summary.rb +246 -0
  50. data/lib/pulp_cookbook_client/models/content_summary_response.rb +246 -0
  51. data/lib/pulp_cookbook_client/models/cookbook_cookbook_distribution.rb +308 -0
  52. data/lib/pulp_cookbook_client/models/cookbook_cookbook_distribution_response.rb +299 -0
  53. data/lib/pulp_cookbook_client/models/cookbook_cookbook_package_content.rb +287 -0
  54. data/lib/pulp_cookbook_client/models/cookbook_cookbook_package_content_response.rb +272 -0
  55. data/lib/pulp_cookbook_client/models/cookbook_cookbook_publication.rb +217 -0
  56. data/lib/pulp_cookbook_client/models/cookbook_cookbook_publication_response.rb +248 -0
  57. data/lib/pulp_cookbook_client/models/cookbook_cookbook_remote.rb +677 -0
  58. data/lib/pulp_cookbook_client/models/cookbook_cookbook_remote_response.rb +493 -0
  59. data/lib/pulp_cookbook_client/models/cookbook_cookbook_repository.rb +304 -0
  60. data/lib/pulp_cookbook_client/models/cookbook_cookbook_repository_response.rb +307 -0
  61. data/lib/pulp_cookbook_client/models/paginated_repository_version_response_list.rb +237 -0
  62. data/lib/pulp_cookbook_client/models/paginatedcookbook_cookbook_distribution_response_list.rb +237 -0
  63. data/lib/pulp_cookbook_client/models/paginatedcookbook_cookbook_package_content_response_list.rb +237 -0
  64. data/lib/pulp_cookbook_client/models/paginatedcookbook_cookbook_publication_response_list.rb +237 -0
  65. data/lib/pulp_cookbook_client/models/paginatedcookbook_cookbook_remote_response_list.rb +237 -0
  66. data/lib/pulp_cookbook_client/models/paginatedcookbook_cookbook_repository_response_list.rb +237 -0
  67. data/lib/pulp_cookbook_client/models/patchedcookbook_cookbook_distribution.rb +290 -0
  68. data/lib/pulp_cookbook_client/models/patchedcookbook_cookbook_remote.rb +659 -0
  69. data/lib/pulp_cookbook_client/models/patchedcookbook_cookbook_repository.rb +295 -0
  70. data/lib/pulp_cookbook_client/models/policy_enum.rb +37 -0
  71. data/lib/pulp_cookbook_client/models/repository_add_remove_content.rb +232 -0
  72. data/lib/pulp_cookbook_client/models/repository_sync_url.rb +220 -0
  73. data/lib/pulp_cookbook_client/models/repository_version.rb +208 -0
  74. data/lib/pulp_cookbook_client/models/repository_version_response.rb +255 -0
  75. data/lib/pulp_cookbook_client/version.rb +15 -0
  76. data/lib/pulp_cookbook_client.rb +72 -0
  77. data/pulp_cookbook_client.gemspec +39 -0
  78. data/spec/api/content_cookbooks_api_spec.rb +87 -0
  79. data/spec/api/distributions_cookbook_api_spec.rb +125 -0
  80. data/spec/api/publications_cookbook_api_spec.rb +98 -0
  81. data/spec/api/remotes_cookbook_api_spec.rb +127 -0
  82. data/spec/api/repositories_cookbook_api_spec.rb +146 -0
  83. data/spec/api/repositories_cookbook_versions_api_spec.rb +104 -0
  84. data/spec/api_client_spec.rb +188 -0
  85. data/spec/configuration_spec.rb +42 -0
  86. data/spec/models/async_operation_response_spec.rb +41 -0
  87. data/spec/models/content_summary_response_spec.rb +53 -0
  88. data/spec/models/content_summary_spec.rb +53 -0
  89. data/spec/models/cookbook_cookbook_distribution_response_spec.rb +89 -0
  90. data/spec/models/cookbook_cookbook_distribution_spec.rb +71 -0
  91. data/spec/models/cookbook_cookbook_package_content_response_spec.rb +77 -0
  92. data/spec/models/cookbook_cookbook_package_content_spec.rb +65 -0
  93. data/spec/models/cookbook_cookbook_publication_response_spec.rb +65 -0
  94. data/spec/models/cookbook_cookbook_publication_spec.rb +47 -0
  95. data/spec/models/cookbook_cookbook_remote_response_spec.rb +155 -0
  96. data/spec/models/cookbook_cookbook_remote_spec.rb +167 -0
  97. data/spec/models/cookbook_cookbook_repository_response_spec.rb +89 -0
  98. data/spec/models/cookbook_cookbook_repository_spec.rb +65 -0
  99. data/spec/models/paginated_repository_version_response_list_spec.rb +59 -0
  100. data/spec/models/paginatedcookbook_cookbook_distribution_response_list_spec.rb +59 -0
  101. data/spec/models/paginatedcookbook_cookbook_package_content_response_list_spec.rb +59 -0
  102. data/spec/models/paginatedcookbook_cookbook_publication_response_list_spec.rb +59 -0
  103. data/spec/models/paginatedcookbook_cookbook_remote_response_list_spec.rb +59 -0
  104. data/spec/models/paginatedcookbook_cookbook_repository_response_list_spec.rb +59 -0
  105. data/spec/models/patchedcookbook_cookbook_distribution_spec.rb +71 -0
  106. data/spec/models/patchedcookbook_cookbook_remote_spec.rb +167 -0
  107. data/spec/models/patchedcookbook_cookbook_repository_spec.rb +65 -0
  108. data/spec/models/policy_enum_spec.rb +35 -0
  109. data/spec/models/repository_add_remove_content_spec.rb +53 -0
  110. data/spec/models/repository_sync_url_spec.rb +47 -0
  111. data/spec/models/repository_version_response_spec.rb +71 -0
  112. data/spec/models/repository_version_spec.rb +41 -0
  113. data/spec/spec_helper.rb +111 -0
  114. metadata +251 -0
@@ -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 PulpCookbookClient
16
+ # Serializer for the remote pointing to a universe repo.
17
+ class CookbookCookbookRemoteResponse
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.
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
+ # An optional JSON object in the format {\"<cookbook name>\": \"<version_string>\" }. Used to limit the cookbooks to synchronize from the remote
74
+ attr_accessor :cookbooks
75
+
76
+ # Attribute mapping from ruby-style variable name to JSON key.
77
+ def self.attribute_map
78
+ {
79
+ :'pulp_href' => :'pulp_href',
80
+ :'pulp_created' => :'pulp_created',
81
+ :'name' => :'name',
82
+ :'url' => :'url',
83
+ :'ca_cert' => :'ca_cert',
84
+ :'client_cert' => :'client_cert',
85
+ :'tls_validation' => :'tls_validation',
86
+ :'proxy_url' => :'proxy_url',
87
+ :'pulp_labels' => :'pulp_labels',
88
+ :'pulp_last_updated' => :'pulp_last_updated',
89
+ :'download_concurrency' => :'download_concurrency',
90
+ :'max_retries' => :'max_retries',
91
+ :'policy' => :'policy',
92
+ :'total_timeout' => :'total_timeout',
93
+ :'connect_timeout' => :'connect_timeout',
94
+ :'sock_connect_timeout' => :'sock_connect_timeout',
95
+ :'sock_read_timeout' => :'sock_read_timeout',
96
+ :'headers' => :'headers',
97
+ :'rate_limit' => :'rate_limit',
98
+ :'cookbooks' => :'cookbooks'
99
+ }
100
+ end
101
+
102
+ # Attribute type mapping.
103
+ def self.openapi_types
104
+ {
105
+ :'pulp_href' => :'String',
106
+ :'pulp_created' => :'DateTime',
107
+ :'name' => :'String',
108
+ :'url' => :'String',
109
+ :'ca_cert' => :'String',
110
+ :'client_cert' => :'String',
111
+ :'tls_validation' => :'Boolean',
112
+ :'proxy_url' => :'String',
113
+ :'pulp_labels' => :'Object',
114
+ :'pulp_last_updated' => :'DateTime',
115
+ :'download_concurrency' => :'Integer',
116
+ :'max_retries' => :'Integer',
117
+ :'policy' => :'PolicyEnum',
118
+ :'total_timeout' => :'Float',
119
+ :'connect_timeout' => :'Float',
120
+ :'sock_connect_timeout' => :'Float',
121
+ :'sock_read_timeout' => :'Float',
122
+ :'headers' => :'Array<Object>',
123
+ :'rate_limit' => :'Integer',
124
+ :'cookbooks' => :'Object'
125
+ }
126
+ end
127
+
128
+ # List of attributes with nullable: true
129
+ def self.openapi_nullable
130
+ Set.new([
131
+ :'ca_cert',
132
+ :'client_cert',
133
+ :'proxy_url',
134
+ :'download_concurrency',
135
+ :'max_retries',
136
+ :'total_timeout',
137
+ :'connect_timeout',
138
+ :'sock_connect_timeout',
139
+ :'sock_read_timeout',
140
+ :'rate_limit',
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 `PulpCookbookClient::CookbookCookbookRemoteResponse` 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 `PulpCookbookClient::CookbookCookbookRemoteResponse`. 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?(:'pulp_href')
160
+ self.pulp_href = attributes[:'pulp_href']
161
+ end
162
+
163
+ if attributes.key?(:'pulp_created')
164
+ self.pulp_created = attributes[:'pulp_created']
165
+ end
166
+
167
+ if attributes.key?(:'name')
168
+ self.name = attributes[:'name']
169
+ end
170
+
171
+ if attributes.key?(:'url')
172
+ self.url = attributes[:'url']
173
+ end
174
+
175
+ if attributes.key?(:'ca_cert')
176
+ self.ca_cert = attributes[:'ca_cert']
177
+ end
178
+
179
+ if attributes.key?(:'client_cert')
180
+ self.client_cert = attributes[:'client_cert']
181
+ end
182
+
183
+ if attributes.key?(:'tls_validation')
184
+ self.tls_validation = attributes[:'tls_validation']
185
+ end
186
+
187
+ if attributes.key?(:'proxy_url')
188
+ self.proxy_url = attributes[:'proxy_url']
189
+ end
190
+
191
+ if attributes.key?(:'pulp_labels')
192
+ self.pulp_labels = attributes[:'pulp_labels']
193
+ end
194
+
195
+ if attributes.key?(:'pulp_last_updated')
196
+ self.pulp_last_updated = attributes[:'pulp_last_updated']
197
+ end
198
+
199
+ if attributes.key?(:'download_concurrency')
200
+ self.download_concurrency = attributes[:'download_concurrency']
201
+ end
202
+
203
+ if attributes.key?(:'max_retries')
204
+ self.max_retries = attributes[:'max_retries']
205
+ end
206
+
207
+ if attributes.key?(:'policy')
208
+ self.policy = attributes[:'policy']
209
+ end
210
+
211
+ if attributes.key?(:'total_timeout')
212
+ self.total_timeout = attributes[:'total_timeout']
213
+ end
214
+
215
+ if attributes.key?(:'connect_timeout')
216
+ self.connect_timeout = attributes[:'connect_timeout']
217
+ end
218
+
219
+ if attributes.key?(:'sock_connect_timeout')
220
+ self.sock_connect_timeout = attributes[:'sock_connect_timeout']
221
+ end
222
+
223
+ if attributes.key?(:'sock_read_timeout')
224
+ self.sock_read_timeout = attributes[:'sock_read_timeout']
225
+ end
226
+
227
+ if attributes.key?(:'headers')
228
+ if (value = attributes[:'headers']).is_a?(Array)
229
+ self.headers = value
230
+ end
231
+ end
232
+
233
+ if attributes.key?(:'rate_limit')
234
+ self.rate_limit = attributes[:'rate_limit']
235
+ end
236
+
237
+ if attributes.key?(:'cookbooks')
238
+ self.cookbooks = attributes[:'cookbooks']
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 @name.nil?
247
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
248
+ end
249
+
250
+ if @url.nil?
251
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
252
+ end
253
+
254
+ if !@download_concurrency.nil? && @download_concurrency < 1
255
+ invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
256
+ end
257
+
258
+ if !@total_timeout.nil? && @total_timeout < 0.0
259
+ invalid_properties.push('invalid value for "total_timeout", must be greater than or equal to 0.0.')
260
+ end
261
+
262
+ if !@connect_timeout.nil? && @connect_timeout < 0.0
263
+ invalid_properties.push('invalid value for "connect_timeout", must be greater than or equal to 0.0.')
264
+ end
265
+
266
+ if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
267
+ invalid_properties.push('invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.')
268
+ end
269
+
270
+ if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
271
+ invalid_properties.push('invalid value for "sock_read_timeout", must be greater than or equal to 0.0.')
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 @name.nil?
281
+ return false if @url.nil?
282
+ return false if !@download_concurrency.nil? && @download_concurrency < 1
283
+ return false if !@total_timeout.nil? && @total_timeout < 0.0
284
+ return false if !@connect_timeout.nil? && @connect_timeout < 0.0
285
+ return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
286
+ return false if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
287
+ true
288
+ end
289
+
290
+ # Custom attribute writer method with validation
291
+ # @param [Object] download_concurrency Value to be assigned
292
+ def download_concurrency=(download_concurrency)
293
+ if !download_concurrency.nil? && download_concurrency < 1
294
+ fail ArgumentError, 'invalid value for "download_concurrency", must be greater than or equal to 1.'
295
+ end
296
+
297
+ @download_concurrency = download_concurrency
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] sock_read_timeout Value to be assigned
332
+ def sock_read_timeout=(sock_read_timeout)
333
+ if !sock_read_timeout.nil? && sock_read_timeout < 0.0
334
+ fail ArgumentError, 'invalid value for "sock_read_timeout", must be greater than or equal to 0.0.'
335
+ end
336
+
337
+ @sock_read_timeout = sock_read_timeout
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
+ pulp_href == o.pulp_href &&
346
+ pulp_created == o.pulp_created &&
347
+ name == o.name &&
348
+ url == o.url &&
349
+ ca_cert == o.ca_cert &&
350
+ client_cert == o.client_cert &&
351
+ tls_validation == o.tls_validation &&
352
+ proxy_url == o.proxy_url &&
353
+ pulp_labels == o.pulp_labels &&
354
+ pulp_last_updated == o.pulp_last_updated &&
355
+ download_concurrency == o.download_concurrency &&
356
+ max_retries == o.max_retries &&
357
+ policy == o.policy &&
358
+ total_timeout == o.total_timeout &&
359
+ connect_timeout == o.connect_timeout &&
360
+ sock_connect_timeout == o.sock_connect_timeout &&
361
+ sock_read_timeout == o.sock_read_timeout &&
362
+ headers == o.headers &&
363
+ rate_limit == o.rate_limit &&
364
+ cookbooks == o.cookbooks
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
+ [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, cookbooks].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
+ PulpCookbookClient.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