pulp_hugging_face_client 0.0.1

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 (126) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +176 -0
  4. data/Rakefile +10 -0
  5. data/docs/AsyncOperationResponse.md +18 -0
  6. data/docs/ContentHuggingFaceApi.md +424 -0
  7. data/docs/ContentSummaryResponse.md +22 -0
  8. data/docs/DistributionsHuggingFaceApi.md +671 -0
  9. data/docs/HuggingFaceHuggingFaceContent.md +36 -0
  10. data/docs/HuggingFaceHuggingFaceContentResponse.md +42 -0
  11. data/docs/HuggingFaceHuggingFaceDistribution.md +32 -0
  12. data/docs/HuggingFaceHuggingFaceDistributionResponse.md +44 -0
  13. data/docs/HuggingFaceHuggingFacePublication.md +20 -0
  14. data/docs/HuggingFaceHuggingFacePublicationResponse.md +28 -0
  15. data/docs/HuggingFaceHuggingFaceRemote.md +62 -0
  16. data/docs/HuggingFaceHuggingFaceRemoteResponse.md +62 -0
  17. data/docs/HuggingFaceHuggingFaceRemoteResponseHiddenFieldsInner.md +20 -0
  18. data/docs/HuggingFaceHuggingFaceRepository.md +26 -0
  19. data/docs/HuggingFaceHuggingFaceRepositoryResponse.md +38 -0
  20. data/docs/PaginatedRepositoryVersionResponseList.md +24 -0
  21. data/docs/PaginatedhuggingFaceHuggingFaceContentResponseList.md +24 -0
  22. data/docs/PaginatedhuggingFaceHuggingFaceDistributionResponseList.md +24 -0
  23. data/docs/PaginatedhuggingFaceHuggingFacePublicationResponseList.md +24 -0
  24. data/docs/PaginatedhuggingFaceHuggingFaceRemoteResponseList.md +24 -0
  25. data/docs/PaginatedhuggingFaceHuggingFaceRepositoryResponseList.md +24 -0
  26. data/docs/PatchedhuggingFaceHuggingFaceDistribution.md +32 -0
  27. data/docs/PatchedhuggingFaceHuggingFaceRemote.md +62 -0
  28. data/docs/PatchedhuggingFaceHuggingFaceRepository.md +26 -0
  29. data/docs/PolicyEnum.md +15 -0
  30. data/docs/PublicationsHuggingFaceApi.md +350 -0
  31. data/docs/RemotesHuggingFaceApi.md +669 -0
  32. data/docs/Repair.md +18 -0
  33. data/docs/RepoTypeEnum.md +15 -0
  34. data/docs/RepositoriesHuggingFaceApi.md +831 -0
  35. data/docs/RepositoriesHuggingFaceVersionsApi.md +359 -0
  36. data/docs/RepositoryAddRemoveContent.md +22 -0
  37. data/docs/RepositorySyncURL.md +20 -0
  38. data/docs/RepositoryVersionResponse.md +32 -0
  39. data/docs/SetLabel.md +20 -0
  40. data/docs/SetLabelResponse.md +20 -0
  41. data/docs/UnsetLabel.md +18 -0
  42. data/docs/UnsetLabelResponse.md +20 -0
  43. data/lib/pulp_hugging_face_client/api/content_hugging_face_api.rb +441 -0
  44. data/lib/pulp_hugging_face_client/api/distributions_hugging_face_api.rb +684 -0
  45. data/lib/pulp_hugging_face_client/api/publications_hugging_face_api.rb +356 -0
  46. data/lib/pulp_hugging_face_client/api/remotes_hugging_face_api.rb +681 -0
  47. data/lib/pulp_hugging_face_client/api/repositories_hugging_face_api.rb +847 -0
  48. data/lib/pulp_hugging_face_client/api/repositories_hugging_face_versions_api.rb +374 -0
  49. data/lib/pulp_hugging_face_client/api_client.rb +438 -0
  50. data/lib/pulp_hugging_face_client/api_error.rb +58 -0
  51. data/lib/pulp_hugging_face_client/configuration.rb +392 -0
  52. data/lib/pulp_hugging_face_client/models/async_operation_response.rb +223 -0
  53. data/lib/pulp_hugging_face_client/models/content_summary_response.rb +260 -0
  54. data/lib/pulp_hugging_face_client/models/hugging_face_hugging_face_content.rb +428 -0
  55. data/lib/pulp_hugging_face_client/models/hugging_face_hugging_face_content_response.rb +385 -0
  56. data/lib/pulp_hugging_face_client/models/hugging_face_hugging_face_distribution.rb +345 -0
  57. data/lib/pulp_hugging_face_client/models/hugging_face_hugging_face_distribution_response.rb +366 -0
  58. data/lib/pulp_hugging_face_client/models/hugging_face_hugging_face_publication.rb +225 -0
  59. data/lib/pulp_hugging_face_client/models/hugging_face_hugging_face_publication_response.rb +264 -0
  60. data/lib/pulp_hugging_face_client/models/hugging_face_hugging_face_remote.rb +745 -0
  61. data/lib/pulp_hugging_face_client/models/hugging_face_hugging_face_remote_response.rb +564 -0
  62. data/lib/pulp_hugging_face_client/models/hugging_face_hugging_face_remote_response_hidden_fields_inner.rb +237 -0
  63. data/lib/pulp_hugging_face_client/models/hugging_face_hugging_face_repository.rb +316 -0
  64. data/lib/pulp_hugging_face_client/models/hugging_face_hugging_face_repository_response.rb +339 -0
  65. data/lib/pulp_hugging_face_client/models/paginated_repository_version_response_list.rb +259 -0
  66. data/lib/pulp_hugging_face_client/models/paginatedhugging_face_hugging_face_content_response_list.rb +259 -0
  67. data/lib/pulp_hugging_face_client/models/paginatedhugging_face_hugging_face_distribution_response_list.rb +259 -0
  68. data/lib/pulp_hugging_face_client/models/paginatedhugging_face_hugging_face_publication_response_list.rb +259 -0
  69. data/lib/pulp_hugging_face_client/models/paginatedhugging_face_hugging_face_remote_response_list.rb +259 -0
  70. data/lib/pulp_hugging_face_client/models/paginatedhugging_face_hugging_face_repository_response_list.rb +259 -0
  71. data/lib/pulp_hugging_face_client/models/patchedhugging_face_hugging_face_distribution.rb +331 -0
  72. data/lib/pulp_hugging_face_client/models/patchedhugging_face_hugging_face_remote.rb +731 -0
  73. data/lib/pulp_hugging_face_client/models/patchedhugging_face_hugging_face_repository.rb +309 -0
  74. data/lib/pulp_hugging_face_client/models/policy_enum.rb +41 -0
  75. data/lib/pulp_hugging_face_client/models/repair.rb +217 -0
  76. data/lib/pulp_hugging_face_client/models/repo_type_enum.rb +41 -0
  77. data/lib/pulp_hugging_face_client/models/repository_add_remove_content.rb +240 -0
  78. data/lib/pulp_hugging_face_client/models/repository_sync_url.rb +228 -0
  79. data/lib/pulp_hugging_face_client/models/repository_version_response.rb +283 -0
  80. data/lib/pulp_hugging_face_client/models/set_label.rb +264 -0
  81. data/lib/pulp_hugging_face_client/models/set_label_response.rb +255 -0
  82. data/lib/pulp_hugging_face_client/models/unset_label.rb +252 -0
  83. data/lib/pulp_hugging_face_client/models/unset_label_response.rb +252 -0
  84. data/lib/pulp_hugging_face_client/version.rb +15 -0
  85. data/lib/pulp_hugging_face_client.rb +77 -0
  86. data/pulp_hugging_face_client.gemspec +41 -0
  87. data/spec/api/content_hugging_face_api_spec.rb +121 -0
  88. data/spec/api/distributions_hugging_face_api_spec.rb +171 -0
  89. data/spec/api/publications_hugging_face_api_spec.rb +109 -0
  90. data/spec/api/remotes_hugging_face_api_spec.rb +170 -0
  91. data/spec/api/repositories_hugging_face_api_spec.rb +202 -0
  92. data/spec/api/repositories_hugging_face_versions_api_spec.rb +112 -0
  93. data/spec/models/async_operation_response_spec.rb +36 -0
  94. data/spec/models/content_summary_response_spec.rb +48 -0
  95. data/spec/models/hugging_face_hugging_face_content_response_spec.rb +108 -0
  96. data/spec/models/hugging_face_hugging_face_content_spec.rb +90 -0
  97. data/spec/models/hugging_face_hugging_face_distribution_response_spec.rb +114 -0
  98. data/spec/models/hugging_face_hugging_face_distribution_spec.rb +78 -0
  99. data/spec/models/hugging_face_hugging_face_publication_response_spec.rb +66 -0
  100. data/spec/models/hugging_face_hugging_face_publication_spec.rb +42 -0
  101. data/spec/models/hugging_face_hugging_face_remote_response_hidden_fields_inner_spec.rb +42 -0
  102. data/spec/models/hugging_face_hugging_face_remote_response_spec.rb +168 -0
  103. data/spec/models/hugging_face_hugging_face_remote_spec.rb +168 -0
  104. data/spec/models/hugging_face_hugging_face_repository_response_spec.rb +96 -0
  105. data/spec/models/hugging_face_hugging_face_repository_spec.rb +60 -0
  106. data/spec/models/paginated_repository_version_response_list_spec.rb +54 -0
  107. data/spec/models/paginatedhugging_face_hugging_face_content_response_list_spec.rb +54 -0
  108. data/spec/models/paginatedhugging_face_hugging_face_distribution_response_list_spec.rb +54 -0
  109. data/spec/models/paginatedhugging_face_hugging_face_publication_response_list_spec.rb +54 -0
  110. data/spec/models/paginatedhugging_face_hugging_face_remote_response_list_spec.rb +54 -0
  111. data/spec/models/paginatedhugging_face_hugging_face_repository_response_list_spec.rb +54 -0
  112. data/spec/models/patchedhugging_face_hugging_face_distribution_spec.rb +78 -0
  113. data/spec/models/patchedhugging_face_hugging_face_remote_spec.rb +168 -0
  114. data/spec/models/patchedhugging_face_hugging_face_repository_spec.rb +60 -0
  115. data/spec/models/policy_enum_spec.rb +30 -0
  116. data/spec/models/repair_spec.rb +36 -0
  117. data/spec/models/repo_type_enum_spec.rb +30 -0
  118. data/spec/models/repository_add_remove_content_spec.rb +48 -0
  119. data/spec/models/repository_sync_url_spec.rb +42 -0
  120. data/spec/models/repository_version_response_spec.rb +78 -0
  121. data/spec/models/set_label_response_spec.rb +42 -0
  122. data/spec/models/set_label_spec.rb +42 -0
  123. data/spec/models/unset_label_response_spec.rb +42 -0
  124. data/spec/models/unset_label_spec.rb +36 -0
  125. data/spec/spec_helper.rb +111 -0
  126. metadata +274 -0
