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,731 @@
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 PatchedhuggingFaceHuggingFaceRemote
19
+ # A unique name for this remote.
20
+ attr_accessor :name
21
+
22
+ # The URL of an external content source.
23
+ attr_accessor :url
24
+
25
+ # A PEM encoded CA certificate used to validate the server certificate presented by the remote server.
26
+ attr_accessor :ca_cert
27
+
28
+ # A PEM encoded client certificate used for authentication.
29
+ attr_accessor :client_cert
30
+
31
+ # A PEM encoded private key used for authentication.
32
+ attr_accessor :client_key
33
+
34
+ # If True, TLS peer validation must be performed.
35
+ attr_accessor :tls_validation
36
+
37
+ # The proxy URL. Format: scheme://host:port
38
+ attr_accessor :proxy_url
39
+
40
+ # The username to authenticte to the proxy.
41
+ attr_accessor :proxy_username
42
+
43
+ # The password to authenticate to the proxy. Extra leading and trailing whitespace characters are not trimmed.
44
+ attr_accessor :proxy_password
45
+
46
+ # The username to be used for authentication when syncing.
47
+ attr_accessor :username
48
+
49
+ # The password to be used for authentication when syncing. Extra leading and trailing whitespace characters are not trimmed.
50
+ attr_accessor :password
51
+
52
+ attr_accessor :pulp_labels
53
+
54
+ # Total number of simultaneous connections. If not set then the default value will be used.
55
+ attr_accessor :download_concurrency
56
+
57
+ # Maximum number of retry attempts after a download failure. If not set then the default value (3) will be used.
58
+ attr_accessor :max_retries
59
+
60
+ # 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.
61
+ attr_accessor :policy
62
+
63
+ # aiohttp.ClientTimeout.total (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
64
+ attr_accessor :total_timeout
65
+
66
+ # aiohttp.ClientTimeout.connect (q.v.) for download-connections. The default is null, which will cause the default from the aiohttp library to be used.
67
+ attr_accessor :connect_timeout
68
+
69
+ # 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.
70
+ attr_accessor :sock_connect_timeout
71
+
72
+ # 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.
73
+ attr_accessor :sock_read_timeout
74
+
75
+ # Headers for aiohttp.Clientsession
76
+ attr_accessor :headers
77
+
78
+ # Limits requests per second for each concurrent downloader
79
+ attr_accessor :rate_limit
80
+
81
+ # Base URL for Hugging Face Hub
82
+ attr_accessor :hf_hub_url
83
+
84
+ # Hugging Face authentication token for private repositories
85
+ attr_accessor :hf_token
86
+
87
+ class EnumAttributeValidator
88
+ attr_reader :datatype
89
+ attr_reader :allowable_values
90
+
91
+ def initialize(datatype, allowable_values)
92
+ @allowable_values = allowable_values.map do |value|
93
+ case datatype.to_s
94
+ when /Integer/i
95
+ value.to_i
96
+ when /Float/i
97
+ value.to_f
98
+ else
99
+ value
100
+ end
101
+ end
102
+ end
103
+
104
+ def valid?(value)
105
+ !value || allowable_values.include?(value)
106
+ end
107
+ end
108
+
109
+ # Attribute mapping from ruby-style variable name to JSON key.
110
+ def self.attribute_map
111
+ {
112
+ :'name' => :'name',
113
+ :'url' => :'url',
114
+ :'ca_cert' => :'ca_cert',
115
+ :'client_cert' => :'client_cert',
116
+ :'client_key' => :'client_key',
117
+ :'tls_validation' => :'tls_validation',
118
+ :'proxy_url' => :'proxy_url',
119
+ :'proxy_username' => :'proxy_username',
120
+ :'proxy_password' => :'proxy_password',
121
+ :'username' => :'username',
122
+ :'password' => :'password',
123
+ :'pulp_labels' => :'pulp_labels',
124
+ :'download_concurrency' => :'download_concurrency',
125
+ :'max_retries' => :'max_retries',
126
+ :'policy' => :'policy',
127
+ :'total_timeout' => :'total_timeout',
128
+ :'connect_timeout' => :'connect_timeout',
129
+ :'sock_connect_timeout' => :'sock_connect_timeout',
130
+ :'sock_read_timeout' => :'sock_read_timeout',
131
+ :'headers' => :'headers',
132
+ :'rate_limit' => :'rate_limit',
133
+ :'hf_hub_url' => :'hf_hub_url',
134
+ :'hf_token' => :'hf_token'
135
+ }
136
+ end
137
+
138
+ # Returns all the JSON keys this model knows about
139
+ def self.acceptable_attributes
140
+ attribute_map.values
141
+ end
142
+
143
+ # Attribute type mapping.
144
+ def self.openapi_types
145
+ {
146
+ :'name' => :'String',
147
+ :'url' => :'String',
148
+ :'ca_cert' => :'String',
149
+ :'client_cert' => :'String',
150
+ :'client_key' => :'String',
151
+ :'tls_validation' => :'Boolean',
152
+ :'proxy_url' => :'String',
153
+ :'proxy_username' => :'String',
154
+ :'proxy_password' => :'String',
155
+ :'username' => :'String',
156
+ :'password' => :'String',
157
+ :'pulp_labels' => :'Hash<String, String>',
158
+ :'download_concurrency' => :'Integer',
159
+ :'max_retries' => :'Integer',
160
+ :'policy' => :'PolicyEnum',
161
+ :'total_timeout' => :'Float',
162
+ :'connect_timeout' => :'Float',
163
+ :'sock_connect_timeout' => :'Float',
164
+ :'sock_read_timeout' => :'Float',
165
+ :'headers' => :'Array<Object>',
166
+ :'rate_limit' => :'Integer',
167
+ :'hf_hub_url' => :'String',
168
+ :'hf_token' => :'String'
169
+ }
170
+ end
171
+
172
+ # List of attributes with nullable: true
173
+ def self.openapi_nullable
174
+ Set.new([
175
+ :'ca_cert',
176
+ :'client_cert',
177
+ :'client_key',
178
+ :'proxy_url',
179
+ :'proxy_username',
180
+ :'proxy_password',
181
+ :'username',
182
+ :'password',
183
+ :'download_concurrency',
184
+ :'max_retries',
185
+ :'total_timeout',
186
+ :'connect_timeout',
187
+ :'sock_connect_timeout',
188
+ :'sock_read_timeout',
189
+ :'rate_limit',
190
+ :'hf_token'
191
+ ])
192
+ end
193
+
194
+ # Initializes the object
195
+ # @param [Hash] attributes Model attributes in the form of hash
196
+ def initialize(attributes = {})
197
+ if (!attributes.is_a?(Hash))
198
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpHuggingFaceClient::PatchedhuggingFaceHuggingFaceRemote` initialize method"
199
+ end
200
+
201
+ # check to see if the attribute exists and convert string to symbol for hash key
202
+ attributes = attributes.each_with_object({}) { |(k, v), h|
203
+ if (!self.class.attribute_map.key?(k.to_sym))
204
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpHuggingFaceClient::PatchedhuggingFaceHuggingFaceRemote`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
205
+ end
206
+ h[k.to_sym] = v
207
+ }
208
+
209
+ if attributes.key?(:'name')
210
+ self.name = attributes[:'name']
211
+ end
212
+
213
+ if attributes.key?(:'url')
214
+ self.url = attributes[:'url']
215
+ end
216
+
217
+ if attributes.key?(:'ca_cert')
218
+ self.ca_cert = attributes[:'ca_cert']
219
+ end
220
+
221
+ if attributes.key?(:'client_cert')
222
+ self.client_cert = attributes[:'client_cert']
223
+ end
224
+
225
+ if attributes.key?(:'client_key')
226
+ self.client_key = attributes[:'client_key']
227
+ end
228
+
229
+ if attributes.key?(:'tls_validation')
230
+ self.tls_validation = attributes[:'tls_validation']
231
+ end
232
+
233
+ if attributes.key?(:'proxy_url')
234
+ self.proxy_url = attributes[:'proxy_url']
235
+ end
236
+
237
+ if attributes.key?(:'proxy_username')
238
+ self.proxy_username = attributes[:'proxy_username']
239
+ end
240
+
241
+ if attributes.key?(:'proxy_password')
242
+ self.proxy_password = attributes[:'proxy_password']
243
+ end
244
+
245
+ if attributes.key?(:'username')
246
+ self.username = attributes[:'username']
247
+ end
248
+
249
+ if attributes.key?(:'password')
250
+ self.password = attributes[:'password']
251
+ end
252
+
253
+ if attributes.key?(:'pulp_labels')
254
+ if (value = attributes[:'pulp_labels']).is_a?(Hash)
255
+ self.pulp_labels = value
256
+ end
257
+ end
258
+
259
+ if attributes.key?(:'download_concurrency')
260
+ self.download_concurrency = attributes[:'download_concurrency']
261
+ end
262
+
263
+ if attributes.key?(:'max_retries')
264
+ self.max_retries = attributes[:'max_retries']
265
+ end
266
+
267
+ if attributes.key?(:'policy')
268
+ self.policy = attributes[:'policy']
269
+ end
270
+
271
+ if attributes.key?(:'total_timeout')
272
+ self.total_timeout = attributes[:'total_timeout']
273
+ end
274
+
275
+ if attributes.key?(:'connect_timeout')
276
+ self.connect_timeout = attributes[:'connect_timeout']
277
+ end
278
+
279
+ if attributes.key?(:'sock_connect_timeout')
280
+ self.sock_connect_timeout = attributes[:'sock_connect_timeout']
281
+ end
282
+
283
+ if attributes.key?(:'sock_read_timeout')
284
+ self.sock_read_timeout = attributes[:'sock_read_timeout']
285
+ end
286
+
287
+ if attributes.key?(:'headers')
288
+ if (value = attributes[:'headers']).is_a?(Array)
289
+ self.headers = value
290
+ end
291
+ end
292
+
293
+ if attributes.key?(:'rate_limit')
294
+ self.rate_limit = attributes[:'rate_limit']
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? && @name.to_s.length < 1
314
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
315
+ end
316
+
317
+ if !@url.nil? && @url.to_s.length < 1
318
+ invalid_properties.push('invalid value for "url", the character length must be great than or equal to 1.')
319
+ end
320
+
321
+ if !@ca_cert.nil? && @ca_cert.to_s.length < 1
322
+ invalid_properties.push('invalid value for "ca_cert", the character length must be great than or equal to 1.')
323
+ end
324
+
325
+ if !@client_cert.nil? && @client_cert.to_s.length < 1
326
+ invalid_properties.push('invalid value for "client_cert", the character length must be great than or equal to 1.')
327
+ end
328
+
329
+ if !@client_key.nil? && @client_key.to_s.length < 1
330
+ invalid_properties.push('invalid value for "client_key", the character length must be great than or equal to 1.')
331
+ end
332
+
333
+ if !@proxy_url.nil? && @proxy_url.to_s.length < 1
334
+ invalid_properties.push('invalid value for "proxy_url", the character length must be great than or equal to 1.')
335
+ end
336
+
337
+ if !@proxy_username.nil? && @proxy_username.to_s.length < 1
338
+ invalid_properties.push('invalid value for "proxy_username", the character length must be great than or equal to 1.')
339
+ end
340
+
341
+ if !@proxy_password.nil? && @proxy_password.to_s.length < 1
342
+ invalid_properties.push('invalid value for "proxy_password", the character length must be great than or equal to 1.')
343
+ end
344
+
345
+ if !@username.nil? && @username.to_s.length < 1
346
+ invalid_properties.push('invalid value for "username", the character length must be great than or equal to 1.')
347
+ end
348
+
349
+ if !@password.nil? && @password.to_s.length < 1
350
+ invalid_properties.push('invalid value for "password", the character length must be great than or equal to 1.')
351
+ end
352
+
353
+ if !@download_concurrency.nil? && @download_concurrency < 1
354
+ invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
355
+ end
356
+
357
+ if !@total_timeout.nil? && @total_timeout < 0.0
358
+ invalid_properties.push('invalid value for "total_timeout", must be greater than or equal to 0.0.')
359
+ end
360
+
361
+ if !@connect_timeout.nil? && @connect_timeout < 0.0
362
+ invalid_properties.push('invalid value for "connect_timeout", must be greater than or equal to 0.0.')
363
+ end
364
+
365
+ if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
366
+ invalid_properties.push('invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.')
367
+ end
368
+
369
+ if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
370
+ invalid_properties.push('invalid value for "sock_read_timeout", must be greater than or equal to 0.0.')
371
+ end
372
+
373
+ if !@hf_hub_url.nil? && @hf_hub_url.to_s.length < 1
374
+ invalid_properties.push('invalid value for "hf_hub_url", the character length must be great than or equal to 1.')
375
+ end
376
+
377
+ invalid_properties
378
+ end
379
+
380
+ # Check to see if the all the properties in the model are valid
381
+ # @return true if the model is valid
382
+ def valid?
383
+ warn '[DEPRECATED] the `valid?` method is obsolete'
384
+ return false if !@name.nil? && @name.to_s.length < 1
385
+ return false if !@url.nil? && @url.to_s.length < 1
386
+ return false if !@ca_cert.nil? && @ca_cert.to_s.length < 1
387
+ return false if !@client_cert.nil? && @client_cert.to_s.length < 1
388
+ return false if !@client_key.nil? && @client_key.to_s.length < 1
389
+ return false if !@proxy_url.nil? && @proxy_url.to_s.length < 1
390
+ return false if !@proxy_username.nil? && @proxy_username.to_s.length < 1
391
+ return false if !@proxy_password.nil? && @proxy_password.to_s.length < 1
392
+ return false if !@username.nil? && @username.to_s.length < 1
393
+ return false if !@password.nil? && @password.to_s.length < 1
394
+ return false if !@download_concurrency.nil? && @download_concurrency < 1
395
+ return false if !@total_timeout.nil? && @total_timeout < 0.0
396
+ return false if !@connect_timeout.nil? && @connect_timeout < 0.0
397
+ return false if !@sock_connect_timeout.nil? && @sock_connect_timeout < 0.0
398
+ return false if !@sock_read_timeout.nil? && @sock_read_timeout < 0.0
399
+ return false if !@hf_hub_url.nil? && @hf_hub_url.to_s.length < 1
400
+ true
401
+ end
402
+
403
+ # Custom attribute writer method with validation
404
+ # @param [Object] name Value to be assigned
405
+ def name=(name)
406
+ if name.nil?
407
+ fail ArgumentError, 'name cannot be nil'
408
+ end
409
+
410
+ if name.to_s.length < 1
411
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
412
+ end
413
+
414
+ @name = name
415
+ end
416
+
417
+ # Custom attribute writer method with validation
418
+ # @param [Object] url Value to be assigned
419
+ def url=(url)
420
+ if url.nil?
421
+ fail ArgumentError, 'url cannot be nil'
422
+ end
423
+
424
+ if url.to_s.length < 1
425
+ fail ArgumentError, 'invalid value for "url", the character length must be great than or equal to 1.'
426
+ end
427
+
428
+ @url = url
429
+ end
430
+
431
+ # Custom attribute writer method with validation
432
+ # @param [Object] ca_cert Value to be assigned
433
+ def ca_cert=(ca_cert)
434
+ if !ca_cert.nil? && ca_cert.to_s.length < 1
435
+ fail ArgumentError, 'invalid value for "ca_cert", the character length must be great than or equal to 1.'
436
+ end
437
+
438
+ @ca_cert = ca_cert
439
+ end
440
+
441
+ # Custom attribute writer method with validation
442
+ # @param [Object] client_cert Value to be assigned
443
+ def client_cert=(client_cert)
444
+ if !client_cert.nil? && client_cert.to_s.length < 1
445
+ fail ArgumentError, 'invalid value for "client_cert", the character length must be great than or equal to 1.'
446
+ end
447
+
448
+ @client_cert = client_cert
449
+ end
450
+
451
+ # Custom attribute writer method with validation
452
+ # @param [Object] client_key Value to be assigned
453
+ def client_key=(client_key)
454
+ if !client_key.nil? && client_key.to_s.length < 1
455
+ fail ArgumentError, 'invalid value for "client_key", the character length must be great than or equal to 1.'
456
+ end
457
+
458
+ @client_key = client_key
459
+ end
460
+
461
+ # Custom attribute writer method with validation
462
+ # @param [Object] proxy_url Value to be assigned
463
+ def proxy_url=(proxy_url)
464
+ if !proxy_url.nil? && proxy_url.to_s.length < 1
465
+ fail ArgumentError, 'invalid value for "proxy_url", the character length must be great than or equal to 1.'
466
+ end
467
+
468
+ @proxy_url = proxy_url
469
+ end
470
+
471
+ # Custom attribute writer method with validation
472
+ # @param [Object] proxy_username Value to be assigned
473
+ def proxy_username=(proxy_username)
474
+ if !proxy_username.nil? && proxy_username.to_s.length < 1
475
+ fail ArgumentError, 'invalid value for "proxy_username", the character length must be great than or equal to 1.'
476
+ end
477
+
478
+ @proxy_username = proxy_username
479
+ end
480
+
481
+ # Custom attribute writer method with validation
482
+ # @param [Object] proxy_password Value to be assigned
483
+ def proxy_password=(proxy_password)
484
+ if !proxy_password.nil? && proxy_password.to_s.length < 1
485
+ fail ArgumentError, 'invalid value for "proxy_password", the character length must be great than or equal to 1.'
486
+ end
487
+
488
+ @proxy_password = proxy_password
489
+ end
490
+
491
+ # Custom attribute writer method with validation
492
+ # @param [Object] username Value to be assigned
493
+ def username=(username)
494
+ if !username.nil? && username.to_s.length < 1
495
+ fail ArgumentError, 'invalid value for "username", the character length must be great than or equal to 1.'
496
+ end
497
+
498
+ @username = username
499
+ end
500
+
501
+ # Custom attribute writer method with validation
502
+ # @param [Object] password Value to be assigned
503
+ def password=(password)
504
+ if !password.nil? && password.to_s.length < 1
505
+ fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 1.'
506
+ end
507
+
508
+ @password = password
509
+ end
510
+
511
+ # Custom attribute writer method with validation
512
+ # @param [Object] download_concurrency Value to be assigned
513
+ def download_concurrency=(download_concurrency)
514
+ if !download_concurrency.nil? && download_concurrency < 1
515
+ fail ArgumentError, 'invalid value for "download_concurrency", must be greater than or equal to 1.'
516
+ end
517
+
518
+ @download_concurrency = download_concurrency
519
+ end
520
+
521
+ # Custom attribute writer method with validation
522
+ # @param [Object] total_timeout Value to be assigned
523
+ def total_timeout=(total_timeout)
524
+ if !total_timeout.nil? && total_timeout < 0.0
525
+ fail ArgumentError, 'invalid value for "total_timeout", must be greater than or equal to 0.0.'
526
+ end
527
+
528
+ @total_timeout = total_timeout
529
+ end
530
+
531
+ # Custom attribute writer method with validation
532
+ # @param [Object] connect_timeout Value to be assigned
533
+ def connect_timeout=(connect_timeout)
534
+ if !connect_timeout.nil? && connect_timeout < 0.0
535
+ fail ArgumentError, 'invalid value for "connect_timeout", must be greater than or equal to 0.0.'
536
+ end
537
+
538
+ @connect_timeout = connect_timeout
539
+ end
540
+
541
+ # Custom attribute writer method with validation
542
+ # @param [Object] sock_connect_timeout Value to be assigned
543
+ def sock_connect_timeout=(sock_connect_timeout)
544
+ if !sock_connect_timeout.nil? && sock_connect_timeout < 0.0
545
+ fail ArgumentError, 'invalid value for "sock_connect_timeout", must be greater than or equal to 0.0.'
546
+ end
547
+
548
+ @sock_connect_timeout = sock_connect_timeout
549
+ end
550
+
551
+ # Custom attribute writer method with validation
552
+ # @param [Object] sock_read_timeout Value to be assigned
553
+ def sock_read_timeout=(sock_read_timeout)
554
+ if !sock_read_timeout.nil? && sock_read_timeout < 0.0
555
+ fail ArgumentError, 'invalid value for "sock_read_timeout", must be greater than or equal to 0.0.'
556
+ end
557
+
558
+ @sock_read_timeout = sock_read_timeout
559
+ end
560
+
561
+ # Custom attribute writer method with validation
562
+ # @param [Object] hf_hub_url Value to be assigned
563
+ def hf_hub_url=(hf_hub_url)
564
+ if hf_hub_url.nil?
565
+ fail ArgumentError, 'hf_hub_url cannot be nil'
566
+ end
567
+
568
+ if hf_hub_url.to_s.length < 1
569
+ fail ArgumentError, 'invalid value for "hf_hub_url", the character length must be great than or equal to 1.'
570
+ end
571
+
572
+ @hf_hub_url = hf_hub_url
573
+ end
574
+
575
+ # Checks equality by comparing each attribute.
576
+ # @param [Object] Object to be compared
577
+ def ==(o)
578
+ return true if self.equal?(o)
579
+ self.class == o.class &&
580
+ name == o.name &&
581
+ url == o.url &&
582
+ ca_cert == o.ca_cert &&
583
+ client_cert == o.client_cert &&
584
+ client_key == o.client_key &&
585
+ tls_validation == o.tls_validation &&
586
+ proxy_url == o.proxy_url &&
587
+ proxy_username == o.proxy_username &&
588
+ proxy_password == o.proxy_password &&
589
+ username == o.username &&
590
+ password == o.password &&
591
+ pulp_labels == o.pulp_labels &&
592
+ download_concurrency == o.download_concurrency &&
593
+ max_retries == o.max_retries &&
594
+ policy == o.policy &&
595
+ total_timeout == o.total_timeout &&
596
+ connect_timeout == o.connect_timeout &&
597
+ sock_connect_timeout == o.sock_connect_timeout &&
598
+ sock_read_timeout == o.sock_read_timeout &&
599
+ headers == o.headers &&
600
+ rate_limit == o.rate_limit &&
601
+ hf_hub_url == o.hf_hub_url &&
602
+ hf_token == o.hf_token
603
+ end
604
+
605
+ # @see the `==` method
606
+ # @param [Object] Object to be compared
607
+ def eql?(o)
608
+ self == o
609
+ end
610
+
611
+ # Calculates hash code according to all attributes.
612
+ # @return [Integer] Hash code
613
+ def hash
614
+ [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, hf_hub_url, hf_token].hash
615
+ end
616
+
617
+ # Builds the object from hash
618
+ # @param [Hash] attributes Model attributes in the form of hash
619
+ # @return [Object] Returns the model itself
620
+ def self.build_from_hash(attributes)
621
+ return nil unless attributes.is_a?(Hash)
622
+ attributes = attributes.transform_keys(&:to_sym)
623
+ transformed_hash = {}
624
+ openapi_types.each_pair do |key, type|
625
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
626
+ transformed_hash["#{key}"] = nil
627
+ elsif type =~ /\AArray<(.*)>/i
628
+ # check to ensure the input is an array given that the attribute
629
+ # is documented as an array but the input is not
630
+ if attributes[attribute_map[key]].is_a?(Array)
631
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
632
+ end
633
+ elsif !attributes[attribute_map[key]].nil?
634
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
635
+ end
636
+ end
637
+ new(transformed_hash)
638
+ end
639
+
640
+ # Deserializes the data based on type
641
+ # @param string type Data type
642
+ # @param string value Value to be deserialized
643
+ # @return [Object] Deserialized data
644
+ def self._deserialize(type, value)
645
+ case type.to_sym
646
+ when :Time
647
+ Time.parse(value)
648
+ when :Date
649
+ Date.parse(value)
650
+ when :String
651
+ value.to_s
652
+ when :Integer
653
+ value.to_i
654
+ when :Float
655
+ value.to_f
656
+ when :Boolean
657
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
658
+ true
659
+ else
660
+ false
661
+ end
662
+ when :Object
663
+ # generic object (usually a Hash), return directly
664
+ value
665
+ when /\AArray<(?<inner_type>.+)>\z/
666
+ inner_type = Regexp.last_match[:inner_type]
667
+ value.map { |v| _deserialize(inner_type, v) }
668
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
669
+ k_type = Regexp.last_match[:k_type]
670
+ v_type = Regexp.last_match[:v_type]
671
+ {}.tap do |hash|
672
+ value.each do |k, v|
673
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
674
+ end
675
+ end
676
+ else # model
677
+ # models (e.g. Pet) or oneOf
678
+ klass = PulpHuggingFaceClient.const_get(type)
679
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
680
+ end
681
+ end
682
+
683
+ # Returns the string representation of the object
684
+ # @return [String] String presentation of the object
685
+ def to_s
686
+ to_hash.to_s
687
+ end
688
+
689
+ # to_body is an alias to to_hash (backward compatibility)
690
+ # @return [Hash] Returns the object in the form of hash
691
+ def to_body
692
+ to_hash
693
+ end
694
+
695
+ # Returns the object in the form of hash
696
+ # @return [Hash] Returns the object in the form of hash
697
+ def to_hash
698
+ hash = {}
699
+ self.class.attribute_map.each_pair do |attr, param|
700
+ value = self.send(attr)
701
+ if value.nil?
702
+ is_nullable = self.class.openapi_nullable.include?(attr)
703
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
704
+ end
705
+
706
+ hash[param] = _to_hash(value)
707
+ end
708
+ hash
709
+ end
710
+
711
+ # Outputs non-array value in the form of hash
712
+ # For object, use to_hash. Otherwise, just return the value
713
+ # @param [Object] value Any valid value
714
+ # @return [Hash] Returns the value in the form of hash
715
+ def _to_hash(value)
716
+ if value.is_a?(Array)
717
+ value.compact.map { |v| _to_hash(v) }
718
+ elsif value.is_a?(Hash)
719
+ {}.tap do |hash|
720
+ value.each { |k, v| hash[k] = _to_hash(v) }
721
+ end
722
+ elsif value.respond_to? :to_hash
723
+ value.to_hash
724
+ else
725
+ value
726
+ end
727
+ end
728
+
729
+ end
730
+
731
+ end