abliteration 0.1.6 → 0.1.7

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f4954feb3c086bc804c783fa545d66687cdde13f05e7601c6006d905bee95a71
4
- data.tar.gz: e3f746c6712d3b344e621ed8ec1793cec6a59d2ad52a751f7d048dbda3a42680
3
+ metadata.gz: 22dcd3b342509cdc83410548a8f7d6aa975cd5ff6ea8dd7752cdff63a57c15ae
4
+ data.tar.gz: '083faff3655e6a1721c87f23c92a80f28b3c4565c33f06ba1313af85417345ca'
5
5
  SHA512:
6
- metadata.gz: 450a0f75eb10f2ee3386305af5eec41eebae627c4c04b9e2ba4fc0f93c8bbd8e343f936cdd9645435664bc8b9a9f98d685b9b3456cd1d135de0dd6ca8611b105
7
- data.tar.gz: da5db6f4dd8925c982278808e5c7d803a63fb510802bea3abbd0a8c9fe2bf0b142a5f67b667c4333434a96873d9102cdfe676da5689fb101ec211229799d3e27
6
+ metadata.gz: 67056fce0457a1e0dc6b5ad116b24a9c222622646a205926308af85342d5f5faa15514fd6e66100914add28fc414996a343139e0ad19c50afe8182420a8f7ba1
7
+ data.tar.gz: 5c1b5586a094f530eaaac3ba39a8af5a5fb156d53871b4a87ca6f1830d23731454775029d6208107bf731cbc5b9ca8591838d422b124ff4c2a93eb4da0b19d67
data/README.md CHANGED
@@ -97,8 +97,10 @@ Class | Method | HTTP request | Description
97
97
  *Abliteration::IndicesApi* | [**list_indices**](docs/IndicesApi.md#list_indices) | **GET** /api/v1/indices | All four indices
98
98
  *Abliteration::MethodsApi* | [**get_method**](docs/MethodsApi.md#get_method) | **GET** /api/v1/methods/{id} | Get one method
99
99
  *Abliteration::MethodsApi* | [**list_methods**](docs/MethodsApi.md#list_methods) | **GET** /api/v1/methods | List the method taxonomy
100
+ *Abliteration::ModelsApi* | [**get_historical_deletion_summary**](docs/ModelsApi.md#get_historical_deletion_summary) | **GET** /api/v1/models/historical-deletions/summary | Historical deletions — aggregate summary
100
101
  *Abliteration::ModelsApi* | [**get_model**](docs/ModelsApi.md#get_model) | **GET** /api/v1/models/{id} | Get one model
101
102
  *Abliteration::ModelsApi* | [**list_delisted_models**](docs/ModelsApi.md#list_delisted_models) | **GET** /api/v1/models/delisted | List delisted models (change stream)
103
+ *Abliteration::ModelsApi* | [**list_historical_deletions**](docs/ModelsApi.md#list_historical_deletions) | **GET** /api/v1/models/historical-deletions/list | Historical deletions — paged list
102
104
  *Abliteration::ModelsApi* | [**list_models**](docs/ModelsApi.md#list_models) | **GET** /api/v1/models | List models
103
105
  *Abliteration::TimelineApi* | [**list_timeline**](docs/TimelineApi.md#list_timeline) | **GET** /api/v1/timeline | Curated field events
104
106
 
@@ -110,20 +112,26 @@ Class | Method | HTTP request | Description
110
112
  - [Abliteration::DaiPoint](docs/DaiPoint.md)
111
113
  - [Abliteration::Dataset](docs/Dataset.md)
112
114
  - [Abliteration::DatasetDetail](docs/DatasetDetail.md)
115
+ - [Abliteration::DeletionSummary](docs/DeletionSummary.md)
116
+ - [Abliteration::DeletionSummaryTimelineInner](docs/DeletionSummaryTimelineInner.md)
117
+ - [Abliteration::DeletionSummaryTopByDownloadsInner](docs/DeletionSummaryTopByDownloadsInner.md)
113
118
  - [Abliteration::DelistedModel](docs/DelistedModel.md)
114
119
  - [Abliteration::Envelope](docs/Envelope.md)
115
120
  - [Abliteration::Error](docs/Error.md)
116
121
  - [Abliteration::Event](docs/Event.md)
117
122
  - [Abliteration::GetAuthor200Response](docs/GetAuthor200Response.md)
118
123
  - [Abliteration::GetDataset200Response](docs/GetDataset200Response.md)
124
+ - [Abliteration::GetHistoricalDeletionSummary200Response](docs/GetHistoricalDeletionSummary200Response.md)
119
125
  - [Abliteration::GetIndex200Response](docs/GetIndex200Response.md)
120
126
  - [Abliteration::GetMethod200Response](docs/GetMethod200Response.md)
121
127
  - [Abliteration::GetModel200Response](docs/GetModel200Response.md)
128
+ - [Abliteration::HistoricalDeletion](docs/HistoricalDeletion.md)
122
129
  - [Abliteration::Index](docs/Index.md)
123
130
  - [Abliteration::IndexDetail](docs/IndexDetail.md)
124
131
  - [Abliteration::ListAuthors200Response](docs/ListAuthors200Response.md)
125
132
  - [Abliteration::ListDatasets200Response](docs/ListDatasets200Response.md)
126
133
  - [Abliteration::ListDelistedModels200Response](docs/ListDelistedModels200Response.md)
134
+ - [Abliteration::ListHistoricalDeletions200Response](docs/ListHistoricalDeletions200Response.md)
127
135
  - [Abliteration::ListIndices200Response](docs/ListIndices200Response.md)
128
136
  - [Abliteration::ListMethods200Response](docs/ListMethods200Response.md)
129
137
  - [Abliteration::ListModels200Response](docs/ListModels200Response.md)
@@ -0,0 +1,28 @@
1
+ # Abliteration::DeletionSummary
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **total_ever_seen** | **Integer** | Live catalog size plus historical deletions. | [optional] |
8
+ | **total_deleted** | **Integer** | | [optional] |
9
+ | **deletion_rate_pct** | **Float** | Percentage of ever-seen models that are now gone. | [optional] |
10
+ | **avg_months_alive** | **Float** | Average lifespan of deleted models, in months. | [optional] |
11
+ | **timeline** | [**Array<DeletionSummaryTimelineInner>**](DeletionSummaryTimelineInner.md) | Deletions grouped by last_seen_month, ascending. | [optional] |
12
+ | **top_by_downloads** | [**Array<DeletionSummaryTopByDownloadsInner>**](DeletionSummaryTopByDownloadsInner.md) | Top-10 biggest casualties by peak downloads. | [optional] |
13
+
14
+ ## Example
15
+
16
+ ```ruby
17
+ require 'abliteration'
18
+
19
+ instance = Abliteration::DeletionSummary.new(
20
+ total_ever_seen: null,
21
+ total_deleted: null,
22
+ deletion_rate_pct: null,
23
+ avg_months_alive: null,
24
+ timeline: null,
25
+ top_by_downloads: null
26
+ )
27
+ ```
28
+
@@ -0,0 +1,20 @@
1
+ # Abliteration::DeletionSummaryTimelineInner
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **month** | **String** | | [optional] |
8
+ | **count** | **Integer** | | [optional] |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'abliteration'
14
+
15
+ instance = Abliteration::DeletionSummaryTimelineInner.new(
16
+ month: null,
17
+ count: null
18
+ )
19
+ ```
20
+
@@ -0,0 +1,24 @@
1
+ # Abliteration::DeletionSummaryTopByDownloadsInner
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **id** | **String** | | [optional] |
8
+ | **peak_downloads** | **Integer** | | [optional] |
9
+ | **last_seen_month** | **String** | | [optional] |
10
+ | **months_alive** | **Integer** | | [optional] |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'abliteration'
16
+
17
+ instance = Abliteration::DeletionSummaryTopByDownloadsInner.new(
18
+ id: null,
19
+ peak_downloads: null,
20
+ last_seen_month: null,
21
+ months_alive: null
22
+ )
23
+ ```
24
+
@@ -0,0 +1,32 @@
1
+ # Abliteration::GetHistoricalDeletionSummary200Response
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **data** | [**DeletionSummary**](DeletionSummary.md) | | |
8
+ | **cost** | **Integer** | Credits this call costs. | |
9
+ | **credits_remaining** | **Integer** | Wallet balance after the call. Unchanged while metering is preview. | |
10
+ | **rate_limit_limit** | **Integer** | Ceiling for the current window. Also returned as X-RateLimit-Limit. | |
11
+ | **rate_limit_remaining** | **Integer** | Calls left in the current window for this key. Also returned as X-RateLimit-Remaining. | |
12
+ | **rate_limit_reset** | **Integer** | Unix seconds at which the window resets to full ceiling. Also returned as X-RateLimit-Reset. | |
13
+ | **metering** | **String** | Whether cost was actually deducted. | |
14
+ | **request_id** | **String** | Also returned in the x-request-id header. | |
15
+
16
+ ## Example
17
+
18
+ ```ruby
19
+ require 'abliteration'
20
+
21
+ instance = Abliteration::GetHistoricalDeletionSummary200Response.new(
22
+ data: null,
23
+ cost: null,
24
+ credits_remaining: null,
25
+ rate_limit_limit: null,
26
+ rate_limit_remaining: null,
27
+ rate_limit_reset: null,
28
+ metering: null,
29
+ request_id: null
30
+ )
31
+ ```
32
+
@@ -0,0 +1,28 @@
1
+ # Abliteration::HistoricalDeletion
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **id** | **String** | | [optional] |
8
+ | **first_seen_month** | **String** | ISO YYYY-MM of the earliest snapshot the model appears in. | [optional] |
9
+ | **last_seen_month** | **String** | ISO YYYY-MM of the final snapshot before deletion. | [optional] |
10
+ | **total_months_alive** | **Integer** | Whole months between first and last observation. | [optional] |
11
+ | **peak_downloads** | **Integer** | Highest downloads count observed during the model's lifetime. | [optional] |
12
+ | **created_at** | **String** | ISO-8601 timestamp the model was originally created on HF (from the frozen snapshot). | [optional] |
13
+
14
+ ## Example
15
+
16
+ ```ruby
17
+ require 'abliteration'
18
+
19
+ instance = Abliteration::HistoricalDeletion.new(
20
+ id: null,
21
+ first_seen_month: null,
22
+ last_seen_month: null,
23
+ total_months_alive: null,
24
+ peak_downloads: null,
25
+ created_at: null
26
+ )
27
+ ```
28
+
@@ -0,0 +1,32 @@
1
+ # Abliteration::ListHistoricalDeletions200Response
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **data** | [**Array<HistoricalDeletion>**](HistoricalDeletion.md) | | |
8
+ | **cost** | **Integer** | Credits this call costs. | |
9
+ | **credits_remaining** | **Integer** | Wallet balance after the call. Unchanged while metering is preview. | |
10
+ | **rate_limit_limit** | **Integer** | Ceiling for the current window. Also returned as X-RateLimit-Limit. | |
11
+ | **rate_limit_remaining** | **Integer** | Calls left in the current window for this key. Also returned as X-RateLimit-Remaining. | |
12
+ | **rate_limit_reset** | **Integer** | Unix seconds at which the window resets to full ceiling. Also returned as X-RateLimit-Reset. | |
13
+ | **metering** | **String** | Whether cost was actually deducted. | |
14
+ | **request_id** | **String** | Also returned in the x-request-id header. | |
15
+
16
+ ## Example
17
+
18
+ ```ruby
19
+ require 'abliteration'
20
+
21
+ instance = Abliteration::ListHistoricalDeletions200Response.new(
22
+ data: null,
23
+ cost: null,
24
+ credits_remaining: null,
25
+ rate_limit_limit: null,
26
+ rate_limit_remaining: null,
27
+ rate_limit_reset: null,
28
+ metering: null,
29
+ request_id: null
30
+ )
31
+ ```
32
+
data/docs/ModelsApi.md CHANGED
@@ -4,11 +4,79 @@ All URIs are relative to *https://abliteration.org*
4
4
 
5
5
  | Method | HTTP request | Description |
6
6
  | ------ | ------------ | ----------- |
7
+ | [**get_historical_deletion_summary**](ModelsApi.md#get_historical_deletion_summary) | **GET** /api/v1/models/historical-deletions/summary | Historical deletions — aggregate summary |
7
8
  | [**get_model**](ModelsApi.md#get_model) | **GET** /api/v1/models/{id} | Get one model |
8
9
  | [**list_delisted_models**](ModelsApi.md#list_delisted_models) | **GET** /api/v1/models/delisted | List delisted models (change stream) |
10
+ | [**list_historical_deletions**](ModelsApi.md#list_historical_deletions) | **GET** /api/v1/models/historical-deletions/list | Historical deletions — paged list |
9
11
  | [**list_models**](ModelsApi.md#list_models) | **GET** /api/v1/models | List models |
10
12
 
11
13
 
14
+ ## get_historical_deletion_summary
15
+
16
+ > <GetHistoricalDeletionSummary200Response> get_historical_deletion_summary
17
+
18
+ Historical deletions — aggregate summary
19
+
20
+ 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.
21
+
22
+ ### Examples
23
+
24
+ ```ruby
25
+ require 'time'
26
+ require 'abliteration'
27
+ # setup authorization
28
+ Abliteration.configure do |config|
29
+ # Configure Bearer authorization: bearerAuth
30
+ config.access_token = 'YOUR_BEARER_TOKEN'
31
+ end
32
+
33
+ api_instance = Abliteration::ModelsApi.new
34
+
35
+ begin
36
+ # Historical deletions — aggregate summary
37
+ result = api_instance.get_historical_deletion_summary
38
+ p result
39
+ rescue Abliteration::ApiError => e
40
+ puts "Error when calling ModelsApi->get_historical_deletion_summary: #{e}"
41
+ end
42
+ ```
43
+
44
+ #### Using the get_historical_deletion_summary_with_http_info variant
45
+
46
+ This returns an Array which contains the response data, status code and headers.
47
+
48
+ > <Array(<GetHistoricalDeletionSummary200Response>, Integer, Hash)> get_historical_deletion_summary_with_http_info
49
+
50
+ ```ruby
51
+ begin
52
+ # Historical deletions — aggregate summary
53
+ data, status_code, headers = api_instance.get_historical_deletion_summary_with_http_info
54
+ p status_code # => 2xx
55
+ p headers # => { ... }
56
+ p data # => <GetHistoricalDeletionSummary200Response>
57
+ rescue Abliteration::ApiError => e
58
+ puts "Error when calling ModelsApi->get_historical_deletion_summary_with_http_info: #{e}"
59
+ end
60
+ ```
61
+
62
+ ### Parameters
63
+
64
+ This endpoint does not need any parameter.
65
+
66
+ ### Return type
67
+
68
+ [**GetHistoricalDeletionSummary200Response**](GetHistoricalDeletionSummary200Response.md)
69
+
70
+ ### Authorization
71
+
72
+ [bearerAuth](../README.md#bearerAuth)
73
+
74
+ ### HTTP request headers
75
+
76
+ - **Content-Type**: Not defined
77
+ - **Accept**: application/json
78
+
79
+
12
80
  ## get_model
13
81
 
14
82
  > <GetModel200Response> get_model(id)
@@ -155,6 +223,85 @@ end
155
223
  - **Accept**: application/json
156
224
 
157
225
 
226
+ ## list_historical_deletions
227
+
228
+ > <ListHistoricalDeletions200Response> list_historical_deletions(opts)
229
+
230
+ Historical deletions — paged list
231
+
232
+ 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).
233
+
234
+ ### Examples
235
+
236
+ ```ruby
237
+ require 'time'
238
+ require 'abliteration'
239
+ # setup authorization
240
+ Abliteration.configure do |config|
241
+ # Configure Bearer authorization: bearerAuth
242
+ config.access_token = 'YOUR_BEARER_TOKEN'
243
+ end
244
+
245
+ api_instance = Abliteration::ModelsApi.new
246
+ opts = {
247
+ since_month: 'since_month_example', # String | ISO YYYY-MM. Rows with last_seen_month >= it only.
248
+ min_peak_downloads: 56, # Integer | Only rows whose peak downloads >= this. `casualties over N` queries.
249
+ sort: 'downloads', # String | `downloads` (default, biggest first), `recent` (newest last_seen_month first), `lifespan` (longest-lived first).
250
+ limit: 56, # Integer | Rows to return, 1 to 1000. Values outside the range are clamped, not rejected.
251
+ offset: 56 # Integer | Rows to skip. Negative and non-numeric values are treated as 0.
252
+ }
253
+
254
+ begin
255
+ # Historical deletions — paged list
256
+ result = api_instance.list_historical_deletions(opts)
257
+ p result
258
+ rescue Abliteration::ApiError => e
259
+ puts "Error when calling ModelsApi->list_historical_deletions: #{e}"
260
+ end
261
+ ```
262
+
263
+ #### Using the list_historical_deletions_with_http_info variant
264
+
265
+ This returns an Array which contains the response data, status code and headers.
266
+
267
+ > <Array(<ListHistoricalDeletions200Response>, Integer, Hash)> list_historical_deletions_with_http_info(opts)
268
+
269
+ ```ruby
270
+ begin
271
+ # Historical deletions — paged list
272
+ data, status_code, headers = api_instance.list_historical_deletions_with_http_info(opts)
273
+ p status_code # => 2xx
274
+ p headers # => { ... }
275
+ p data # => <ListHistoricalDeletions200Response>
276
+ rescue Abliteration::ApiError => e
277
+ puts "Error when calling ModelsApi->list_historical_deletions_with_http_info: #{e}"
278
+ end
279
+ ```
280
+
281
+ ### Parameters
282
+
283
+ | Name | Type | Description | Notes |
284
+ | ---- | ---- | ----------- | ----- |
285
+ | **since_month** | **String** | ISO YYYY-MM. Rows with last_seen_month &gt;&#x3D; it only. | [optional] |
286
+ | **min_peak_downloads** | **Integer** | Only rows whose peak downloads &gt;&#x3D; this. &#x60;casualties over N&#x60; queries. | [optional] |
287
+ | **sort** | **String** | &#x60;downloads&#x60; (default, biggest first), &#x60;recent&#x60; (newest last_seen_month first), &#x60;lifespan&#x60; (longest-lived first). | [optional][default to &#39;downloads&#39;] |
288
+ | **limit** | **Integer** | Rows to return, 1 to 1000. Values outside the range are clamped, not rejected. | [optional][default to 50] |
289
+ | **offset** | **Integer** | Rows to skip. Negative and non-numeric values are treated as 0. | [optional][default to 0] |
290
+
291
+ ### Return type
292
+
293
+ [**ListHistoricalDeletions200Response**](ListHistoricalDeletions200Response.md)
294
+
295
+ ### Authorization
296
+
297
+ [bearerAuth](../README.md#bearerAuth)
298
+
299
+ ### HTTP request headers
300
+
301
+ - **Content-Type**: Not defined
302
+ - **Accept**: application/json
303
+
304
+
158
305
  ## list_models
159
306
 
160
307
  > <ListModels200Response> list_models(opts)
@@ -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]
@@ -167,6 +224,98 @@ module Abliteration
167
224
  return data, status_code, headers
168
225
  end
169
226
 
227
+ # Historical deletions — paged list
228
+ # 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).
229
+ # @param [Hash] opts the optional parameters
230
+ # @option opts [String] :since_month ISO YYYY-MM. Rows with last_seen_month &gt;&#x3D; it only.
231
+ # @option opts [Integer] :min_peak_downloads Only rows whose peak downloads &gt;&#x3D; this. &#x60;casualties over N&#x60; queries.
232
+ # @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')
233
+ # @option opts [Integer] :limit Rows to return, 1 to 1000. Values outside the range are clamped, not rejected. (default to 50)
234
+ # @option opts [Integer] :offset Rows to skip. Negative and non-numeric values are treated as 0. (default to 0)
235
+ # @return [ListHistoricalDeletions200Response]
236
+ def list_historical_deletions(opts = {})
237
+ data, _status_code, _headers = list_historical_deletions_with_http_info(opts)
238
+ data
239
+ end
240
+
241
+ # Historical deletions — paged list
242
+ # 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).
243
+ # @param [Hash] opts the optional parameters
244
+ # @option opts [String] :since_month ISO YYYY-MM. Rows with last_seen_month &gt;&#x3D; it only.
245
+ # @option opts [Integer] :min_peak_downloads Only rows whose peak downloads &gt;&#x3D; this. &#x60;casualties over N&#x60; queries.
246
+ # @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')
247
+ # @option opts [Integer] :limit Rows to return, 1 to 1000. Values outside the range are clamped, not rejected. (default to 50)
248
+ # @option opts [Integer] :offset Rows to skip. Negative and non-numeric values are treated as 0. (default to 0)
249
+ # @return [Array<(ListHistoricalDeletions200Response, Integer, Hash)>] ListHistoricalDeletions200Response data, response status code and response headers
250
+ def list_historical_deletions_with_http_info(opts = {})
251
+ if @api_client.config.debugging
252
+ @api_client.config.logger.debug 'Calling API: ModelsApi.list_historical_deletions ...'
253
+ end
254
+ if @api_client.config.client_side_validation && !opts[:'min_peak_downloads'].nil? && opts[:'min_peak_downloads'] < 0
255
+ fail ArgumentError, 'invalid value for "opts[:"min_peak_downloads"]" when calling ModelsApi.list_historical_deletions, must be greater than or equal to 0.'
256
+ end
257
+
258
+ allowable_values = ["downloads", "recent", "lifespan"]
259
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
260
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
261
+ end
262
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
263
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ModelsApi.list_historical_deletions, must be smaller than or equal to 1000.'
264
+ end
265
+
266
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
267
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ModelsApi.list_historical_deletions, must be greater than or equal to 1.'
268
+ end
269
+
270
+ if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
271
+ fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling ModelsApi.list_historical_deletions, must be greater than or equal to 0.'
272
+ end
273
+
274
+ # resource path
275
+ local_var_path = '/api/v1/models/historical-deletions/list'
276
+
277
+ # query parameters
278
+ query_params = opts[:query_params] || {}
279
+ query_params[:'since_month'] = opts[:'since_month'] if !opts[:'since_month'].nil?
280
+ query_params[:'min_peak_downloads'] = opts[:'min_peak_downloads'] if !opts[:'min_peak_downloads'].nil?
281
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
282
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
283
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
284
+
285
+ # header parameters
286
+ header_params = opts[:header_params] || {}
287
+ # HTTP header 'Accept' (if needed)
288
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
289
+
290
+ # form parameters
291
+ form_params = opts[:form_params] || {}
292
+
293
+ # http body (model)
294
+ post_body = opts[:debug_body]
295
+
296
+ # return_type
297
+ return_type = opts[:debug_return_type] || 'ListHistoricalDeletions200Response'
298
+
299
+ # auth_names
300
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
301
+
302
+ new_options = opts.merge(
303
+ :operation => :"ModelsApi.list_historical_deletions",
304
+ :header_params => header_params,
305
+ :query_params => query_params,
306
+ :form_params => form_params,
307
+ :body => post_body,
308
+ :auth_names => auth_names,
309
+ :return_type => return_type
310
+ )
311
+
312
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
313
+ if @api_client.config.debugging
314
+ @api_client.config.logger.debug "API called: ModelsApi#list_historical_deletions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
315
+ end
316
+ return data, status_code, headers
317
+ end
318
+
170
319
  # List models
171
320
  # 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
321
  # @param [Hash] opts the optional parameters