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