pulp_ostree_client 2.0.0a1

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.
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,536 @@
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 OstreeOstreeRemote
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::OstreeOstreeRemote` 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::OstreeOstreeRemote`. 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 @name.nil?
273
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
274
+ end
275
+
276
+ if @url.nil?
277
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
278
+ end
279
+
280
+ if !@download_concurrency.nil? && @download_concurrency < 1
281
+ invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
282
+ end
283
+
284
+ if !@total_timeout.nil? && @total_timeout < 0.0
285
+ invalid_properties.push('invalid value for "total_timeout", must be greater than or equal to 0.0.')
286
+ end
287
+
288
+ if !@connect_timeout.nil? && @connect_timeout < 0.0
289
+ invalid_properties.push('invalid value for "connect_timeout", must be greater than or equal to 0.0.')
290
+ end
291
+
292
+ if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
293
+ invalid_properties.push('invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.')
294
+ end
295
+
296
+ if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
297
+ invalid_properties.push('invalid value for "sock_read_timeout", must be greater than or equal to 0.0.')
298
+ end
299
+
300
+ if !@depth.nil? && @depth < 0
301
+ invalid_properties.push('invalid value for "depth", must be greater than or equal to 0.')
302
+ end
303
+
304
+ invalid_properties
305
+ end
306
+
307
+ # Check to see if the all the properties in the model are valid
308
+ # @return true if the model is valid
309
+ def valid?
310
+ return false if @name.nil?
311
+ return false if @url.nil?
312
+ return false if !@download_concurrency.nil? && @download_concurrency < 1
313
+ return false if !@total_timeout.nil? && @total_timeout < 0.0
314
+ return false if !@connect_timeout.nil? && @connect_timeout < 0.0
315
+ return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
316
+ return false if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
317
+ return false if !@depth.nil? && @depth < 0
318
+ true
319
+ end
320
+
321
+ # Custom attribute writer method with validation
322
+ # @param [Object] download_concurrency Value to be assigned
323
+ def download_concurrency=(download_concurrency)
324
+ if !download_concurrency.nil? && download_concurrency < 1
325
+ fail ArgumentError, 'invalid value for "download_concurrency", must be greater than or equal to 1.'
326
+ end
327
+
328
+ @download_concurrency = download_concurrency
329
+ end
330
+
331
+ # Custom attribute writer method with validation
332
+ # @param [Object] total_timeout Value to be assigned
333
+ def total_timeout=(total_timeout)
334
+ if !total_timeout.nil? && total_timeout < 0.0
335
+ fail ArgumentError, 'invalid value for "total_timeout", must be greater than or equal to 0.0.'
336
+ end
337
+
338
+ @total_timeout = total_timeout
339
+ end
340
+
341
+ # Custom attribute writer method with validation
342
+ # @param [Object] connect_timeout Value to be assigned
343
+ def connect_timeout=(connect_timeout)
344
+ if !connect_timeout.nil? && connect_timeout < 0.0
345
+ fail ArgumentError, 'invalid value for "connect_timeout", must be greater than or equal to 0.0.'
346
+ end
347
+
348
+ @connect_timeout = connect_timeout
349
+ end
350
+
351
+ # Custom attribute writer method with validation
352
+ # @param [Object] sock_connect_timeout Value to be assigned
353
+ def sock_connect_timeout=(sock_connect_timeout)
354
+ if !sock_connect_timeout.nil? && sock_connect_timeout < 0.0
355
+ fail ArgumentError, 'invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.'
356
+ end
357
+
358
+ @sock_connect_timeout = sock_connect_timeout
359
+ end
360
+
361
+ # Custom attribute writer method with validation
362
+ # @param [Object] sock_read_timeout Value to be assigned
363
+ def sock_read_timeout=(sock_read_timeout)
364
+ if !sock_read_timeout.nil? && sock_read_timeout < 0.0
365
+ fail ArgumentError, 'invalid value for "sock_read_timeout", must be greater than or equal to 0.0.'
366
+ end
367
+
368
+ @sock_read_timeout = sock_read_timeout
369
+ end
370
+
371
+ # Custom attribute writer method with validation
372
+ # @param [Object] depth Value to be assigned
373
+ def depth=(depth)
374
+ if !depth.nil? && depth < 0
375
+ fail ArgumentError, 'invalid value for "depth", must be greater than or equal to 0.'
376
+ end
377
+
378
+ @depth = depth
379
+ end
380
+
381
+ # Checks equality by comparing each attribute.
382
+ # @param [Object] Object to be compared
383
+ def ==(o)
384
+ return true if self.equal?(o)
385
+ self.class == o.class &&
386
+ name == o.name &&
387
+ url == o.url &&
388
+ ca_cert == o.ca_cert &&
389
+ client_cert == o.client_cert &&
390
+ client_key == o.client_key &&
391
+ tls_validation == o.tls_validation &&
392
+ proxy_url == o.proxy_url &&
393
+ proxy_username == o.proxy_username &&
394
+ proxy_password == o.proxy_password &&
395
+ username == o.username &&
396
+ password == o.password &&
397
+ pulp_labels == o.pulp_labels &&
398
+ download_concurrency == o.download_concurrency &&
399
+ max_retries == o.max_retries &&
400
+ policy == o.policy &&
401
+ total_timeout == o.total_timeout &&
402
+ connect_timeout == o.connect_timeout &&
403
+ sock_connect_timeout == o.sock_connect_timeout &&
404
+ sock_read_timeout == o.sock_read_timeout &&
405
+ headers == o.headers &&
406
+ rate_limit == o.rate_limit &&
407
+ depth == o.depth
408
+ end
409
+
410
+ # @see the `==` method
411
+ # @param [Object] Object to be compared
412
+ def eql?(o)
413
+ self == o
414
+ end
415
+
416
+ # Calculates hash code according to all attributes.
417
+ # @return [Integer] Hash code
418
+ def hash
419
+ [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
420
+ end
421
+
422
+ # Builds the object from hash
423
+ # @param [Hash] attributes Model attributes in the form of hash
424
+ # @return [Object] Returns the model itself
425
+ def self.build_from_hash(attributes)
426
+ new.build_from_hash(attributes)
427
+ end
428
+
429
+ # Builds the object from hash
430
+ # @param [Hash] attributes Model attributes in the form of hash
431
+ # @return [Object] Returns the model itself
432
+ def build_from_hash(attributes)
433
+ return nil unless attributes.is_a?(Hash)
434
+ self.class.openapi_types.each_pair do |key, type|
435
+ if type =~ /\AArray<(.*)>/i
436
+ # check to ensure the input is an array given that the attribute
437
+ # is documented as an array but the input is not
438
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
439
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
440
+ end
441
+ elsif !attributes[self.class.attribute_map[key]].nil?
442
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
443
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
444
+ end
445
+
446
+ self
447
+ end
448
+
449
+ # Deserializes the data based on type
450
+ # @param string type Data type
451
+ # @param string value Value to be deserialized
452
+ # @return [Object] Deserialized data
453
+ def _deserialize(type, value)
454
+ case type.to_sym
455
+ when :DateTime
456
+ DateTime.parse(value)
457
+ when :Date
458
+ Date.parse(value)
459
+ when :String
460
+ value.to_s
461
+ when :Integer
462
+ value.to_i
463
+ when :Float
464
+ value.to_f
465
+ when :Boolean
466
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
467
+ true
468
+ else
469
+ false
470
+ end
471
+ when :Object
472
+ # generic object (usually a Hash), return directly
473
+ value
474
+ when /\AArray<(?<inner_type>.+)>\z/
475
+ inner_type = Regexp.last_match[:inner_type]
476
+ value.map { |v| _deserialize(inner_type, v) }
477
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
478
+ k_type = Regexp.last_match[:k_type]
479
+ v_type = Regexp.last_match[:v_type]
480
+ {}.tap do |hash|
481
+ value.each do |k, v|
482
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
483
+ end
484
+ end
485
+ else # model
486
+ PulpOstreeClient.const_get(type).build_from_hash(value)
487
+ end
488
+ end
489
+
490
+ # Returns the string representation of the object
491
+ # @return [String] String presentation of the object
492
+ def to_s
493
+ to_hash.to_s
494
+ end
495
+
496
+ # to_body is an alias to to_hash (backward compatibility)
497
+ # @return [Hash] Returns the object in the form of hash
498
+ def to_body
499
+ to_hash
500
+ end
501
+
502
+ # Returns the object in the form of hash
503
+ # @return [Hash] Returns the object in the form of hash
504
+ def to_hash
505
+ hash = {}
506
+ self.class.attribute_map.each_pair do |attr, param|
507
+ value = self.send(attr)
508
+ if value.nil?
509
+ is_nullable = self.class.openapi_nullable.include?(attr)
510
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
511
+ end
512
+
513
+ hash[param] = _to_hash(value)
514
+ end
515
+ hash
516
+ end
517
+
518
+ # Outputs non-array value in the form of hash
519
+ # For object, use to_hash. Otherwise, just return the value
520
+ # @param [Object] value Any valid value
521
+ # @return [Hash] Returns the value in the form of hash
522
+ def _to_hash(value)
523
+ if value.is_a?(Array)
524
+ value.compact.map { |v| _to_hash(v) }
525
+ elsif value.is_a?(Hash)
526
+ {}.tap do |hash|
527
+ value.each { |k, v| hash[k] = _to_hash(v) }
528
+ end
529
+ elsif value.respond_to? :to_hash
530
+ value.to_hash
531
+ else
532
+ value
533
+ end
534
+ end
535
+ end
536
+ end