abliteration 0.1.6 → 0.1.8

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 (37) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +14 -0
  3. data/docs/DeletionSummary.md +28 -0
  4. data/docs/DeletionSummaryTimelineInner.md +20 -0
  5. data/docs/DeletionSummaryTopByDownloadsInner.md +24 -0
  6. data/docs/GetHistoricalDeletionSummary200Response.md +32 -0
  7. data/docs/GetModelReadmeAt200Response.md +32 -0
  8. data/docs/HistoricalDeletion.md +28 -0
  9. data/docs/ListHistoricalDeletions200Response.md +32 -0
  10. data/docs/ListModelReadmeDrifts200Response.md +32 -0
  11. data/docs/ModelsApi.md +297 -0
  12. data/docs/ReadmeAt.md +22 -0
  13. data/docs/ReadmeDrift.md +26 -0
  14. data/lib/abliteration/api/models_api.rb +302 -0
  15. data/lib/abliteration/models/deletion_summary.rb +202 -0
  16. data/lib/abliteration/models/deletion_summary_timeline_inner.rb +156 -0
  17. data/lib/abliteration/models/deletion_summary_top_by_downloads_inner.rb +174 -0
  18. data/lib/abliteration/models/get_historical_deletion_summary200_response.rb +384 -0
  19. data/lib/abliteration/models/get_model_readme_at200_response.rb +384 -0
  20. data/lib/abliteration/models/historical_deletion.rb +197 -0
  21. data/lib/abliteration/models/list_historical_deletions200_response.rb +386 -0
  22. data/lib/abliteration/models/list_model_readme_drifts200_response.rb +386 -0
  23. data/lib/abliteration/models/readme_at.rb +169 -0
  24. data/lib/abliteration/models/readme_drift.rb +188 -0
  25. data/lib/abliteration/version.rb +1 -1
  26. data/lib/abliteration.rb +10 -0
  27. data/spec/models/deletion_summary_spec.rb +66 -0
  28. data/spec/models/deletion_summary_timeline_inner_spec.rb +42 -0
  29. data/spec/models/deletion_summary_top_by_downloads_inner_spec.rb +54 -0
  30. data/spec/models/get_historical_deletion_summary200_response_spec.rb +82 -0
  31. data/spec/models/get_model_readme_at200_response_spec.rb +82 -0
  32. data/spec/models/historical_deletion_spec.rb +66 -0
  33. data/spec/models/list_historical_deletions200_response_spec.rb +82 -0
  34. data/spec/models/list_model_readme_drifts200_response_spec.rb +82 -0
  35. data/spec/models/readme_at_spec.rb +48 -0
  36. data/spec/models/readme_drift_spec.rb +60 -0
  37. metadata +41 -1
