pulp_ostree_client 2.0.0a1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +174 -0
  4. data/Rakefile +10 -0
  5. data/docs/AsyncOperationResponse.md +17 -0
  6. data/docs/ContentCommitsApi.md +138 -0
  7. data/docs/ContentConfigsApi.md +138 -0
  8. data/docs/ContentObjectsApi.md +138 -0
  9. data/docs/ContentRefsApi.md +138 -0
  10. data/docs/ContentSummariesApi.md +138 -0
  11. data/docs/ContentSummary.md +21 -0
  12. data/docs/ContentSummaryResponse.md +21 -0
  13. data/docs/DistributionsOstreeApi.md +372 -0
  14. data/docs/OstreeOstreeCommitResponse.md +25 -0
  15. data/docs/OstreeOstreeConfigResponse.md +21 -0
  16. data/docs/OstreeOstreeDistribution.md +27 -0
  17. data/docs/OstreeOstreeDistributionResponse.md +33 -0
  18. data/docs/OstreeOstreeObjectResponse.md +27 -0
  19. data/docs/OstreeOstreeRefResponse.md +25 -0
  20. data/docs/OstreeOstreeRemote.md +59 -0
  21. data/docs/OstreeOstreeRemoteResponse.md +55 -0
  22. data/docs/OstreeOstreeRepository.md +25 -0
  23. data/docs/OstreeOstreeRepositoryResponse.md +33 -0
  24. data/docs/OstreeOstreeSummaryResponse.md +21 -0
  25. data/docs/OstreeRepoImport.md +23 -0
  26. data/docs/PaginatedRepositoryVersionResponseList.md +23 -0
  27. data/docs/PaginatedostreeOstreeCommitResponseList.md +23 -0
  28. data/docs/PaginatedostreeOstreeConfigResponseList.md +23 -0
  29. data/docs/PaginatedostreeOstreeDistributionResponseList.md +23 -0
  30. data/docs/PaginatedostreeOstreeObjectResponseList.md +23 -0
  31. data/docs/PaginatedostreeOstreeRefResponseList.md +23 -0
  32. data/docs/PaginatedostreeOstreeRemoteResponseList.md +23 -0
  33. data/docs/PaginatedostreeOstreeRepositoryResponseList.md +23 -0
  34. data/docs/PaginatedostreeOstreeSummaryResponseList.md +23 -0
  35. data/docs/PatchedostreeOstreeDistribution.md +27 -0
  36. data/docs/PatchedostreeOstreeRemote.md +59 -0
  37. data/docs/PatchedostreeOstreeRepository.md +25 -0
  38. data/docs/PolicyEnum.md +16 -0
  39. data/docs/RemotesOstreeApi.md +376 -0
  40. data/docs/RepositoriesOstreeApi.md +532 -0
  41. data/docs/RepositoriesOstreeVersionsApi.md +271 -0
  42. data/docs/RepositoryAddRemoveContent.md +21 -0
  43. data/docs/RepositorySyncURL.md +19 -0
  44. data/docs/RepositoryVersion.md +17 -0
  45. data/docs/RepositoryVersionResponse.md +27 -0
  46. data/git_push.sh +58 -0
  47. data/lib/pulp_ostree_client/api/content_commits_api.rb +170 -0
  48. data/lib/pulp_ostree_client/api/content_configs_api.rb +170 -0
  49. data/lib/pulp_ostree_client/api/content_objects_api.rb +170 -0
  50. data/lib/pulp_ostree_client/api/content_refs_api.rb +170 -0
  51. data/lib/pulp_ostree_client/api/content_summaries_api.rb +170 -0
  52. data/lib/pulp_ostree_client/api/distributions_ostree_api.rb +457 -0
  53. data/lib/pulp_ostree_client/api/remotes_ostree_api.rb +463 -0
  54. data/lib/pulp_ostree_client/api/repositories_ostree_api.rb +655 -0
  55. data/lib/pulp_ostree_client/api/repositories_ostree_versions_api.rb +339 -0
  56. data/lib/pulp_ostree_client/api_client.rb +406 -0
  57. data/lib/pulp_ostree_client/api_error.rb +57 -0
  58. data/lib/pulp_ostree_client/configuration.rb +250 -0
  59. data/lib/pulp_ostree_client/models/async_operation_response.rb +213 -0
  60. data/lib/pulp_ostree_client/models/content_summary.rb +246 -0
  61. data/lib/pulp_ostree_client/models/content_summary_response.rb +246 -0
  62. data/lib/pulp_ostree_client/models/ostree_ostree_commit_response.rb +256 -0
  63. data/lib/pulp_ostree_client/models/ostree_ostree_config_response.rb +232 -0
  64. data/lib/pulp_ostree_client/models/ostree_ostree_distribution.rb +270 -0
  65. data/lib/pulp_ostree_client/models/ostree_ostree_distribution_response.rb +299 -0
  66. data/lib/pulp_ostree_client/models/ostree_ostree_object_response.rb +275 -0
  67. data/lib/pulp_ostree_client/models/ostree_ostree_ref_response.rb +260 -0
  68. data/lib/pulp_ostree_client/models/ostree_ostree_remote.rb +536 -0
  69. data/lib/pulp_ostree_client/models/ostree_ostree_remote_response.rb +510 -0
  70. data/lib/pulp_ostree_client/models/ostree_ostree_repository.rb +270 -0
  71. data/lib/pulp_ostree_client/models/ostree_ostree_repository_response.rb +307 -0
  72. data/lib/pulp_ostree_client/models/ostree_ostree_summary_response.rb +232 -0
  73. data/lib/pulp_ostree_client/models/ostree_repo_import.rb +248 -0
  74. data/lib/pulp_ostree_client/models/paginated_repository_version_response_list.rb +237 -0
  75. data/lib/pulp_ostree_client/models/paginatedostree_ostree_commit_response_list.rb +237 -0
  76. data/lib/pulp_ostree_client/models/paginatedostree_ostree_config_response_list.rb +237 -0
  77. data/lib/pulp_ostree_client/models/paginatedostree_ostree_distribution_response_list.rb +237 -0
  78. data/lib/pulp_ostree_client/models/paginatedostree_ostree_object_response_list.rb +237 -0
  79. data/lib/pulp_ostree_client/models/paginatedostree_ostree_ref_response_list.rb +237 -0
  80. data/lib/pulp_ostree_client/models/paginatedostree_ostree_remote_response_list.rb +237 -0
  81. data/lib/pulp_ostree_client/models/paginatedostree_ostree_repository_response_list.rb +237 -0
  82. data/lib/pulp_ostree_client/models/paginatedostree_ostree_summary_response_list.rb +237 -0
  83. data/lib/pulp_ostree_client/models/patchedostree_ostree_distribution.rb +260 -0
  84. data/lib/pulp_ostree_client/models/patchedostree_ostree_remote.rb +526 -0
  85. data/lib/pulp_ostree_client/models/patchedostree_ostree_repository.rb +265 -0
  86. data/lib/pulp_ostree_client/models/policy_enum.rb +36 -0
  87. data/lib/pulp_ostree_client/models/repository_add_remove_content.rb +232 -0
  88. data/lib/pulp_ostree_client/models/repository_sync_url.rb +220 -0
  89. data/lib/pulp_ostree_client/models/repository_version.rb +208 -0
  90. data/lib/pulp_ostree_client/models/repository_version_response.rb +255 -0
  91. data/lib/pulp_ostree_client/version.rb +15 -0
  92. data/lib/pulp_ostree_client.rb +80 -0
  93. data/pulp_ostree_client.gemspec +39 -0
  94. data/spec/api/content_commits_api_spec.rb +68 -0
  95. data/spec/api/content_configs_api_spec.rb +68 -0
  96. data/spec/api/content_objects_api_spec.rb +68 -0
  97. data/spec/api/content_refs_api_spec.rb +68 -0
  98. data/spec/api/content_summaries_api_spec.rb +68 -0
  99. data/spec/api/distributions_ostree_api_spec.rb +125 -0
  100. data/spec/api/remotes_ostree_api_spec.rb +127 -0
  101. data/spec/api/repositories_ostree_api_spec.rb +160 -0
  102. data/spec/api/repositories_ostree_versions_api_spec.rb +104 -0
  103. data/spec/api_client_spec.rb +188 -0
  104. data/spec/configuration_spec.rb +42 -0
  105. data/spec/models/async_operation_response_spec.rb +41 -0
  106. data/spec/models/content_summary_response_spec.rb +53 -0
  107. data/spec/models/content_summary_spec.rb +53 -0
  108. data/spec/models/ostree_ostree_commit_response_spec.rb +65 -0
  109. data/spec/models/ostree_ostree_config_response_spec.rb +53 -0
  110. data/spec/models/ostree_ostree_distribution_response_spec.rb +89 -0
  111. data/spec/models/ostree_ostree_distribution_spec.rb +71 -0
  112. data/spec/models/ostree_ostree_object_response_spec.rb +71 -0
  113. data/spec/models/ostree_ostree_ref_response_spec.rb +65 -0
  114. data/spec/models/ostree_ostree_remote_response_spec.rb +155 -0
  115. data/spec/models/ostree_ostree_remote_spec.rb +167 -0
  116. data/spec/models/ostree_ostree_repository_response_spec.rb +89 -0
  117. data/spec/models/ostree_ostree_repository_spec.rb +65 -0
  118. data/spec/models/ostree_ostree_summary_response_spec.rb +53 -0
  119. data/spec/models/ostree_repo_import_spec.rb +59 -0
  120. data/spec/models/paginated_repository_version_response_list_spec.rb +59 -0
  121. data/spec/models/paginatedostree_ostree_commit_response_list_spec.rb +59 -0
  122. data/spec/models/paginatedostree_ostree_config_response_list_spec.rb +59 -0
  123. data/spec/models/paginatedostree_ostree_distribution_response_list_spec.rb +59 -0
  124. data/spec/models/paginatedostree_ostree_object_response_list_spec.rb +59 -0
  125. data/spec/models/paginatedostree_ostree_ref_response_list_spec.rb +59 -0
  126. data/spec/models/paginatedostree_ostree_remote_response_list_spec.rb +59 -0
  127. data/spec/models/paginatedostree_ostree_repository_response_list_spec.rb +59 -0
  128. data/spec/models/paginatedostree_ostree_summary_response_list_spec.rb +59 -0
  129. data/spec/models/patchedostree_ostree_distribution_spec.rb +71 -0
  130. data/spec/models/patchedostree_ostree_remote_spec.rb +167 -0
  131. data/spec/models/patchedostree_ostree_repository_spec.rb +65 -0
  132. data/spec/models/policy_enum_spec.rb +35 -0
  133. data/spec/models/repository_add_remove_content_spec.rb +53 -0
  134. data/spec/models/repository_sync_url_spec.rb +47 -0
  135. data/spec/models/repository_version_response_spec.rb +71 -0
  136. data/spec/models/repository_version_spec.rb +41 -0
  137. data/spec/spec_helper.rb +111 -0
  138. metadata +277 -0
