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
|
@@ -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
|
+
# One stored daily Freedom Velocity reading.
|
|
18
|
+
class FreedomVelocityDailyPoint < ApiModelBase
|
|
19
|
+
# UTC date of the snapshot, YYYY-MM-DD.
|
|
20
|
+
attr_accessor :date
|
|
21
|
+
|
|
22
|
+
# Mean days from a base model release to the first derived catalog model, as stored that day.
|
|
23
|
+
attr_accessor :value
|
|
24
|
+
|
|
25
|
+
# Median of the per-base days that day; null when not recorded.
|
|
26
|
+
attr_accessor :median
|
|
27
|
+
|
|
28
|
+
# Number of base models in the average that day; null when not recorded.
|
|
29
|
+
attr_accessor :bases_count
|
|
30
|
+
|
|
31
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
32
|
+
def self.attribute_map
|
|
33
|
+
{
|
|
34
|
+
:'date' => :'date',
|
|
35
|
+
:'value' => :'value',
|
|
36
|
+
:'median' => :'median',
|
|
37
|
+
:'bases_count' => :'bases_count'
|
|
38
|
+
}
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Returns attribute mapping this model knows about
|
|
42
|
+
def self.acceptable_attribute_map
|
|
43
|
+
attribute_map
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Returns all the JSON keys this model knows about
|
|
47
|
+
def self.acceptable_attributes
|
|
48
|
+
acceptable_attribute_map.values
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Attribute type mapping.
|
|
52
|
+
def self.openapi_types
|
|
53
|
+
{
|
|
54
|
+
:'date' => :'String',
|
|
55
|
+
:'value' => :'Float',
|
|
56
|
+
:'median' => :'Float',
|
|
57
|
+
:'bases_count' => :'Integer'
|
|
58
|
+
}
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# List of attributes with nullable: true
|
|
62
|
+
def self.openapi_nullable
|
|
63
|
+
Set.new([
|
|
64
|
+
:'median',
|
|
65
|
+
:'bases_count'
|
|
66
|
+
])
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Initializes the object
|
|
70
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
71
|
+
def initialize(attributes = {})
|
|
72
|
+
if (!attributes.is_a?(Hash))
|
|
73
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Abliteration::FreedomVelocityDailyPoint` initialize method"
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
77
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
78
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
79
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
80
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Abliteration::FreedomVelocityDailyPoint`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
81
|
+
end
|
|
82
|
+
h[k.to_sym] = v
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if attributes.key?(:'date')
|
|
86
|
+
self.date = attributes[:'date']
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
if attributes.key?(:'value')
|
|
90
|
+
self.value = attributes[:'value']
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
if attributes.key?(:'median')
|
|
94
|
+
self.median = attributes[:'median']
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
if attributes.key?(:'bases_count')
|
|
98
|
+
self.bases_count = attributes[:'bases_count']
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
103
|
+
# @return Array for valid properties with the reasons
|
|
104
|
+
def list_invalid_properties
|
|
105
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
106
|
+
invalid_properties = Array.new
|
|
107
|
+
pattern = Regexp.new(/^\d{4}-\d{2}-\d{2}$/)
|
|
108
|
+
if !@date.nil? && @date !~ pattern
|
|
109
|
+
invalid_properties.push("invalid value for \"date\", must conform to the pattern #{pattern}.")
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
invalid_properties
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Check to see if the all the properties in the model are valid
|
|
116
|
+
# @return true if the model is valid
|
|
117
|
+
def valid?
|
|
118
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
119
|
+
return false if !@date.nil? && @date !~ Regexp.new(/^\d{4}-\d{2}-\d{2}$/)
|
|
120
|
+
true
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Custom attribute writer method with validation
|
|
124
|
+
# @param [Object] date Value to be assigned
|
|
125
|
+
def date=(date)
|
|
126
|
+
if date.nil?
|
|
127
|
+
fail ArgumentError, 'date cannot be nil'
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
pattern = Regexp.new(/^\d{4}-\d{2}-\d{2}$/)
|
|
131
|
+
if date !~ pattern
|
|
132
|
+
fail ArgumentError, "invalid value for \"date\", must conform to the pattern #{pattern}."
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
@date = date
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Checks equality by comparing each attribute.
|
|
139
|
+
# @param [Object] Object to be compared
|
|
140
|
+
def ==(o)
|
|
141
|
+
return true if self.equal?(o)
|
|
142
|
+
self.class == o.class &&
|
|
143
|
+
date == o.date &&
|
|
144
|
+
value == o.value &&
|
|
145
|
+
median == o.median &&
|
|
146
|
+
bases_count == o.bases_count
|
|
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
|
+
[date, value, median, bases_count].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,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 GetModelDownloadHistory200Response < 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<DownloadPoint>',
|
|
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::GetModelDownloadHistory200Response` 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::GetModelDownloadHistory200Response`. 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
|
|
@@ -29,12 +29,19 @@ 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
|
class EnumAttributeValidator
|
|
@@ -71,6 +78,8 @@ module Abliteration
|
|
|
71
78
|
:'history_available' => :'history_available',
|
|
72
79
|
:'as_of' => :'as_of',
|
|
73
80
|
:'note' => :'note',
|
|
81
|
+
:'median' => :'median',
|
|
82
|
+
:'bases_count' => :'bases_count',
|
|
74
83
|
:'recent_history' => :'recent_history'
|
|
75
84
|
}
|
|
76
85
|
end
|
|
@@ -97,6 +106,8 @@ module Abliteration
|
|
|
97
106
|
:'history_available' => :'Boolean',
|
|
98
107
|
:'as_of' => :'String',
|
|
99
108
|
:'note' => :'String',
|
|
109
|
+
:'median' => :'Float',
|
|
110
|
+
:'bases_count' => :'Integer',
|
|
100
111
|
:'recent_history' => :'Array<DaiPoint>'
|
|
101
112
|
}
|
|
102
113
|
end
|
|
@@ -107,6 +118,8 @@ module Abliteration
|
|
|
107
118
|
:'value',
|
|
108
119
|
:'as_of',
|
|
109
120
|
:'note',
|
|
121
|
+
:'median',
|
|
122
|
+
:'bases_count',
|
|
110
123
|
])
|
|
111
124
|
end
|
|
112
125
|
|
|
@@ -162,6 +175,14 @@ module Abliteration
|
|
|
162
175
|
self.note = attributes[:'note']
|
|
163
176
|
end
|
|
164
177
|
|
|
178
|
+
if attributes.key?(:'median')
|
|
179
|
+
self.median = attributes[:'median']
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
if attributes.key?(:'bases_count')
|
|
183
|
+
self.bases_count = attributes[:'bases_count']
|
|
184
|
+
end
|
|
185
|
+
|
|
165
186
|
if attributes.key?(:'recent_history')
|
|
166
187
|
if (value = attributes[:'recent_history']).is_a?(Array)
|
|
167
188
|
self.recent_history = value
|
|
@@ -222,6 +243,8 @@ module Abliteration
|
|
|
222
243
|
history_available == o.history_available &&
|
|
223
244
|
as_of == o.as_of &&
|
|
224
245
|
note == o.note &&
|
|
246
|
+
median == o.median &&
|
|
247
|
+
bases_count == o.bases_count &&
|
|
225
248
|
recent_history == o.recent_history
|
|
226
249
|
end
|
|
227
250
|
|
|
@@ -234,7 +257,7 @@ module Abliteration
|
|
|
234
257
|
# Calculates hash code according to all attributes.
|
|
235
258
|
# @return [Integer] Hash code
|
|
236
259
|
def hash
|
|
237
|
-
[id, name, value, unit, measured, source, history_available, as_of, note, recent_history].hash
|
|
260
|
+
[id, name, value, unit, measured, source, history_available, as_of, note, median, bases_count, recent_history].hash
|
|
238
261
|
end
|
|
239
262
|
|
|
240
263
|
# Builds the object from hash
|