abliteration 0.1.8 → 0.1.10
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 +4 -4
- data/README.md +7 -0
- data/docs/DownloadAnomaly.md +32 -0
- data/docs/DownloadPoint.md +20 -0
- data/docs/FreedomVelocityDailyPoint.md +24 -0
- data/docs/GetModelDownloadHistory200Response.md +32 -0
- data/docs/Index.md +5 -1
- data/docs/IndexDetail.md +8 -2
- data/docs/IndicesApi.md +2 -2
- data/docs/ListAnomalies200Response.md +32 -0
- data/docs/ModelsApi.md +154 -0
- data/lib/abliteration/api/indices_api.rb +4 -4
- data/lib/abliteration/api/models_api.rb +174 -0
- data/lib/abliteration/models/download_anomaly.rb +250 -0
- data/lib/abliteration/models/download_point.rb +158 -0
- data/lib/abliteration/models/freedom_velocity_daily_point.rb +202 -0
- data/lib/abliteration/models/get_model_download_history200_response.rb +386 -0
- data/lib/abliteration/models/index.rb +24 -1
- data/lib/abliteration/models/index_detail.rb +37 -4
- data/lib/abliteration/models/list_anomalies200_response.rb +386 -0
- data/lib/abliteration/version.rb +1 -1
- data/lib/abliteration.rb +5 -0
- data/spec/models/download_anomaly_spec.rb +82 -0
- data/spec/models/download_point_spec.rb +42 -0
- data/spec/models/freedom_velocity_daily_point_spec.rb +54 -0
- data/spec/models/get_model_download_history200_response_spec.rb +82 -0
- data/spec/models/list_anomalies200_response_spec.rb +82 -0
- metadata +55 -35
|
@@ -29,16 +29,26 @@ module Abliteration
|
|
|
29
29
|
# Where the number is produced.
|
|
30
30
|
attr_accessor :source
|
|
31
31
|
|
|
32
|
+
# true when this index exposes a time series in `history` or `daily_history`
|
|
32
33
|
attr_accessor :history_available
|
|
33
34
|
|
|
34
35
|
attr_accessor :as_of
|
|
35
36
|
|
|
36
37
|
attr_accessor :note
|
|
37
38
|
|
|
39
|
+
# freedom-velocity only: median of the per-base days, rounded to 0.1.
|
|
40
|
+
attr_accessor :median
|
|
41
|
+
|
|
42
|
+
# freedom-velocity only: number of base models in the average.
|
|
43
|
+
attr_accessor :bases_count
|
|
44
|
+
|
|
38
45
|
attr_accessor :recent_history
|
|
39
46
|
|
|
40
47
|
attr_accessor :history
|
|
41
48
|
|
|
49
|
+
# freedom-velocity only (absent for the other indices): the daily Freedom Velocity readings stored once a day in index_snapshots, oldest first. Empty until the first daily snapshot exists.
|
|
50
|
+
attr_accessor :daily_history
|
|
51
|
+
|
|
42
52
|
class EnumAttributeValidator
|
|
43
53
|
attr_reader :datatype
|
|
44
54
|
attr_reader :allowable_values
|
|
@@ -73,8 +83,11 @@ module Abliteration
|
|
|
73
83
|
:'history_available' => :'history_available',
|
|
74
84
|
:'as_of' => :'as_of',
|
|
75
85
|
:'note' => :'note',
|
|
86
|
+
:'median' => :'median',
|
|
87
|
+
:'bases_count' => :'bases_count',
|
|
76
88
|
:'recent_history' => :'recent_history',
|
|
77
|
-
:'history' => :'history'
|
|
89
|
+
:'history' => :'history',
|
|
90
|
+
:'daily_history' => :'daily_history'
|
|
78
91
|
}
|
|
79
92
|
end
|
|
80
93
|
|
|
@@ -100,8 +113,11 @@ module Abliteration
|
|
|
100
113
|
:'history_available' => :'Boolean',
|
|
101
114
|
:'as_of' => :'String',
|
|
102
115
|
:'note' => :'String',
|
|
116
|
+
:'median' => :'Float',
|
|
117
|
+
:'bases_count' => :'Integer',
|
|
103
118
|
:'recent_history' => :'Array<DaiPoint>',
|
|
104
|
-
:'history' => :'Array<DaiPoint>'
|
|
119
|
+
:'history' => :'Array<DaiPoint>',
|
|
120
|
+
:'daily_history' => :'Array<FreedomVelocityDailyPoint>'
|
|
105
121
|
}
|
|
106
122
|
end
|
|
107
123
|
|
|
@@ -170,6 +186,14 @@ module Abliteration
|
|
|
170
186
|
self.note = attributes[:'note']
|
|
171
187
|
end
|
|
172
188
|
|
|
189
|
+
if attributes.key?(:'median')
|
|
190
|
+
self.median = attributes[:'median']
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
if attributes.key?(:'bases_count')
|
|
194
|
+
self.bases_count = attributes[:'bases_count']
|
|
195
|
+
end
|
|
196
|
+
|
|
173
197
|
if attributes.key?(:'recent_history')
|
|
174
198
|
if (value = attributes[:'recent_history']).is_a?(Array)
|
|
175
199
|
self.recent_history = value
|
|
@@ -181,6 +205,12 @@ module Abliteration
|
|
|
181
205
|
self.history = value
|
|
182
206
|
end
|
|
183
207
|
end
|
|
208
|
+
|
|
209
|
+
if attributes.key?(:'daily_history')
|
|
210
|
+
if (value = attributes[:'daily_history']).is_a?(Array)
|
|
211
|
+
self.daily_history = value
|
|
212
|
+
end
|
|
213
|
+
end
|
|
184
214
|
end
|
|
185
215
|
|
|
186
216
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -236,8 +266,11 @@ module Abliteration
|
|
|
236
266
|
history_available == o.history_available &&
|
|
237
267
|
as_of == o.as_of &&
|
|
238
268
|
note == o.note &&
|
|
269
|
+
median == o.median &&
|
|
270
|
+
bases_count == o.bases_count &&
|
|
239
271
|
recent_history == o.recent_history &&
|
|
240
|
-
history == o.history
|
|
272
|
+
history == o.history &&
|
|
273
|
+
daily_history == o.daily_history
|
|
241
274
|
end
|
|
242
275
|
|
|
243
276
|
# @see the `==` method
|
|
@@ -249,7 +282,7 @@ module Abliteration
|
|
|
249
282
|
# Calculates hash code according to all attributes.
|
|
250
283
|
# @return [Integer] Hash code
|
|
251
284
|
def hash
|
|
252
|
-
[id, name, value, unit, measured, source, history_available, as_of, note, recent_history, history].hash
|
|
285
|
+
[id, name, value, unit, measured, source, history_available, as_of, note, median, bases_count, recent_history, history, daily_history].hash
|
|
253
286
|
end
|
|
254
287
|
|
|
255
288
|
# Builds the object from hash
|
|
@@ -0,0 +1,386 @@
|
|
|
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 ListAnomalies200Response < ApiModelBase
|
|
18
|
+
attr_accessor :data
|
|
19
|
+
|
|
20
|
+
# Credits this call costs.
|
|
21
|
+
attr_accessor :cost
|
|
22
|
+
|
|
23
|
+
# Wallet balance after the call. Unchanged while metering is preview.
|
|
24
|
+
attr_accessor :credits_remaining
|
|
25
|
+
|
|
26
|
+
# Ceiling for the current window. Also returned as X-RateLimit-Limit.
|
|
27
|
+
attr_accessor :rate_limit_limit
|
|
28
|
+
|
|
29
|
+
# Calls left in the current window for this key. Also returned as X-RateLimit-Remaining.
|
|
30
|
+
attr_accessor :rate_limit_remaining
|
|
31
|
+
|
|
32
|
+
# Unix seconds at which the window resets to full ceiling. Also returned as X-RateLimit-Reset.
|
|
33
|
+
attr_accessor :rate_limit_reset
|
|
34
|
+
|
|
35
|
+
# Whether cost was actually deducted.
|
|
36
|
+
attr_accessor :metering
|
|
37
|
+
|
|
38
|
+
# Also returned in the x-request-id header.
|
|
39
|
+
attr_accessor :request_id
|
|
40
|
+
|
|
41
|
+
class EnumAttributeValidator
|
|
42
|
+
attr_reader :datatype
|
|
43
|
+
attr_reader :allowable_values
|
|
44
|
+
|
|
45
|
+
def initialize(datatype, allowable_values)
|
|
46
|
+
@allowable_values = allowable_values.map do |value|
|
|
47
|
+
case datatype.to_s
|
|
48
|
+
when /Integer/i
|
|
49
|
+
value.to_i
|
|
50
|
+
when /Float/i
|
|
51
|
+
value.to_f
|
|
52
|
+
else
|
|
53
|
+
value
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def valid?(value)
|
|
59
|
+
!value || allowable_values.include?(value)
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
64
|
+
def self.attribute_map
|
|
65
|
+
{
|
|
66
|
+
:'data' => :'data',
|
|
67
|
+
:'cost' => :'cost',
|
|
68
|
+
:'credits_remaining' => :'credits_remaining',
|
|
69
|
+
:'rate_limit_limit' => :'rate_limit_limit',
|
|
70
|
+
:'rate_limit_remaining' => :'rate_limit_remaining',
|
|
71
|
+
:'rate_limit_reset' => :'rate_limit_reset',
|
|
72
|
+
:'metering' => :'metering',
|
|
73
|
+
:'request_id' => :'request_id'
|
|
74
|
+
}
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Returns attribute mapping this model knows about
|
|
78
|
+
def self.acceptable_attribute_map
|
|
79
|
+
attribute_map
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Returns all the JSON keys this model knows about
|
|
83
|
+
def self.acceptable_attributes
|
|
84
|
+
acceptable_attribute_map.values
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Attribute type mapping.
|
|
88
|
+
def self.openapi_types
|
|
89
|
+
{
|
|
90
|
+
:'data' => :'Array<DownloadAnomaly>',
|
|
91
|
+
:'cost' => :'Integer',
|
|
92
|
+
:'credits_remaining' => :'Integer',
|
|
93
|
+
:'rate_limit_limit' => :'Integer',
|
|
94
|
+
:'rate_limit_remaining' => :'Integer',
|
|
95
|
+
:'rate_limit_reset' => :'Integer',
|
|
96
|
+
:'metering' => :'String',
|
|
97
|
+
:'request_id' => :'String'
|
|
98
|
+
}
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# List of attributes with nullable: true
|
|
102
|
+
def self.openapi_nullable
|
|
103
|
+
Set.new([
|
|
104
|
+
])
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# List of class defined in allOf (OpenAPI v3)
|
|
108
|
+
def self.openapi_all_of
|
|
109
|
+
[
|
|
110
|
+
:'Envelope'
|
|
111
|
+
]
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# Initializes the object
|
|
115
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
116
|
+
def initialize(attributes = {})
|
|
117
|
+
if (!attributes.is_a?(Hash))
|
|
118
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Abliteration::ListAnomalies200Response` initialize method"
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
122
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
123
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
124
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
125
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Abliteration::ListAnomalies200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
126
|
+
end
|
|
127
|
+
h[k.to_sym] = v
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if attributes.key?(:'data')
|
|
131
|
+
if (value = attributes[:'data']).is_a?(Array)
|
|
132
|
+
self.data = value
|
|
133
|
+
end
|
|
134
|
+
else
|
|
135
|
+
self.data = nil
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if attributes.key?(:'cost')
|
|
139
|
+
self.cost = attributes[:'cost']
|
|
140
|
+
else
|
|
141
|
+
self.cost = nil
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if attributes.key?(:'credits_remaining')
|
|
145
|
+
self.credits_remaining = attributes[:'credits_remaining']
|
|
146
|
+
else
|
|
147
|
+
self.credits_remaining = nil
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
if attributes.key?(:'rate_limit_limit')
|
|
151
|
+
self.rate_limit_limit = attributes[:'rate_limit_limit']
|
|
152
|
+
else
|
|
153
|
+
self.rate_limit_limit = nil
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if attributes.key?(:'rate_limit_remaining')
|
|
157
|
+
self.rate_limit_remaining = attributes[:'rate_limit_remaining']
|
|
158
|
+
else
|
|
159
|
+
self.rate_limit_remaining = nil
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
if attributes.key?(:'rate_limit_reset')
|
|
163
|
+
self.rate_limit_reset = attributes[:'rate_limit_reset']
|
|
164
|
+
else
|
|
165
|
+
self.rate_limit_reset = nil
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
if attributes.key?(:'metering')
|
|
169
|
+
self.metering = attributes[:'metering']
|
|
170
|
+
else
|
|
171
|
+
self.metering = nil
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
if attributes.key?(:'request_id')
|
|
175
|
+
self.request_id = attributes[:'request_id']
|
|
176
|
+
else
|
|
177
|
+
self.request_id = nil
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
182
|
+
# @return Array for valid properties with the reasons
|
|
183
|
+
def list_invalid_properties
|
|
184
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
185
|
+
invalid_properties = Array.new
|
|
186
|
+
if @data.nil?
|
|
187
|
+
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
if @cost.nil?
|
|
191
|
+
invalid_properties.push('invalid value for "cost", cost cannot be nil.')
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
if @credits_remaining.nil?
|
|
195
|
+
invalid_properties.push('invalid value for "credits_remaining", credits_remaining cannot be nil.')
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
if @rate_limit_limit.nil?
|
|
199
|
+
invalid_properties.push('invalid value for "rate_limit_limit", rate_limit_limit cannot be nil.')
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
if @rate_limit_remaining.nil?
|
|
203
|
+
invalid_properties.push('invalid value for "rate_limit_remaining", rate_limit_remaining cannot be nil.')
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
if @rate_limit_reset.nil?
|
|
207
|
+
invalid_properties.push('invalid value for "rate_limit_reset", rate_limit_reset cannot be nil.')
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
if @metering.nil?
|
|
211
|
+
invalid_properties.push('invalid value for "metering", metering cannot be nil.')
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
if @request_id.nil?
|
|
215
|
+
invalid_properties.push('invalid value for "request_id", request_id cannot be nil.')
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
invalid_properties
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Check to see if the all the properties in the model are valid
|
|
222
|
+
# @return true if the model is valid
|
|
223
|
+
def valid?
|
|
224
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
225
|
+
return false if @data.nil?
|
|
226
|
+
return false if @cost.nil?
|
|
227
|
+
return false if @credits_remaining.nil?
|
|
228
|
+
return false if @rate_limit_limit.nil?
|
|
229
|
+
return false if @rate_limit_remaining.nil?
|
|
230
|
+
return false if @rate_limit_reset.nil?
|
|
231
|
+
return false if @metering.nil?
|
|
232
|
+
metering_validator = EnumAttributeValidator.new('String', ["preview", "billed"])
|
|
233
|
+
return false unless metering_validator.valid?(@metering)
|
|
234
|
+
return false if @request_id.nil?
|
|
235
|
+
true
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
# Custom attribute writer method with validation
|
|
239
|
+
# @param [Object] data Value to be assigned
|
|
240
|
+
def data=(data)
|
|
241
|
+
if data.nil?
|
|
242
|
+
fail ArgumentError, 'data cannot be nil'
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
@data = data
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
# Custom attribute writer method with validation
|
|
249
|
+
# @param [Object] cost Value to be assigned
|
|
250
|
+
def cost=(cost)
|
|
251
|
+
if cost.nil?
|
|
252
|
+
fail ArgumentError, 'cost cannot be nil'
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
@cost = cost
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# Custom attribute writer method with validation
|
|
259
|
+
# @param [Object] credits_remaining Value to be assigned
|
|
260
|
+
def credits_remaining=(credits_remaining)
|
|
261
|
+
if credits_remaining.nil?
|
|
262
|
+
fail ArgumentError, 'credits_remaining cannot be nil'
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
@credits_remaining = credits_remaining
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
# Custom attribute writer method with validation
|
|
269
|
+
# @param [Object] rate_limit_limit Value to be assigned
|
|
270
|
+
def rate_limit_limit=(rate_limit_limit)
|
|
271
|
+
if rate_limit_limit.nil?
|
|
272
|
+
fail ArgumentError, 'rate_limit_limit cannot be nil'
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
@rate_limit_limit = rate_limit_limit
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
# Custom attribute writer method with validation
|
|
279
|
+
# @param [Object] rate_limit_remaining Value to be assigned
|
|
280
|
+
def rate_limit_remaining=(rate_limit_remaining)
|
|
281
|
+
if rate_limit_remaining.nil?
|
|
282
|
+
fail ArgumentError, 'rate_limit_remaining cannot be nil'
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
@rate_limit_remaining = rate_limit_remaining
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
# Custom attribute writer method with validation
|
|
289
|
+
# @param [Object] rate_limit_reset Value to be assigned
|
|
290
|
+
def rate_limit_reset=(rate_limit_reset)
|
|
291
|
+
if rate_limit_reset.nil?
|
|
292
|
+
fail ArgumentError, 'rate_limit_reset cannot be nil'
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
@rate_limit_reset = rate_limit_reset
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
299
|
+
# @param [Object] metering Object to be assigned
|
|
300
|
+
def metering=(metering)
|
|
301
|
+
validator = EnumAttributeValidator.new('String', ["preview", "billed"])
|
|
302
|
+
unless validator.valid?(metering)
|
|
303
|
+
fail ArgumentError, "invalid value for \"metering\", must be one of #{validator.allowable_values}."
|
|
304
|
+
end
|
|
305
|
+
@metering = metering
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
# Custom attribute writer method with validation
|
|
309
|
+
# @param [Object] request_id Value to be assigned
|
|
310
|
+
def request_id=(request_id)
|
|
311
|
+
if request_id.nil?
|
|
312
|
+
fail ArgumentError, 'request_id cannot be nil'
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
@request_id = request_id
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
# Checks equality by comparing each attribute.
|
|
319
|
+
# @param [Object] Object to be compared
|
|
320
|
+
def ==(o)
|
|
321
|
+
return true if self.equal?(o)
|
|
322
|
+
self.class == o.class &&
|
|
323
|
+
data == o.data &&
|
|
324
|
+
cost == o.cost &&
|
|
325
|
+
credits_remaining == o.credits_remaining &&
|
|
326
|
+
rate_limit_limit == o.rate_limit_limit &&
|
|
327
|
+
rate_limit_remaining == o.rate_limit_remaining &&
|
|
328
|
+
rate_limit_reset == o.rate_limit_reset &&
|
|
329
|
+
metering == o.metering &&
|
|
330
|
+
request_id == o.request_id
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
# @see the `==` method
|
|
334
|
+
# @param [Object] Object to be compared
|
|
335
|
+
def eql?(o)
|
|
336
|
+
self == o
|
|
337
|
+
end
|
|
338
|
+
|
|
339
|
+
# Calculates hash code according to all attributes.
|
|
340
|
+
# @return [Integer] Hash code
|
|
341
|
+
def hash
|
|
342
|
+
[data, cost, credits_remaining, rate_limit_limit, rate_limit_remaining, rate_limit_reset, metering, request_id].hash
|
|
343
|
+
end
|
|
344
|
+
|
|
345
|
+
# Builds the object from hash
|
|
346
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
347
|
+
# @return [Object] Returns the model itself
|
|
348
|
+
def self.build_from_hash(attributes)
|
|
349
|
+
return nil unless attributes.is_a?(Hash)
|
|
350
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
351
|
+
transformed_hash = {}
|
|
352
|
+
openapi_types.each_pair do |key, type|
|
|
353
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
354
|
+
transformed_hash["#{key}"] = nil
|
|
355
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
356
|
+
# check to ensure the input is an array given that the attribute
|
|
357
|
+
# is documented as an array but the input is not
|
|
358
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
359
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
360
|
+
end
|
|
361
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
362
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
363
|
+
end
|
|
364
|
+
end
|
|
365
|
+
new(transformed_hash)
|
|
366
|
+
end
|
|
367
|
+
|
|
368
|
+
# Returns the object in the form of hash
|
|
369
|
+
# @return [Hash] Returns the object in the form of hash
|
|
370
|
+
def to_hash
|
|
371
|
+
hash = {}
|
|
372
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
373
|
+
value = self.send(attr)
|
|
374
|
+
if value.nil?
|
|
375
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
376
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
377
|
+
end
|
|
378
|
+
|
|
379
|
+
hash[param] = _to_hash(value)
|
|
380
|
+
end
|
|
381
|
+
hash
|
|
382
|
+
end
|
|
383
|
+
|
|
384
|
+
end
|
|
385
|
+
|
|
386
|
+
end
|
data/lib/abliteration/version.rb
CHANGED
data/lib/abliteration.rb
CHANGED
|
@@ -27,19 +27,24 @@ require 'abliteration/models/deletion_summary'
|
|
|
27
27
|
require 'abliteration/models/deletion_summary_timeline_inner'
|
|
28
28
|
require 'abliteration/models/deletion_summary_top_by_downloads_inner'
|
|
29
29
|
require 'abliteration/models/delisted_model'
|
|
30
|
+
require 'abliteration/models/download_anomaly'
|
|
31
|
+
require 'abliteration/models/download_point'
|
|
30
32
|
require 'abliteration/models/envelope'
|
|
31
33
|
require 'abliteration/models/error'
|
|
32
34
|
require 'abliteration/models/event'
|
|
35
|
+
require 'abliteration/models/freedom_velocity_daily_point'
|
|
33
36
|
require 'abliteration/models/get_author200_response'
|
|
34
37
|
require 'abliteration/models/get_dataset200_response'
|
|
35
38
|
require 'abliteration/models/get_historical_deletion_summary200_response'
|
|
36
39
|
require 'abliteration/models/get_index200_response'
|
|
37
40
|
require 'abliteration/models/get_method200_response'
|
|
38
41
|
require 'abliteration/models/get_model200_response'
|
|
42
|
+
require 'abliteration/models/get_model_download_history200_response'
|
|
39
43
|
require 'abliteration/models/get_model_readme_at200_response'
|
|
40
44
|
require 'abliteration/models/historical_deletion'
|
|
41
45
|
require 'abliteration/models/index'
|
|
42
46
|
require 'abliteration/models/index_detail'
|
|
47
|
+
require 'abliteration/models/list_anomalies200_response'
|
|
43
48
|
require 'abliteration/models/list_authors200_response'
|
|
44
49
|
require 'abliteration/models/list_datasets200_response'
|
|
45
50
|
require 'abliteration/models/list_delisted_models200_response'
|
|
@@ -0,0 +1,82 @@
|
|
|
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 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Abliteration::DownloadAnomaly
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Abliteration::DownloadAnomaly do
|
|
21
|
+
#let(:instance) { Abliteration::DownloadAnomaly.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of DownloadAnomaly' do
|
|
24
|
+
it 'should create an instance of DownloadAnomaly' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(Abliteration::DownloadAnomaly)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "model_id"' do
|
|
31
|
+
it 'should work' do
|
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
describe 'test attribute "current_at"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
describe 'test attribute "current_downloads"' do
|
|
43
|
+
it 'should work' do
|
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
describe 'test attribute "baseline_at"' do
|
|
49
|
+
it 'should work' do
|
|
50
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
describe 'test attribute "baseline_downloads"' do
|
|
55
|
+
it 'should work' do
|
|
56
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
describe 'test attribute "ratio"' do
|
|
61
|
+
it 'should work' do
|
|
62
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
describe 'test attribute "delta"' do
|
|
67
|
+
it 'should work' do
|
|
68
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
describe 'test attribute "kind"' do
|
|
73
|
+
it 'should work' do
|
|
74
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
75
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["spike", "drop"])
|
|
76
|
+
# validator.allowable_values.each do |value|
|
|
77
|
+
# expect { instance.kind = value }.not_to raise_error
|
|
78
|
+
# end
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
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 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Abliteration::DownloadPoint
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Abliteration::DownloadPoint do
|
|
21
|
+
#let(:instance) { Abliteration::DownloadPoint.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of DownloadPoint' do
|
|
24
|
+
it 'should create an instance of DownloadPoint' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(Abliteration::DownloadPoint)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "date"' do
|
|
31
|
+
it 'should work' do
|
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
describe 'test attribute "downloads"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
end
|