@@ -0,0 +1,526 @@
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 PulpOstreeClient
16
+ # A Serializer class for a remote OSTree repository.
17
+ class PatchedostreeOstreeRemote
18
+ # A unique name for this remote.
19
+ attr_accessor :name
20
+
21
+ # The URL of an external content source.
22
+ attr_accessor :url
23
+
24
+ # A PEM encoded CA certificate used to validate the server certificate presented by the remote server.
25
+ attr_accessor :ca_cert
26
+
27
+ # A PEM encoded client certificate used for authentication.
28
+ attr_accessor :client_cert
29
+
30
+ # A PEM encoded private key used for authentication.
31
+ attr_accessor :client_key
32
+
33
+ # If True, TLS peer validation must be performed.
34
+ attr_accessor :tls_validation
35
+
36
+ # The proxy URL. Format: scheme://host:port
37
+ attr_accessor :proxy_url
38
+
39
+ # The username to authenticte to the proxy.
40
+ attr_accessor :proxy_username
41
+
42
+ # The password to authenticte to the proxy.
43
+ attr_accessor :proxy_password
44
+
45
+ # The username to be used for authentication when syncing.
46
+ attr_accessor :username
47
+
48
+ # The password to be used for authentication when syncing.
49
+ attr_accessor :password
50
+
51
+ attr_accessor :pulp_labels
52
+
53
+ # Total number of simultaneous connections. If not set then the default value will be used.
54
+ attr_accessor :download_concurrency
55
+
56
+ # Maximum number of retry attempts after a download failure. If not set then the default value (3) will be used.
57
+ attr_accessor :max_retries
58
+
59
+ # immediate - All OSTree objects are downloaded and saved during synchronization. on_demand - Only commits, dirtrees, and refs are downloaded. Other OSTree objects are not downloaded until they are requested for the first time by a client.
60
+ attr_accessor :policy
61
+
62
+ # aiohttp.ClientTimeout.total (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
63
+ attr_accessor :total_timeout
64
+
65
+ # aiohttp.ClientTimeout.connect (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
66
+ attr_accessor :connect_timeout
67
+
68
+ # 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.
69
+ attr_accessor :sock_connect_timeout
70
+
71
+ # 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.
72
+ attr_accessor :sock_read_timeout
73
+
74
+ # Headers for aiohttp.Clientsession
75
+ attr_accessor :headers
76
+
77
+ # Limits total download rate in requests per second
78
+ attr_accessor :rate_limit
79
+
80
+ # An option to specify how many commits to traverse.
81
+ attr_accessor :depth
82
+
83
+ # Attribute mapping from ruby-style variable name to JSON key.
84
+ def self.attribute_map
85
+ {
86
+ :'name' => :'name',
87
+ :'url' => :'url',
88
+ :'ca_cert' => :'ca_cert',
89
+ :'client_cert' => :'client_cert',
90
+ :'client_key' => :'client_key',
91
+ :'tls_validation' => :'tls_validation',
92
+ :'proxy_url' => :'proxy_url',
93
+ :'proxy_username' => :'proxy_username',
94
+ :'proxy_password' => :'proxy_password',
95
+ :'username' => :'username',
96
+ :'password' => :'password',
97
+ :'pulp_labels' => :'pulp_labels',
98
+ :'download_concurrency' => :'download_concurrency',
99
+ :'max_retries' => :'max_retries',
100
+ :'policy' => :'policy',
101
+ :'total_timeout' => :'total_timeout',
102
+ :'connect_timeout' => :'connect_timeout',
103
+ :'sock_connect_timeout' => :'sock_connect_timeout',
104
+ :'sock_read_timeout' => :'sock_read_timeout',
105
+ :'headers' => :'headers',
106
+ :'rate_limit' => :'rate_limit',
107
+ :'depth' => :'depth'
108
+ }
109
+ end
110
+
111
+ # Attribute type mapping.
112
+ def self.openapi_types
113
+ {
114
+ :'name' => :'String',
115
+ :'url' => :'String',
116
+ :'ca_cert' => :'String',
117
+ :'client_cert' => :'String',
118
+ :'client_key' => :'String',
119
+ :'tls_validation' => :'Boolean',
120
+ :'proxy_url' => :'String',
121
+ :'proxy_username' => :'String',
122
+ :'proxy_password' => :'String',
123
+ :'username' => :'String',
124
+ :'password' => :'String',
125
+ :'pulp_labels' => :'Object',
126
+ :'download_concurrency' => :'Integer',
127
+ :'max_retries' => :'Integer',
128
+ :'policy' => :'PolicyEnum',
129
+ :'total_timeout' => :'Float',
130
+ :'connect_timeout' => :'Float',
131
+ :'sock_connect_timeout' => :'Float',
132
+ :'sock_read_timeout' => :'Float',
133
+ :'headers' => :'Array<Object>',
134
+ :'rate_limit' => :'Integer',
135
+ :'depth' => :'Integer'
136
+ }
137
+ end
138
+
139
+ # List of attributes with nullable: true
140
+ def self.openapi_nullable
141
+ Set.new([
142
+ :'ca_cert',
143
+ :'client_cert',
144
+ :'client_key',
145
+ :'proxy_url',
146
+ :'proxy_username',
147
+ :'proxy_password',
148
+ :'username',
149
+ :'password',
150
+ :'download_concurrency',
151
+ :'max_retries',
152
+ :'total_timeout',
153
+ :'connect_timeout',
154
+ :'sock_connect_timeout',
155
+ :'sock_read_timeout',
156
+ :'rate_limit',
157
+ ])
158
+ end
159
+
160
+ # Initializes the object
161
+ # @param [Hash] attributes Model attributes in the form of hash
162
+ def initialize(attributes = {})
163
+ if (!attributes.is_a?(Hash))
164
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpOstreeClient::PatchedostreeOstreeRemote` initialize method"
165
+ end
166
+
167
+ # check to see if the attribute exists and convert string to symbol for hash key
168
+ attributes = attributes.each_with_object({}) { |(k, v), h|
169
+ if (!self.class.attribute_map.key?(k.to_sym))
170
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpOstreeClient::PatchedostreeOstreeRemote`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
171
+ end
172
+ h[k.to_sym] = v
173
+ }
174
+
175
+ if attributes.key?(:'name')
176
+ self.name = attributes[:'name']
177
+ end
178
+
179
+ if attributes.key?(:'url')
180
+ self.url = attributes[:'url']
181
+ end
182
+
183
+ if attributes.key?(:'ca_cert')
184
+ self.ca_cert = attributes[:'ca_cert']
185
+ end
186
+
187
+ if attributes.key?(:'client_cert')
188
+ self.client_cert = attributes[:'client_cert']
189
+ end
190
+
191
+ if attributes.key?(:'client_key')
192
+ self.client_key = attributes[:'client_key']
193
+ end
194
+
195
+ if attributes.key?(:'tls_validation')
196
+ self.tls_validation = attributes[:'tls_validation']
197
+ end
198
+
199
+ if attributes.key?(:'proxy_url')
200
+ self.proxy_url = attributes[:'proxy_url']
201
+ end
202
+
203
+ if attributes.key?(:'proxy_username')
204
+ self.proxy_username = attributes[:'proxy_username']
205
+ end
206
+
207
+ if attributes.key?(:'proxy_password')
208
+ self.proxy_password = attributes[:'proxy_password']
209
+ end
210
+
211
+ if attributes.key?(:'username')
212
+ self.username = attributes[:'username']
213
+ end
214
+
215
+ if attributes.key?(:'password')
216
+ self.password = attributes[:'password']
217
+ end
218
+
219
+ if attributes.key?(:'pulp_labels')
220
+ self.pulp_labels = attributes[:'pulp_labels']
221
+ end
222
+
223
+ if attributes.key?(:'download_concurrency')
224
+ self.download_concurrency = attributes[:'download_concurrency']
225
+ end
226
+
227
+ if attributes.key?(:'max_retries')
228
+ self.max_retries = attributes[:'max_retries']
229
+ end
230
+
231
+ if attributes.key?(:'policy')
232
+ self.policy = attributes[:'policy']
233
+ end
234
+
235
+ if attributes.key?(:'total_timeout')
236
+ self.total_timeout = attributes[:'total_timeout']
237
+ end
238
+
239
+ if attributes.key?(:'connect_timeout')
240
+ self.connect_timeout = attributes[:'connect_timeout']
241
+ end
242
+
243
+ if attributes.key?(:'sock_connect_timeout')
244
+ self.sock_connect_timeout = attributes[:'sock_connect_timeout']
245
+ end
246
+
247
+ if attributes.key?(:'sock_read_timeout')
248
+ self.sock_read_timeout = attributes[:'sock_read_timeout']
249
+ end
250
+
251
+ if attributes.key?(:'headers')
252
+ if (value = attributes[:'headers']).is_a?(Array)
253
+ self.headers = value
254
+ end
255
+ end
256
+
257
+ if attributes.key?(:'rate_limit')
258
+ self.rate_limit = attributes[:'rate_limit']
259
+ end
260
+
261
+ if attributes.key?(:'depth')
262
+ self.depth = attributes[:'depth']
263
+ else
264
+ self.depth = 0
265
+ end
266
+ end
267
+
268
+ # Show invalid properties with the reasons. Usually used together with valid?
269
+ # @return Array for valid properties with the reasons
270
+ def list_invalid_properties
271
+ invalid_properties = Array.new
272
+ if !@download_concurrency.nil? && @download_concurrency < 1
273
+ invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
274
+ end
275
+
276
+ if !@total_timeout.nil? && @total_timeout < 0.0
277
+ invalid_properties.push('invalid value for "total_timeout", must be greater than or equal to 0.0.')
278
+ end
279
+
280
+ if !@connect_timeout.nil? && @connect_timeout < 0.0
281
+ invalid_properties.push('invalid value for "connect_timeout", must be greater than or equal to 0.0.')
282
+ end
283
+
284
+ if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
285
+ invalid_properties.push('invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.')
286
+ end
287
+
288
+ if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
289
+ invalid_properties.push('invalid value for "sock_read_timeout", must be greater than or equal to 0.0.')
290
+ end
291
+
292
+ if !@depth.nil? && @depth < 0
293
+ invalid_properties.push('invalid value for "depth", must be greater than or equal to 0.')
294
+ end
295
+
296
+ invalid_properties
297
+ end
298
+
299
+ # Check to see if the all the properties in the model are valid
300
+ # @return true if the model is valid
301
+ def valid?
302
+ return false if !@download_concurrency.nil? && @download_concurrency < 1
303
+ return false if !@total_timeout.nil? && @total_timeout < 0.0
304
+ return false if !@connect_timeout.nil? && @connect_timeout < 0.0
305
+ return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
306
+ return false if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
307
+ return false if !@depth.nil? && @depth < 0
308
+ true
309
+ end
310
+
311
+ # Custom attribute writer method with validation
312
+ # @param [Object] download_concurrency Value to be assigned
313
+ def download_concurrency=(download_concurrency)
314
+ if !download_concurrency.nil? && download_concurrency < 1
315
+ fail ArgumentError, 'invalid value for "download_concurrency", must be greater than or equal to 1.'
316
+ end
317
+
318
+ @download_concurrency = download_concurrency
319
+ end
320
+
321
+ # Custom attribute writer method with validation
322
+ # @param [Object] total_timeout Value to be assigned
323
+ def total_timeout=(total_timeout)
324
+ if !total_timeout.nil? && total_timeout < 0.0
325
+ fail ArgumentError, 'invalid value for "total_timeout", must be greater than or equal to 0.0.'
326
+ end
327
+
328
+ @total_timeout = total_timeout
329
+ end
330
+
331
+ # Custom attribute writer method with validation
332
+ # @param [Object] connect_timeout Value to be assigned
333
+ def connect_timeout=(connect_timeout)
334
+ if !connect_timeout.nil? && connect_timeout < 0.0
335
+ fail ArgumentError, 'invalid value for "connect_timeout", must be greater than or equal to 0.0.'
336
+ end
337
+
338
+ @connect_timeout = connect_timeout
339
+ end
340
+
341
+ # Custom attribute writer method with validation
342
+ # @param [Object] sock_connect_timeout Value to be assigned
343
+ def sock_connect_timeout=(sock_connect_timeout)
344
+ if !sock_connect_timeout.nil? && sock_connect_timeout < 0.0
345
+ fail ArgumentError, 'invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.'
346
+ end
347
+
348
+ @sock_connect_timeout = sock_connect_timeout
349
+ end
350
+
351
+ # Custom attribute writer method with validation
352
+ # @param [Object] sock_read_timeout Value to be assigned
353
+ def sock_read_timeout=(sock_read_timeout)
354
+ if !sock_read_timeout.nil? && sock_read_timeout < 0.0
355
+ fail ArgumentError, 'invalid value for "sock_read_timeout", must be greater than or equal to 0.0.'
356
+ end
357
+
358
+ @sock_read_timeout = sock_read_timeout
359
+ end
360
+
361
+ # Custom attribute writer method with validation
362
+ # @param [Object] depth Value to be assigned
363
+ def depth=(depth)
364
+ if !depth.nil? && depth < 0
365
+ fail ArgumentError, 'invalid value for "depth", must be greater than or equal to 0.'
366
+ end
367
+
368
+ @depth = depth
369
+ end
370
+
371
+ # Checks equality by comparing each attribute.
372
+ # @param [Object] Object to be compared
373
+ def ==(o)
374
+ return true if self.equal?(o)
375
+ self.class == o.class &&
376
+ name == o.name &&
377
+ url == o.url &&
378
+ ca_cert == o.ca_cert &&
379
+ client_cert == o.client_cert &&
380
+ client_key == o.client_key &&
381
+ tls_validation == o.tls_validation &&
382
+ proxy_url == o.proxy_url &&
383
+ proxy_username == o.proxy_username &&
384
+ proxy_password == o.proxy_password &&
385
+ username == o.username &&
386
+ password == o.password &&
387
+ pulp_labels == o.pulp_labels &&
388
+ download_concurrency == o.download_concurrency &&
389
+ max_retries == o.max_retries &&
390
+ policy == o.policy &&
391
+ total_timeout == o.total_timeout &&
392
+ connect_timeout == o.connect_timeout &&
393
+ sock_connect_timeout == o.sock_connect_timeout &&
394
+ sock_read_timeout == o.sock_read_timeout &&
395
+ headers == o.headers &&
396
+ rate_limit == o.rate_limit &&
397
+ depth == o.depth
398
+ end
399
+
400
+ # @see the `==` method
401
+ # @param [Object] Object to be compared
402
+ def eql?(o)
403
+ self == o
404
+ end
405
+
406
+ # Calculates hash code according to all attributes.
407
+ # @return [Integer] Hash code
408
+ def hash
409
+ [name, url, ca_cert, client_cert, client_key, tls_validation, proxy_url, proxy_username, proxy_password, username, password, pulp_labels, download_concurrency, max_retries, policy, total_timeout, connect_timeout, sock_connect_timeout, sock_read_timeout, headers, rate_limit, depth].hash
410
+ end
411
+
412
+ # Builds the object from hash
413
+ # @param [Hash] attributes Model attributes in the form of hash
414
+ # @return [Object] Returns the model itself
415
+ def self.build_from_hash(attributes)
416
+ new.build_from_hash(attributes)
417
+ end
418
+
419
+ # Builds the object from hash
420
+ # @param [Hash] attributes Model attributes in the form of hash
421
+ # @return [Object] Returns the model itself
422
+ def build_from_hash(attributes)
423
+ return nil unless attributes.is_a?(Hash)
424
+ self.class.openapi_types.each_pair do |key, type|
425
+ if type =~ /\AArray<(.*)>/i
426
+ # check to ensure the input is an array given that the attribute
427
+ # is documented as an array but the input is not
428
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
429
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
430
+ end
431
+ elsif !attributes[self.class.attribute_map[key]].nil?
432
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
433
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
434
+ end
435
+
436
+ self
437
+ end
438
+
439
+ # Deserializes the data based on type
440
+ # @param string type Data type
441
+ # @param string value Value to be deserialized
442
+ # @return [Object] Deserialized data
443
+ def _deserialize(type, value)
444
+ case type.to_sym
445
+ when :DateTime
446
+ DateTime.parse(value)
447
+ when :Date
448
+ Date.parse(value)
449
+ when :String
450
+ value.to_s
451
+ when :Integer
452
+ value.to_i
453
+ when :Float
454
+ value.to_f
455
+ when :Boolean
456
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
457
+ true
458
+ else
459
+ false
460
+ end
461
+ when :Object
462
+ # generic object (usually a Hash), return directly
463
+ value
464
+ when /\AArray<(?<inner_type>.+)>\z/
465
+ inner_type = Regexp.last_match[:inner_type]
466
+ value.map { |v| _deserialize(inner_type, v) }
467
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
468
+ k_type = Regexp.last_match[:k_type]
469
+ v_type = Regexp.last_match[:v_type]
470
+ {}.tap do |hash|
471
+ value.each do |k, v|
472
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
473
+ end
474
+ end
475
+ else # model
476
+ PulpOstreeClient.const_get(type).build_from_hash(value)
477
+ end
478
+ end
479
+
480
+ # Returns the string representation of the object
481
+ # @return [String] String presentation of the object
482
+ def to_s
483
+ to_hash.to_s
484
+ end
485
+
486
+ # to_body is an alias to to_hash (backward compatibility)
487
+ # @return [Hash] Returns the object in the form of hash
488
+ def to_body
489
+ to_hash
490
+ end
491
+
492
+ # Returns the object in the form of hash
493
+ # @return [Hash] Returns the object in the form of hash
494
+ def to_hash
495
+ hash = {}
496
+ self.class.attribute_map.each_pair do |attr, param|
497
+ value = self.send(attr)
498
+ if value.nil?
499
+ is_nullable = self.class.openapi_nullable.include?(attr)
500
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
501
+ end
502
+
503
+ hash[param] = _to_hash(value)
504
+ end
505
+ hash
506
+ end
507
+
508
+ # Outputs non-array value in the form of hash
509
+ # For object, use to_hash. Otherwise, just return the value
510
+ # @param [Object] value Any valid value
511
+ # @return [Hash] Returns the value in the form of hash
512
+ def _to_hash(value)
513
+ if value.is_a?(Array)
514
+ value.compact.map { |v| _to_hash(v) }
515
+ elsif value.is_a?(Hash)
516
+ {}.tap do |hash|
517
+ value.each { |k, v| hash[k] = _to_hash(v) }
518
+ end
519
+ elsif value.respond_to? :to_hash
520
+ value.to_hash
521
+ else
522
+ value
523
+ end
524
+ end
525
+ end
526
+ end