@@ -19,6 +19,63 @@ module Abliteration
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
+ # Historical deletions — aggregate summary
23
+ # Cost: 20 credits, flat. Aggregates from the 24-month HF snapshot analysis: total ever seen, total deleted, deletion rate, average months alive, monthly timeline of losses, top-10 by peak downloads. One call replaces half a dozen separate queries.
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [GetHistoricalDeletionSummary200Response]
26
+ def get_historical_deletion_summary(opts = {})
27
+ data, _status_code, _headers = get_historical_deletion_summary_with_http_info(opts)
28
+ data
29
+ end
30
+
31
+ # Historical deletions — aggregate summary
32
+ # Cost: 20 credits, flat. Aggregates from the 24-month HF snapshot analysis: total ever seen, total deleted, deletion rate, average months alive, monthly timeline of losses, top-10 by peak downloads. One call replaces half a dozen separate queries.
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(GetHistoricalDeletionSummary200Response, Integer, Hash)>] GetHistoricalDeletionSummary200Response data, response status code and response headers
35
+ def get_historical_deletion_summary_with_http_info(opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: ModelsApi.get_historical_deletion_summary ...'
38
+ end
39
+ # resource path
40
+ local_var_path = '/api/v1/models/historical-deletions/summary'
41
+
42
+ # query parameters
43
+ query_params = opts[:query_params] || {}
44
+
45
+ # header parameters
46
+ header_params = opts[:header_params] || {}
47
+ # HTTP header 'Accept' (if needed)
48
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
49
+
50
+ # form parameters
51
+ form_params = opts[:form_params] || {}
52
+
53
+ # http body (model)
54
+ post_body = opts[:debug_body]
55
+
56
+ # return_type
57
+ return_type = opts[:debug_return_type] || 'GetHistoricalDeletionSummary200Response'
58
+
59
+ # auth_names
60
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
61
+
62
+ new_options = opts.merge(
63
+ :operation => :"ModelsApi.get_historical_deletion_summary",
64
+ :header_params => header_params,
65
+ :query_params => query_params,
66
+ :form_params => form_params,
67
+ :body => post_body,
68
+ :auth_names => auth_names,
69
+ :return_type => return_type
70
+ )
71
+
72
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
73
+ if @api_client.config.debugging
74
+ @api_client.config.logger.debug "API called: ModelsApi#get_historical_deletion_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
+ end
76
+ return data, status_code, headers
77
+ end
78
+
22
79
  # Get one model
23
80
  # Cost: 10 credits. Priced above /authors/[id], /methods/[id] and /datasets/[id] because iterating over model ids is functionally a slow dump. The id is author/name and must be percent-encoded. Delisted models are served here even though they are hidden from the default catalog list; the response then carries `is_delisted=1` and `days_since_gone`.
24
81
  # @param id [String]
@@ -82,6 +139,75 @@ module Abliteration
82
139
  return data, status_code, headers
83
140
  end
84
141
 
142
+ # README content at one commit (wayback)
143
+ # Cost: 10 credits, flat. The wayback-machine leg of the change-stream. Returns the exact README content for one model at one commit sha — used after spotting a suspicious drift on GET /api/v1/models/{id}/drifts.
144
+ # @param id [String]
145
+ # @param commit [String] HF commit sha for the README, from /drifts.
146
+ # @param [Hash] opts the optional parameters
147
+ # @return [GetModelReadmeAt200Response]
148
+ def get_model_readme_at(id, commit, opts = {})
149
+ data, _status_code, _headers = get_model_readme_at_with_http_info(id, commit, opts)
150
+ data
151
+ end
152
+
153
+ # README content at one commit (wayback)
154
+ # Cost: 10 credits, flat. The wayback-machine leg of the change-stream. Returns the exact README content for one model at one commit sha — used after spotting a suspicious drift on GET /api/v1/models/{id}/drifts.
155
+ # @param id [String]
156
+ # @param commit [String] HF commit sha for the README, from /drifts.
157
+ # @param [Hash] opts the optional parameters
158
+ # @return [Array<(GetModelReadmeAt200Response, Integer, Hash)>] GetModelReadmeAt200Response data, response status code and response headers
159
+ def get_model_readme_at_with_http_info(id, commit, opts = {})
160
+ if @api_client.config.debugging
161
+ @api_client.config.logger.debug 'Calling API: ModelsApi.get_model_readme_at ...'
162
+ end
163
+ # verify the required parameter 'id' is set
164
+ if @api_client.config.client_side_validation && id.nil?
165
+ fail ArgumentError, "Missing the required parameter 'id' when calling ModelsApi.get_model_readme_at"
166
+ end
167
+ # verify the required parameter 'commit' is set
168
+ if @api_client.config.client_side_validation && commit.nil?
169
+ fail ArgumentError, "Missing the required parameter 'commit' when calling ModelsApi.get_model_readme_at"
170
+ end
171
+ # resource path
172
+ local_var_path = '/api/v1/models/{id}/readme-at/{commit}'.sub('{id}', CGI.escape(id.to_s)).sub('{commit}', CGI.escape(commit.to_s))
173
+
174
+ # query parameters
175
+ query_params = opts[:query_params] || {}
176
+
177
+ # header parameters
178
+ header_params = opts[:header_params] || {}
179
+ # HTTP header 'Accept' (if needed)
180
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
181
+
182
+ # form parameters
183
+ form_params = opts[:form_params] || {}
184
+
185
+ # http body (model)
186
+ post_body = opts[:debug_body]
187
+
188
+ # return_type
189
+ return_type = opts[:debug_return_type] || 'GetModelReadmeAt200Response'
190
+
191
+ # auth_names
192
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
193
+
194
+ new_options = opts.merge(
195
+ :operation => :"ModelsApi.get_model_readme_at",
196
+ :header_params => header_params,
197
+ :query_params => query_params,
198
+ :form_params => form_params,
199
+ :body => post_body,
200
+ :auth_names => auth_names,
201
+ :return_type => return_type
202
+ )
203
+
204
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
205
+ if @api_client.config.debugging
206
+ @api_client.config.logger.debug "API called: ModelsApi#get_model_readme_at\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
207
+ end
208
+ return data, status_code, headers
209
+ end
210
+
85
211
  # List delisted models (change stream)
86
212
  # Cost: 5 credits, flat. Change-stream companion to /models: every row is a tombstone — a model that HF no longer serves, preserved here at its final state. Poll with `since=<last_seen_at of your previous run>` to fetch only new casualties; callers building compliance dashboards, safety-research corpora, or \"wayback\" tools live on this endpoint. See /api#change-stream.
87
213
  # @param [Hash] opts the optional parameters
@@ -167,6 +293,182 @@ module Abliteration
167
293
  return data, status_code, headers
168
294
  end
169
295
 
296
+ # Historical deletions — paged list
297
+ # Cost: 5 credits, flat. Paged/filterable window on the 24-month deletion backlog. Rows are frozen at the moment the model was last seen on the Hub — peak_downloads and total_months_alive never change after death. Sort by size (`downloads`, default), recency (`recent`, newest deaths first) or lifespan (`lifespan`, longest-lived first — surprising deaths).
298
+ # @param [Hash] opts the optional parameters
299
+ # @option opts [String] :since_month ISO YYYY-MM. Rows with last_seen_month &gt;&#x3D; it only.
300
+ # @option opts [Integer] :min_peak_downloads Only rows whose peak downloads &gt;&#x3D; this. &#x60;casualties over N&#x60; queries.
301
+ # @option opts [String] :sort &#x60;downloads&#x60; (default, biggest first), &#x60;recent&#x60; (newest last_seen_month first), &#x60;lifespan&#x60; (longest-lived first). (default to 'downloads')
302
+ # @option opts [Integer] :limit Rows to return, 1 to 1000. Values outside the range are clamped, not rejected. (default to 50)
303
+ # @option opts [Integer] :offset Rows to skip. Negative and non-numeric values are treated as 0. (default to 0)
304
+ # @return [ListHistoricalDeletions200Response]
305
+ def list_historical_deletions(opts = {})
306
+ data, _status_code, _headers = list_historical_deletions_with_http_info(opts)
307
+ data
308
+ end
309
+
310
+ # Historical deletions — paged list
311
+ # Cost: 5 credits, flat. Paged/filterable window on the 24-month deletion backlog. Rows are frozen at the moment the model was last seen on the Hub — peak_downloads and total_months_alive never change after death. Sort by size (&#x60;downloads&#x60;, default), recency (&#x60;recent&#x60;, newest deaths first) or lifespan (&#x60;lifespan&#x60;, longest-lived first — surprising deaths).
312
+ # @param [Hash] opts the optional parameters
313
+ # @option opts [String] :since_month ISO YYYY-MM. Rows with last_seen_month &gt;&#x3D; it only.
314
+ # @option opts [Integer] :min_peak_downloads Only rows whose peak downloads &gt;&#x3D; this. &#x60;casualties over N&#x60; queries.
315
+ # @option opts [String] :sort &#x60;downloads&#x60; (default, biggest first), &#x60;recent&#x60; (newest last_seen_month first), &#x60;lifespan&#x60; (longest-lived first). (default to 'downloads')
316
+ # @option opts [Integer] :limit Rows to return, 1 to 1000. Values outside the range are clamped, not rejected. (default to 50)
317
+ # @option opts [Integer] :offset Rows to skip. Negative and non-numeric values are treated as 0. (default to 0)
318
+ # @return [Array<(ListHistoricalDeletions200Response, Integer, Hash)>] ListHistoricalDeletions200Response data, response status code and response headers
319
+ def list_historical_deletions_with_http_info(opts = {})
320
+ if @api_client.config.debugging
321
+ @api_client.config.logger.debug 'Calling API: ModelsApi.list_historical_deletions ...'
322
+ end
323
+ if @api_client.config.client_side_validation && !opts[:'min_peak_downloads'].nil? && opts[:'min_peak_downloads'] < 0
324
+ fail ArgumentError, 'invalid value for "opts[:"min_peak_downloads"]" when calling ModelsApi.list_historical_deletions, must be greater than or equal to 0.'
325
+ end
326
+
327
+ allowable_values = ["downloads", "recent", "lifespan"]
328
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
329
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
330
+ end
331
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
332
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ModelsApi.list_historical_deletions, must be smaller than or equal to 1000.'
333
+ end
334
+
335
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
336
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ModelsApi.list_historical_deletions, must be greater than or equal to 1.'
337
+ end
338
+
339
+ if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
340
+ fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling ModelsApi.list_historical_deletions, must be greater than or equal to 0.'
341
+ end
342
+
343
+ # resource path
344
+ local_var_path = '/api/v1/models/historical-deletions/list'
345
+
346
+ # query parameters
347
+ query_params = opts[:query_params] || {}
348
+ query_params[:'since_month'] = opts[:'since_month'] if !opts[:'since_month'].nil?
349
+ query_params[:'min_peak_downloads'] = opts[:'min_peak_downloads'] if !opts[:'min_peak_downloads'].nil?
350
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
351
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
352
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
353
+
354
+ # header parameters
355
+ header_params = opts[:header_params] || {}
356
+ # HTTP header 'Accept' (if needed)
357
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
358
+
359
+ # form parameters
360
+ form_params = opts[:form_params] || {}
361
+
362
+ # http body (model)
363
+ post_body = opts[:debug_body]
364
+
365
+ # return_type
366
+ return_type = opts[:debug_return_type] || 'ListHistoricalDeletions200Response'
367
+
368
+ # auth_names
369
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
370
+
371
+ new_options = opts.merge(
372
+ :operation => :"ModelsApi.list_historical_deletions",
373
+ :header_params => header_params,
374
+ :query_params => query_params,
375
+ :form_params => form_params,
376
+ :body => post_body,
377
+ :auth_names => auth_names,
378
+ :return_type => return_type
379
+ )
380
+
381
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
382
+ if @api_client.config.debugging
383
+ @api_client.config.logger.debug "API called: ModelsApi#list_historical_deletions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
384
+ end
385
+ return data, status_code, headers
386
+ end
387
+
388
+ # README drift stream for one model
389
+ # Cost: 5 credits, flat. Every commit that changed the model's README on HF, with `size_delta` between commits so a consumer spots growth spurts and hard prunes without fetching each version. Poll with `since_ts=<max commit_ts of your previous run>` for an incremental drift feed.
390
+ # @param id [String]
391
+ # @param [Hash] opts the optional parameters
392
+ # @option opts [Integer] :since_ts Unix epoch seconds. Rows with commit_ts &gt;&#x3D; it only.
393
+ # @option opts [Integer] :limit Rows to return, 1 to 1000. Values outside the range are clamped, not rejected. (default to 50)
394
+ # @option opts [Integer] :offset Rows to skip. Negative and non-numeric values are treated as 0. (default to 0)
395
+ # @return [ListModelReadmeDrifts200Response]
396
+ def list_model_readme_drifts(id, opts = {})
397
+ data, _status_code, _headers = list_model_readme_drifts_with_http_info(id, opts)
398
+ data
399
+ end
400
+
401
+ # README drift stream for one model
402
+ # Cost: 5 credits, flat. Every commit that changed the model&#39;s README on HF, with &#x60;size_delta&#x60; between commits so a consumer spots growth spurts and hard prunes without fetching each version. Poll with &#x60;since_ts&#x3D;&lt;max commit_ts of your previous run&gt;&#x60; for an incremental drift feed.
403
+ # @param id [String]
404
+ # @param [Hash] opts the optional parameters
405
+ # @option opts [Integer] :since_ts Unix epoch seconds. Rows with commit_ts &gt;&#x3D; it only.
406
+ # @option opts [Integer] :limit Rows to return, 1 to 1000. Values outside the range are clamped, not rejected. (default to 50)
407
+ # @option opts [Integer] :offset Rows to skip. Negative and non-numeric values are treated as 0. (default to 0)
408
+ # @return [Array<(ListModelReadmeDrifts200Response, Integer, Hash)>] ListModelReadmeDrifts200Response data, response status code and response headers
409
+ def list_model_readme_drifts_with_http_info(id, opts = {})
410
+ if @api_client.config.debugging
411
+ @api_client.config.logger.debug 'Calling API: ModelsApi.list_model_readme_drifts ...'
412
+ end
413
+ # verify the required parameter 'id' is set
414
+ if @api_client.config.client_side_validation && id.nil?
415
+ fail ArgumentError, "Missing the required parameter 'id' when calling ModelsApi.list_model_readme_drifts"
416
+ end
417
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
418
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ModelsApi.list_model_readme_drifts, must be smaller than or equal to 1000.'
419
+ end
420
+
421
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
422
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ModelsApi.list_model_readme_drifts, must be greater than or equal to 1.'
423
+ end
424
+
425
+ if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
426
+ fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling ModelsApi.list_model_readme_drifts, must be greater than or equal to 0.'
427
+ end
428
+
429
+ # resource path
430
+ local_var_path = '/api/v1/models/{id}/drifts'.sub('{id}', CGI.escape(id.to_s))
431
+
432
+ # query parameters
433
+ query_params = opts[:query_params] || {}
434
+ query_params[:'since_ts'] = opts[:'since_ts'] if !opts[:'since_ts'].nil?
435
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
436
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
437
+
438
+ # header parameters
439
+ header_params = opts[:header_params] || {}
440
+ # HTTP header 'Accept' (if needed)
441
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
442
+
443
+ # form parameters
444
+ form_params = opts[:form_params] || {}
445
+
446
+ # http body (model)
447
+ post_body = opts[:debug_body]
448
+
449
+ # return_type
450
+ return_type = opts[:debug_return_type] || 'ListModelReadmeDrifts200Response'
451
+
452
+ # auth_names
453
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
454
+
455
+ new_options = opts.merge(
456
+ :operation => :"ModelsApi.list_model_readme_drifts",
457
+ :header_params => header_params,
458
+ :query_params => query_params,
459
+ :form_params => form_params,
460
+ :body => post_body,
461
+ :auth_names => auth_names,
462
+ :return_type => return_type
463
+ )
464
+
465
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
466
+ if @api_client.config.debugging
467
+ @api_client.config.logger.debug "API called: ModelsApi#list_model_readme_drifts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
468
+ end
469
+ return data, status_code, headers
470
+ end
471
+
170
472
  # List models
171
473
  # Cost: 5-300+ credits, stepped by returned rows and multiplied by `1 + (offset/2500)²`. A filtered lookup up to 200 rows costs 5; a 1000-row page on the first page costs 300; on offset=10000, 5100. Filter cheap, dump expensive. See /api#pricing. Delisted models are excluded by default (`delisted=live`); pass `delisted=dead|all` to include tombstoned records. A dedicated change-stream endpoint is at GET /api/v1/models/delisted.
172
474
  # @param [Hash] opts the optional parameters
@@ -0,0 +1,202 @@
1
+ =begin
2
+ #abliteration.org Public API
3
+
4
+ #Read access to the abliteration.org catalog: models and their method classification, alignment datasets and their passports, the M-code taxonomy, the four flagship indices and the curated field timeline. Every call is authenticated with a bearer key and metered in credits against the same wallet the Research Agent spends from. There is no free tier for machine traffic and no separate billing. Responses report `cost` and `credits_remaining` on every success. While `metering` reads `preview`, the cost shown is what the call will bill once metering is enabled and nothing is actually deducted; when it reads `billed`, it was.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Abliteration
17
+ # Aggregate rollup of the 24-month HF deletion analysis.
18
+ class DeletionSummary < ApiModelBase
19
+ # Live catalog size plus historical deletions.
20
+ attr_accessor :total_ever_seen
21
+
22
+ attr_accessor :total_deleted
23
+
24
+ # Percentage of ever-seen models that are now gone.
25
+ attr_accessor :deletion_rate_pct
26
+
27
+ # Average lifespan of deleted models, in months.
28
+ attr_accessor :avg_months_alive
29
+
30
+ # Deletions grouped by last_seen_month, ascending.
31
+ attr_accessor :timeline
32
+
33
+ # Top-10 biggest casualties by peak downloads.
34
+ attr_accessor :top_by_downloads
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'total_ever_seen' => :'total_ever_seen',
40
+ :'total_deleted' => :'total_deleted',
41
+ :'deletion_rate_pct' => :'deletion_rate_pct',
42
+ :'avg_months_alive' => :'avg_months_alive',
43
+ :'timeline' => :'timeline',
44
+ :'top_by_downloads' => :'top_by_downloads'
45
+ }
46
+ end
47
+
48
+ # Returns attribute mapping this model knows about
49
+ def self.acceptable_attribute_map
50
+ attribute_map
51
+ end
52
+
53
+ # Returns all the JSON keys this model knows about
54
+ def self.acceptable_attributes
55
+ acceptable_attribute_map.values
56
+ end
57
+
58
+ # Attribute type mapping.
59
+ def self.openapi_types
60
+ {
61
+ :'total_ever_seen' => :'Integer',
62
+ :'total_deleted' => :'Integer',
63
+ :'deletion_rate_pct' => :'Float',
64
+ :'avg_months_alive' => :'Float',
65
+ :'timeline' => :'Array<DeletionSummaryTimelineInner>',
66
+ :'top_by_downloads' => :'Array<DeletionSummaryTopByDownloadsInner>'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Abliteration::DeletionSummary` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ acceptable_attribute_map = self.class.acceptable_attribute_map
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!acceptable_attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Abliteration::DeletionSummary`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
91
+
92
+ if attributes.key?(:'total_ever_seen')
93
+ self.total_ever_seen = attributes[:'total_ever_seen']
94
+ end
95
+
96
+ if attributes.key?(:'total_deleted')
97
+ self.total_deleted = attributes[:'total_deleted']
98
+ end
99
+
100
+ if attributes.key?(:'deletion_rate_pct')
101
+ self.deletion_rate_pct = attributes[:'deletion_rate_pct']
102
+ end
103
+
104
+ if attributes.key?(:'avg_months_alive')
105
+ self.avg_months_alive = attributes[:'avg_months_alive']
106
+ end
107
+
108
+ if attributes.key?(:'timeline')
109
+ if (value = attributes[:'timeline']).is_a?(Array)
110
+ self.timeline = value
111
+ end
112
+ end
113
+
114
+ if attributes.key?(:'top_by_downloads')
115
+ if (value = attributes[:'top_by_downloads']).is_a?(Array)
116
+ self.top_by_downloads = value
117
+ end
118
+ end
119
+ end
120
+
121
+ # Show invalid properties with the reasons. Usually used together with valid?
122
+ # @return Array for valid properties with the reasons
123
+ def list_invalid_properties
124
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
125
+ invalid_properties = Array.new
126
+ invalid_properties
127
+ end
128
+
129
+ # Check to see if the all the properties in the model are valid
130
+ # @return true if the model is valid
131
+ def valid?
132
+ warn '[DEPRECATED] the `valid?` method is obsolete'
133
+ true
134
+ end
135
+
136
+ # Checks equality by comparing each attribute.
137
+ # @param [Object] Object to be compared
138
+ def ==(o)
139
+ return true if self.equal?(o)
140
+ self.class == o.class &&
141
+ total_ever_seen == o.total_ever_seen &&
142
+ total_deleted == o.total_deleted &&
143
+ deletion_rate_pct == o.deletion_rate_pct &&
144
+ avg_months_alive == o.avg_months_alive &&
145
+ timeline == o.timeline &&
146
+ top_by_downloads == o.top_by_downloads
147
+ end
148
+
149
+ # @see the `==` method
150
+ # @param [Object] Object to be compared
151
+ def eql?(o)
152
+ self == o
153
+ end
154
+
155
+ # Calculates hash code according to all attributes.
156
+ # @return [Integer] Hash code
157
+ def hash
158
+ [total_ever_seen, total_deleted, deletion_rate_pct, avg_months_alive, timeline, top_by_downloads].hash
159
+ end
160
+
161
+ # Builds the object from hash
162
+ # @param [Hash] attributes Model attributes in the form of hash
163
+ # @return [Object] Returns the model itself
164
+ def self.build_from_hash(attributes)
165
+ return nil unless attributes.is_a?(Hash)
166
+ attributes = attributes.transform_keys(&:to_sym)
167
+ transformed_hash = {}
168
+ openapi_types.each_pair do |key, type|
169
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
170
+ transformed_hash["#{key}"] = nil
171
+ elsif type =~ /\AArray<(.*)>/i
172
+ # check to ensure the input is an array given that the attribute
173
+ # is documented as an array but the input is not
174
+ if attributes[attribute_map[key]].is_a?(Array)
175
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
176
+ end
177
+ elsif !attributes[attribute_map[key]].nil?
178
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
179
+ end
180
+ end
181
+ new(transformed_hash)
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ if value.nil?
191
+ is_nullable = self.class.openapi_nullable.include?(attr)
192
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
+ end
194
+
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ end
201
+
202
+ end
@@ -0,0 +1,156 @@
1
+ =begin
2
+ #abliteration.org Public API
3
+
4
+ #Read access to the abliteration.org catalog: models and their method classification, alignment datasets and their passports, the M-code taxonomy, the four flagship indices and the curated field timeline. Every call is authenticated with a bearer key and metered in credits against the same wallet the Research Agent spends from. There is no free tier for machine traffic and no separate billing. Responses report `cost` and `credits_remaining` on every success. While `metering` reads `preview`, the cost shown is what the call will bill once metering is enabled and nothing is actually deducted; when it reads `billed`, it was.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Abliteration
17
+ class DeletionSummaryTimelineInner < ApiModelBase
18
+ attr_accessor :month
19
+
20
+ attr_accessor :count
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'month' => :'month',
26
+ :'count' => :'count'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'month' => :'String',
44
+ :'count' => :'Integer'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Abliteration::DeletionSummaryTimelineInner` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Abliteration::DeletionSummaryTimelineInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'month')
71
+ self.month = attributes[:'month']
72
+ end
73
+
74
+ if attributes.key?(:'count')
75
+ self.count = attributes[:'count']
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
83
+ invalid_properties = Array.new
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ warn '[DEPRECATED] the `valid?` method is obsolete'
91
+ true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ month == o.month &&
100
+ count == o.count
101
+ end
102
+
103
+ # @see the `==` method
104
+ # @param [Object] Object to be compared
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Integer] Hash code
111
+ def hash
112
+ [month, count].hash
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def self.build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ attributes = attributes.transform_keys(&:to_sym)
121
+ transformed_hash = {}
122
+ openapi_types.each_pair do |key, type|
123
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
124
+ transformed_hash["#{key}"] = nil
125
+ elsif type =~ /\AArray<(.*)>/i
126
+ # check to ensure the input is an array given that the attribute
127
+ # is documented as an array but the input is not
128
+ if attributes[attribute_map[key]].is_a?(Array)
129
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
130
+ end
131
+ elsif !attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
133
+ end
134
+ end
135
+ new(transformed_hash)
136
+ end
137
+
138
+ # Returns the object in the form of hash
139
+ # @return [Hash] Returns the object in the form of hash
140
+ def to_hash
141
+ hash = {}
142
+ self.class.attribute_map.each_pair do |attr, param|
143
+ value = self.send(attr)
144
+ if value.nil?
145
+ is_nullable = self.class.openapi_nullable.include?(attr)
146
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
147
+ end
148
+
149
+ hash[param] = _to_hash(value)
150
+ end
151
+ hash
152
+ end
153
+
154
+ end
155
+
156
+ end