@@ -0,0 +1,564 @@
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
+ Generator version: 7.10.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module PulpHuggingFaceClient
17
+ # A Serializer for HuggingFaceRemote with Hugging Face specific configuration.
18
+ class HuggingFaceHuggingFaceRemoteResponse
19
+ attr_accessor :pulp_href
20
+
21
+ # The Pulp Resource Name (PRN).
22
+ attr_accessor :prn
23
+
24
+ # Timestamp of creation.
25
+ attr_accessor :pulp_created
26
+
27
+ # Timestamp of the most recent update of the remote.
28
+ attr_accessor :pulp_last_updated
29
+
30
+ # A unique name for this remote.
31
+ attr_accessor :name
32
+
33
+ # The URL of an external content source.
34
+ attr_accessor :url
35
+
36
+ # A PEM encoded CA certificate used to validate the server certificate presented by the remote server.
37
+ attr_accessor :ca_cert
38
+
39
+ # A PEM encoded client certificate used for authentication.
40
+ attr_accessor :client_cert
41
+
42
+ # If True, TLS peer validation must be performed.
43
+ attr_accessor :tls_validation
44
+
45
+ # The proxy URL. Format: scheme://host:port
46
+ attr_accessor :proxy_url
47
+
48
+ attr_accessor :pulp_labels
49
+
50
+ # Total number of simultaneous connections. If not set then the default value will be used.
51
+ attr_accessor :download_concurrency
52
+
53
+ # Maximum number of retry attempts after a download failure. If not set then the default value (3) will be used.
54
+ attr_accessor :max_retries
55
+
56
+ # The policy to use when downloading content. The possible values include: 'immediate', 'on_demand', and 'streamed'. 'on_demand' enables pull-through caching. * `immediate` - When syncing, download all metadata and content now. * `on_demand` - When syncing, download metadata, but do not download content now. Instead, download content as clients request it, and save it in Pulp to be served for future client requests. * `streamed` - When syncing, download metadata, but do not download content now. Instead,download content as clients request it, but never save it in Pulp. This causes future requests for that same content to have to be downloaded again.
57
+ attr_accessor :policy
58
+
59
+ # aiohttp.ClientTimeout.total (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
60
+ attr_accessor :total_timeout
61
+
62
+ # aiohttp.ClientTimeout.connect (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
63
+ attr_accessor :connect_timeout
64
+
65
+ # 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.
66
+ attr_accessor :sock_connect_timeout
67
+
68
+ # 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.
69
+ attr_accessor :sock_read_timeout
70
+
71
+ # Headers for aiohttp.Clientsession
72
+ attr_accessor :headers
73
+
74
+ # Limits requests per second for each concurrent downloader
75
+ attr_accessor :rate_limit
76
+
77
+ # List of hidden (write only) fields
78
+ attr_accessor :hidden_fields
79
+
80
+ # Base URL for Hugging Face Hub
81
+ attr_accessor :hf_hub_url
82
+
83
+ # Hugging Face authentication token for private repositories
84
+ attr_accessor :hf_token
85
+
86
+ class EnumAttributeValidator
87
+ attr_reader :datatype
88
+ attr_reader :allowable_values
89
+
90
+ def initialize(datatype, allowable_values)
91
+ @allowable_values = allowable_values.map do |value|
92
+ case datatype.to_s
93
+ when /Integer/i
94
+ value.to_i
95
+ when /Float/i
96
+ value.to_f
97
+ else
98
+ value
99
+ end
100
+ end
101
+ end
102
+
103
+ def valid?(value)
104
+ !value || allowable_values.include?(value)
105
+ end
106
+ end
107
+
108
+ # Attribute mapping from ruby-style variable name to JSON key.
109
+ def self.attribute_map
110
+ {
111
+ :'pulp_href' => :'pulp_href',
112
+ :'prn' => :'prn',
113
+ :'pulp_created' => :'pulp_created',
114
+ :'pulp_last_updated' => :'pulp_last_updated',
115
+ :'name' => :'name',
116
+ :'url' => :'url',
117
+ :'ca_cert' => :'ca_cert',
118
+ :'client_cert' => :'client_cert',
119
+ :'tls_validation' => :'tls_validation',
120
+ :'proxy_url' => :'proxy_url',
121
+ :'pulp_labels' => :'pulp_labels',
122
+ :'download_concurrency' => :'download_concurrency',
123
+ :'max_retries' => :'max_retries',
124
+ :'policy' => :'policy',
125
+ :'total_timeout' => :'total_timeout',
126
+ :'connect_timeout' => :'connect_timeout',
127
+ :'sock_connect_timeout' => :'sock_connect_timeout',
128
+ :'sock_read_timeout' => :'sock_read_timeout',
129
+ :'headers' => :'headers',
130
+ :'rate_limit' => :'rate_limit',
131
+ :'hidden_fields' => :'hidden_fields',
132
+ :'hf_hub_url' => :'hf_hub_url',
133
+ :'hf_token' => :'hf_token'
134
+ }
135
+ end
136
+
137
+ # Returns all the JSON keys this model knows about
138
+ def self.acceptable_attributes
139
+ attribute_map.values
140
+ end
141
+
142
+ # Attribute type mapping.
143
+ def self.openapi_types
144
+ {
145
+ :'pulp_href' => :'String',
146
+ :'prn' => :'String',
147
+ :'pulp_created' => :'Time',
148
+ :'pulp_last_updated' => :'Time',
149
+ :'name' => :'String',
150
+ :'url' => :'String',
151
+ :'ca_cert' => :'String',
152
+ :'client_cert' => :'String',
153
+ :'tls_validation' => :'Boolean',
154
+ :'proxy_url' => :'String',
155
+ :'pulp_labels' => :'Hash<String, String>',
156
+ :'download_concurrency' => :'Integer',
157
+ :'max_retries' => :'Integer',
158
+ :'policy' => :'PolicyEnum',
159
+ :'total_timeout' => :'Float',
160
+ :'connect_timeout' => :'Float',
161
+ :'sock_connect_timeout' => :'Float',
162
+ :'sock_read_timeout' => :'Float',
163
+ :'headers' => :'Array<Object>',
164
+ :'rate_limit' => :'Integer',
165
+ :'hidden_fields' => :'Array<HuggingFaceHuggingFaceRemoteResponseHiddenFieldsInner>',
166
+ :'hf_hub_url' => :'String',
167
+ :'hf_token' => :'String'
168
+ }
169
+ end
170
+
171
+ # List of attributes with nullable: true
172
+ def self.openapi_nullable
173
+ Set.new([
174
+ :'ca_cert',
175
+ :'client_cert',
176
+ :'proxy_url',
177
+ :'download_concurrency',
178
+ :'max_retries',
179
+ :'total_timeout',
180
+ :'connect_timeout',
181
+ :'sock_connect_timeout',
182
+ :'sock_read_timeout',
183
+ :'rate_limit',
184
+ :'hf_token'
185
+ ])
186
+ end
187
+
188
+ # Initializes the object
189
+ # @param [Hash] attributes Model attributes in the form of hash
190
+ def initialize(attributes = {})
191
+ if (!attributes.is_a?(Hash))
192
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpHuggingFaceClient::HuggingFaceHuggingFaceRemoteResponse` initialize method"
193
+ end
194
+
195
+ # check to see if the attribute exists and convert string to symbol for hash key
196
+ attributes = attributes.each_with_object({}) { |(k, v), h|
197
+ if (!self.class.attribute_map.key?(k.to_sym))
198
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpHuggingFaceClient::HuggingFaceHuggingFaceRemoteResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
199
+ end
200
+ h[k.to_sym] = v
201
+ }
202
+
203
+ if attributes.key?(:'pulp_href')
204
+ self.pulp_href = attributes[:'pulp_href']
205
+ end
206
+
207
+ if attributes.key?(:'prn')
208
+ self.prn = attributes[:'prn']
209
+ end
210
+
211
+ if attributes.key?(:'pulp_created')
212
+ self.pulp_created = attributes[:'pulp_created']
213
+ end
214
+
215
+ if attributes.key?(:'pulp_last_updated')
216
+ self.pulp_last_updated = attributes[:'pulp_last_updated']
217
+ end
218
+
219
+ if attributes.key?(:'name')
220
+ self.name = attributes[:'name']
221
+ else
222
+ self.name = nil
223
+ end
224
+
225
+ if attributes.key?(:'url')
226
+ self.url = attributes[:'url']
227
+ else
228
+ self.url = nil
229
+ end
230
+
231
+ if attributes.key?(:'ca_cert')
232
+ self.ca_cert = attributes[:'ca_cert']
233
+ end
234
+
235
+ if attributes.key?(:'client_cert')
236
+ self.client_cert = attributes[:'client_cert']
237
+ end
238
+
239
+ if attributes.key?(:'tls_validation')
240
+ self.tls_validation = attributes[:'tls_validation']
241
+ end
242
+
243
+ if attributes.key?(:'proxy_url')
244
+ self.proxy_url = attributes[:'proxy_url']
245
+ end
246
+
247
+ if attributes.key?(:'pulp_labels')
248
+ if (value = attributes[:'pulp_labels']).is_a?(Hash)
249
+ self.pulp_labels = value
250
+ end
251
+ end
252
+
253
+ if attributes.key?(:'download_concurrency')
254
+ self.download_concurrency = attributes[:'download_concurrency']
255
+ end
256
+
257
+ if attributes.key?(:'max_retries')
258
+ self.max_retries = attributes[:'max_retries']
259
+ end
260
+
261
+ if attributes.key?(:'policy')
262
+ self.policy = attributes[:'policy']
263
+ end
264
+
265
+ if attributes.key?(:'total_timeout')
266
+ self.total_timeout = attributes[:'total_timeout']
267
+ end
268
+
269
+ if attributes.key?(:'connect_timeout')
270
+ self.connect_timeout = attributes[:'connect_timeout']
271
+ end
272
+
273
+ if attributes.key?(:'sock_connect_timeout')
274
+ self.sock_connect_timeout = attributes[:'sock_connect_timeout']
275
+ end
276
+
277
+ if attributes.key?(:'sock_read_timeout')
278
+ self.sock_read_timeout = attributes[:'sock_read_timeout']
279
+ end
280
+
281
+ if attributes.key?(:'headers')
282
+ if (value = attributes[:'headers']).is_a?(Array)
283
+ self.headers = value
284
+ end
285
+ end
286
+
287
+ if attributes.key?(:'rate_limit')
288
+ self.rate_limit = attributes[:'rate_limit']
289
+ end
290
+
291
+ if attributes.key?(:'hidden_fields')
292
+ if (value = attributes[:'hidden_fields']).is_a?(Array)
293
+ self.hidden_fields = value
294
+ end
295
+ end
296
+
297
+ if attributes.key?(:'hf_hub_url')
298
+ self.hf_hub_url = attributes[:'hf_hub_url']
299
+ else
300
+ self.hf_hub_url = 'https://huggingface.co'
301
+ end
302
+
303
+ if attributes.key?(:'hf_token')
304
+ self.hf_token = attributes[:'hf_token']
305
+ end
306
+ end
307
+
308
+ # Show invalid properties with the reasons. Usually used together with valid?
309
+ # @return Array for valid properties with the reasons
310
+ def list_invalid_properties
311
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
312
+ invalid_properties = Array.new
313
+ if @name.nil?
314
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
315
+ end
316
+
317
+ if @url.nil?
318
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
319
+ end
320
+
321
+ if !@download_concurrency.nil? && @download_concurrency < 1
322
+ invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
323
+ end
324
+
325
+ if !@total_timeout.nil? && @total_timeout < 0.0
326
+ invalid_properties.push('invalid value for "total_timeout", must be greater than or equal to 0.0.')
327
+ end
328
+
329
+ if !@connect_timeout.nil? && @connect_timeout < 0.0
330
+ invalid_properties.push('invalid value for "connect_timeout", must be greater than or equal to 0.0.')
331
+ end
332
+
333
+ if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
334
+ invalid_properties.push('invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.')
335
+ end
336
+
337
+ if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
338
+ invalid_properties.push('invalid value for "sock_read_timeout", must be greater than or equal to 0.0.')
339
+ end
340
+
341
+ invalid_properties
342
+ end
343
+
344
+ # Check to see if the all the properties in the model are valid
345
+ # @return true if the model is valid
346
+ def valid?
347
+ warn '[DEPRECATED] the `valid?` method is obsolete'
348
+ return false if @name.nil?
349
+ return false if @url.nil?
350
+ return false if !@download_concurrency.nil? && @download_concurrency < 1
351
+ return false if !@total_timeout.nil? && @total_timeout < 0.0
352
+ return false if !@connect_timeout.nil? && @connect_timeout < 0.0
353
+ return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
354
+ return false if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
355
+ true
356
+ end
357
+
358
+ # Custom attribute writer method with validation
359
+ # @param [Object] download_concurrency Value to be assigned
360
+ def download_concurrency=(download_concurrency)
361
+ if !download_concurrency.nil? && download_concurrency < 1
362
+ fail ArgumentError, 'invalid value for "download_concurrency", must be greater than or equal to 1.'
363
+ end
364
+
365
+ @download_concurrency = download_concurrency
366
+ end
367
+
368
+ # Custom attribute writer method with validation
369
+ # @param [Object] total_timeout Value to be assigned
370
+ def total_timeout=(total_timeout)
371
+ if !total_timeout.nil? && total_timeout < 0.0
372
+ fail ArgumentError, 'invalid value for "total_timeout", must be greater than or equal to 0.0.'
373
+ end
374
+
375
+ @total_timeout = total_timeout
376
+ end
377
+
378
+ # Custom attribute writer method with validation
379
+ # @param [Object] connect_timeout Value to be assigned
380
+ def connect_timeout=(connect_timeout)
381
+ if !connect_timeout.nil? && connect_timeout < 0.0
382
+ fail ArgumentError, 'invalid value for "connect_timeout", must be greater than or equal to 0.0.'
383
+ end
384
+
385
+ @connect_timeout = connect_timeout
386
+ end
387
+
388
+ # Custom attribute writer method with validation
389
+ # @param [Object] sock_connect_timeout Value to be assigned
390
+ def sock_connect_timeout=(sock_connect_timeout)
391
+ if !sock_connect_timeout.nil? && sock_connect_timeout < 0.0
392
+ fail ArgumentError, 'invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.'
393
+ end
394
+
395
+ @sock_connect_timeout = sock_connect_timeout
396
+ end
397
+
398
+ # Custom attribute writer method with validation
399
+ # @param [Object] sock_read_timeout Value to be assigned
400
+ def sock_read_timeout=(sock_read_timeout)
401
+ if !sock_read_timeout.nil? && sock_read_timeout < 0.0
402
+ fail ArgumentError, 'invalid value for "sock_read_timeout", must be greater than or equal to 0.0.'
403
+ end
404
+
405
+ @sock_read_timeout = sock_read_timeout
406
+ end
407
+
408
+ # Checks equality by comparing each attribute.
409
+ # @param [Object] Object to be compared
410
+ def ==(o)
411
+ return true if self.equal?(o)
412
+ self.class == o.class &&
413
+ pulp_href == o.pulp_href &&
414
+ prn == o.prn &&
415
+ pulp_created == o.pulp_created &&
416
+ pulp_last_updated == o.pulp_last_updated &&
417
+ name == o.name &&
418
+ url == o.url &&
419
+ ca_cert == o.ca_cert &&
420
+ client_cert == o.client_cert &&
421
+ tls_validation == o.tls_validation &&
422
+ proxy_url == o.proxy_url &&
423
+ pulp_labels == o.pulp_labels &&
424
+ download_concurrency == o.download_concurrency &&
425
+ max_retries == o.max_retries &&
426
+ policy == o.policy &&
427
+ total_timeout == o.total_timeout &&
428
+ connect_timeout == o.connect_timeout &&
429
+ sock_connect_timeout == o.sock_connect_timeout &&
430
+ sock_read_timeout == o.sock_read_timeout &&
431
+ headers == o.headers &&
432
+ rate_limit == o.rate_limit &&
433
+ hidden_fields == o.hidden_fields &&
434
+ hf_hub_url == o.hf_hub_url &&
435
+ hf_token == o.hf_token
436
+ end
437
+
438
+ # @see the `==` method
439
+ # @param [Object] Object to be compared
440
+ def eql?(o)
441
+ self == o
442
+ end
443
+
444
+ # Calculates hash code according to all attributes.
445
+ # @return [Integer] Hash code
446
+ def hash
447
+ [pulp_href, prn, pulp_created, pulp_last_updated, name, url, ca_cert, client_cert, tls_validation, proxy_url, pulp_labels, download_concurrency, max_retries, policy, total_timeout, connect_timeout, sock_connect_timeout, sock_read_timeout, headers, rate_limit, hidden_fields, hf_hub_url, hf_token].hash
448
+ end
449
+
450
+ # Builds the object from hash
451
+ # @param [Hash] attributes Model attributes in the form of hash
452
+ # @return [Object] Returns the model itself
453
+ def self.build_from_hash(attributes)
454
+ return nil unless attributes.is_a?(Hash)
455
+ attributes = attributes.transform_keys(&:to_sym)
456
+ transformed_hash = {}
457
+ openapi_types.each_pair do |key, type|
458
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
459
+ transformed_hash["#{key}"] = nil
460
+ elsif type =~ /\AArray<(.*)>/i
461
+ # check to ensure the input is an array given that the attribute
462
+ # is documented as an array but the input is not
463
+ if attributes[attribute_map[key]].is_a?(Array)
464
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
465
+ end
466
+ elsif !attributes[attribute_map[key]].nil?
467
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
468
+ end
469
+ end
470
+ new(transformed_hash)
471
+ end
472
+
473
+ # Deserializes the data based on type
474
+ # @param string type Data type
475
+ # @param string value Value to be deserialized
476
+ # @return [Object] Deserialized data
477
+ def self._deserialize(type, value)
478
+ case type.to_sym
479
+ when :Time
480
+ Time.parse(value)
481
+ when :Date
482
+ Date.parse(value)
483
+ when :String
484
+ value.to_s
485
+ when :Integer
486
+ value.to_i
487
+ when :Float
488
+ value.to_f
489
+ when :Boolean
490
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
491
+ true
492
+ else
493
+ false
494
+ end
495
+ when :Object
496
+ # generic object (usually a Hash), return directly
497
+ value
498
+ when /\AArray<(?<inner_type>.+)>\z/
499
+ inner_type = Regexp.last_match[:inner_type]
500
+ value.map { |v| _deserialize(inner_type, v) }
501
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
502
+ k_type = Regexp.last_match[:k_type]
503
+ v_type = Regexp.last_match[:v_type]
504
+ {}.tap do |hash|
505
+ value.each do |k, v|
506
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
507
+ end
508
+ end
509
+ else # model
510
+ # models (e.g. Pet) or oneOf
511
+ klass = PulpHuggingFaceClient.const_get(type)
512
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
513
+ end
514
+ end
515
+
516
+ # Returns the string representation of the object
517
+ # @return [String] String presentation of the object
518
+ def to_s
519
+ to_hash.to_s
520
+ end
521
+
522
+ # to_body is an alias to to_hash (backward compatibility)
523
+ # @return [Hash] Returns the object in the form of hash
524
+ def to_body
525
+ to_hash
526
+ end
527
+
528
+ # Returns the object in the form of hash
529
+ # @return [Hash] Returns the object in the form of hash
530
+ def to_hash
531
+ hash = {}
532
+ self.class.attribute_map.each_pair do |attr, param|
533
+ value = self.send(attr)
534
+ if value.nil?
535
+ is_nullable = self.class.openapi_nullable.include?(attr)
536
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
537
+ end
538
+
539
+ hash[param] = _to_hash(value)
540
+ end
541
+ hash
542
+ end
543
+
544
+ # Outputs non-array value in the form of hash
545
+ # For object, use to_hash. Otherwise, just return the value
546
+ # @param [Object] value Any valid value
547
+ # @return [Hash] Returns the value in the form of hash
548
+ def _to_hash(value)
549
+ if value.is_a?(Array)
550
+ value.compact.map { |v| _to_hash(v) }
551
+ elsif value.is_a?(Hash)
552
+ {}.tap do |hash|
553
+ value.each { |k, v| hash[k] = _to_hash(v) }
554
+ end
555
+ elsif value.respond_to? :to_hash
556
+ value.to_hash
557
+ else
558
+ value
559
+ end
560
+ end
561
+
562
+ end
563
+
564
+ end