abliteration 0.0.1 → 0.1.0

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 (114) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +9 -0
  3. data/README.md +55 -7
  4. data/Rakefile +10 -0
  5. data/abliteration.gemspec +38 -21
  6. data/docs/Author.md +26 -0
  7. data/docs/AuthorDetail.md +28 -0
  8. data/docs/AuthorsApi.md +153 -0
  9. data/docs/DaiPoint.md +22 -0
  10. data/docs/Dataset.md +38 -0
  11. data/docs/DatasetDetail.md +22 -0
  12. data/docs/DatasetsApi.md +159 -0
  13. data/docs/Envelope.md +32 -0
  14. data/docs/Error.md +26 -0
  15. data/docs/Event.md +30 -0
  16. data/docs/GetAuthor200Response.md +32 -0
  17. data/docs/GetDataset200Response.md +32 -0
  18. data/docs/GetIndex200Response.md +32 -0
  19. data/docs/GetMethod200Response.md +32 -0
  20. data/docs/GetModel200Response.md +32 -0
  21. data/docs/Index.md +36 -0
  22. data/docs/IndexDetail.md +38 -0
  23. data/docs/IndicesApi.md +144 -0
  24. data/docs/ListAuthors200Response.md +32 -0
  25. data/docs/ListDatasets200Response.md +32 -0
  26. data/docs/ListIndices200Response.md +32 -0
  27. data/docs/ListMethods200Response.md +32 -0
  28. data/docs/ListModels200Response.md +32 -0
  29. data/docs/ListTimeline200Response.md +32 -0
  30. data/docs/Method.md +28 -0
  31. data/docs/MethodDetail.md +34 -0
  32. data/docs/MethodDetailAllOfTopAuthors.md +20 -0
  33. data/docs/MethodsApi.md +144 -0
  34. data/docs/ModelDetail.md +28 -0
  35. data/docs/ModelSummary.md +42 -0
  36. data/docs/ModelsApi.md +169 -0
  37. data/docs/Passport.md +22 -0
  38. data/docs/TimelineApi.md +85 -0
  39. data/git_push.sh +54 -0
  40. data/lib/abliteration/api/authors_api.rb +167 -0
  41. data/lib/abliteration/api/datasets_api.rb +176 -0
  42. data/lib/abliteration/api/indices_api.rb +147 -0
  43. data/lib/abliteration/api/methods_api.rb +147 -0
  44. data/lib/abliteration/api/models_api.rb +191 -0
  45. data/lib/abliteration/api/timeline_api.rb +99 -0
  46. data/lib/abliteration/api_client.rb +397 -0
  47. data/lib/abliteration/api_error.rb +58 -0
  48. data/lib/abliteration/api_model_base.rb +88 -0
  49. data/lib/abliteration/configuration.rb +308 -0
  50. data/lib/abliteration/models/author.rb +184 -0
  51. data/lib/abliteration/models/author_detail.rb +201 -0
  52. data/lib/abliteration/models/dai_point.rb +165 -0
  53. data/lib/abliteration/models/dataset.rb +247 -0
  54. data/lib/abliteration/models/dataset_detail.rb +169 -0
  55. data/lib/abliteration/models/envelope.rb +364 -0
  56. data/lib/abliteration/models/error.rb +221 -0
  57. data/lib/abliteration/models/event.rb +207 -0
  58. data/lib/abliteration/models/get_author200_response.rb +384 -0
  59. data/lib/abliteration/models/get_dataset200_response.rb +384 -0
  60. data/lib/abliteration/models/get_index200_response.rb +384 -0
  61. data/lib/abliteration/models/get_method200_response.rb +384 -0
  62. data/lib/abliteration/models/get_model200_response.rb +384 -0
  63. data/lib/abliteration/models/index.rb +281 -0
  64. data/lib/abliteration/models/index_detail.rb +296 -0
  65. data/lib/abliteration/models/list_authors200_response.rb +386 -0
  66. data/lib/abliteration/models/list_datasets200_response.rb +386 -0
  67. data/lib/abliteration/models/list_indices200_response.rb +386 -0
  68. data/lib/abliteration/models/list_methods200_response.rb +386 -0
  69. data/lib/abliteration/models/list_models200_response.rb +386 -0
  70. data/lib/abliteration/models/list_timeline200_response.rb +386 -0
  71. data/lib/abliteration/models/method.rb +227 -0
  72. data/lib/abliteration/models/method_detail.rb +265 -0
  73. data/lib/abliteration/models/method_detail_all_of_top_authors.rb +156 -0
  74. data/lib/abliteration/models/model_detail.rb +196 -0
  75. data/lib/abliteration/models/model_summary.rb +265 -0
  76. data/lib/abliteration/models/passport.rb +165 -0
  77. data/lib/abliteration/version.rb +15 -0
  78. data/lib/abliteration.rb +69 -24
  79. data/openapi-generator-config.json +12 -0
  80. data/spec/api/authors_api_spec.rb +61 -0
  81. data/spec/api/datasets_api_spec.rb +64 -0
  82. data/spec/api/indices_api_spec.rb +58 -0
  83. data/spec/api/methods_api_spec.rb +58 -0
  84. data/spec/api/models_api_spec.rb +69 -0
  85. data/spec/api/timeline_api_spec.rb +50 -0
  86. data/spec/models/author_detail_spec.rb +66 -0
  87. data/spec/models/author_spec.rb +60 -0
  88. data/spec/models/dai_point_spec.rb +48 -0
  89. data/spec/models/dataset_detail_spec.rb +48 -0
  90. data/spec/models/dataset_spec.rb +96 -0
  91. data/spec/models/envelope_spec.rb +82 -0
  92. data/spec/models/error_spec.rb +60 -0
  93. data/spec/models/event_spec.rb +72 -0
  94. data/spec/models/get_author200_response_spec.rb +82 -0
  95. data/spec/models/get_dataset200_response_spec.rb +82 -0
  96. data/spec/models/get_index200_response_spec.rb +82 -0
  97. data/spec/models/get_method200_response_spec.rb +82 -0
  98. data/spec/models/get_model200_response_spec.rb +82 -0
  99. data/spec/models/index_detail_spec.rb +104 -0
  100. data/spec/models/index_spec.rb +98 -0
  101. data/spec/models/list_authors200_response_spec.rb +82 -0
  102. data/spec/models/list_datasets200_response_spec.rb +82 -0
  103. data/spec/models/list_indices200_response_spec.rb +82 -0
  104. data/spec/models/list_methods200_response_spec.rb +82 -0
  105. data/spec/models/list_models200_response_spec.rb +82 -0
  106. data/spec/models/list_timeline200_response_spec.rb +82 -0
  107. data/spec/models/method_detail_all_of_top_authors_spec.rb +42 -0
  108. data/spec/models/method_detail_spec.rb +88 -0
  109. data/spec/models/method_spec.rb +70 -0
  110. data/spec/models/model_detail_spec.rb +66 -0
  111. data/spec/models/model_summary_spec.rb +108 -0
  112. data/spec/models/passport_spec.rb +48 -0
  113. data/spec/spec_helper.rb +111 -0
  114. metadata +196 -16
@@ -0,0 +1,169 @@
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
+ # The full dataset record, plus files and the passport when one exists.
18
+ class DatasetDetail < ApiModelBase
19
+ attr_accessor :id
20
+
21
+ attr_accessor :files
22
+
23
+ attr_accessor :passport
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'id' => :'id',
29
+ :'files' => :'files',
30
+ :'passport' => :'passport'
31
+ }
32
+ end
33
+
34
+ # Returns attribute mapping this model knows about
35
+ def self.acceptable_attribute_map
36
+ attribute_map
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ acceptable_attribute_map.values
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'id' => :'String',
48
+ :'files' => :'Array<Object>',
49
+ :'passport' => :'Passport'
50
+ }
51
+ end
52
+
53
+ # List of attributes with nullable: true
54
+ def self.openapi_nullable
55
+ Set.new([
56
+ :'passport'
57
+ ])
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param [Hash] attributes Model attributes in the form of hash
62
+ def initialize(attributes = {})
63
+ if (!attributes.is_a?(Hash))
64
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Abliteration::DatasetDetail` initialize method"
65
+ end
66
+
67
+ # check to see if the attribute exists and convert string to symbol for hash key
68
+ acceptable_attribute_map = self.class.acceptable_attribute_map
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!acceptable_attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Abliteration::DatasetDetail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'id')
77
+ self.id = attributes[:'id']
78
+ end
79
+
80
+ if attributes.key?(:'files')
81
+ if (value = attributes[:'files']).is_a?(Array)
82
+ self.files = value
83
+ end
84
+ end
85
+
86
+ if attributes.key?(:'passport')
87
+ self.passport = attributes[:'passport']
88
+ end
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properties with the reasons
93
+ def list_invalid_properties
94
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
95
+ invalid_properties = Array.new
96
+ invalid_properties
97
+ end
98
+
99
+ # Check to see if the all the properties in the model are valid
100
+ # @return true if the model is valid
101
+ def valid?
102
+ warn '[DEPRECATED] the `valid?` method is obsolete'
103
+ true
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param [Object] Object to be compared
108
+ def ==(o)
109
+ return true if self.equal?(o)
110
+ self.class == o.class &&
111
+ id == o.id &&
112
+ files == o.files &&
113
+ passport == o.passport
114
+ end
115
+
116
+ # @see the `==` method
117
+ # @param [Object] Object to be compared
118
+ def eql?(o)
119
+ self == o
120
+ end
121
+
122
+ # Calculates hash code according to all attributes.
123
+ # @return [Integer] Hash code
124
+ def hash
125
+ [id, files, passport].hash
126
+ end
127
+
128
+ # Builds the object from hash
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ # @return [Object] Returns the model itself
131
+ def self.build_from_hash(attributes)
132
+ return nil unless attributes.is_a?(Hash)
133
+ attributes = attributes.transform_keys(&:to_sym)
134
+ transformed_hash = {}
135
+ openapi_types.each_pair do |key, type|
136
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
137
+ transformed_hash["#{key}"] = nil
138
+ elsif type =~ /\AArray<(.*)>/i
139
+ # check to ensure the input is an array given that the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[attribute_map[key]].is_a?(Array)
142
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
143
+ end
144
+ elsif !attributes[attribute_map[key]].nil?
145
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
146
+ end
147
+ end
148
+ new(transformed_hash)
149
+ end
150
+
151
+ # Returns the object in the form of hash
152
+ # @return [Hash] Returns the object in the form of hash
153
+ def to_hash
154
+ hash = {}
155
+ self.class.attribute_map.each_pair do |attr, param|
156
+ value = self.send(attr)
157
+ if value.nil?
158
+ is_nullable = self.class.openapi_nullable.include?(attr)
159
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
160
+ end
161
+
162
+ hash[param] = _to_hash(value)
163
+ end
164
+ hash
165
+ end
166
+
167
+ end
168
+
169
+ end
@@ -0,0 +1,364 @@
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 Envelope < ApiModelBase
18
+ # The payload. An array on list routes, an object on single-entity routes.
19
+ attr_accessor :data
20
+
21
+ # Credits this call costs.
22
+ attr_accessor :cost
23
+
24
+ # Wallet balance after the call. Unchanged while metering is preview.
25
+ attr_accessor :credits_remaining
26
+
27
+ # Ceiling for the current window. Also returned as X-RateLimit-Limit.
28
+ attr_accessor :rate_limit_limit
29
+
30
+ # Calls left in the current window for this key. Also returned as X-RateLimit-Remaining.
31
+ attr_accessor :rate_limit_remaining
32
+
33
+ # Unix seconds at which the window resets to full ceiling. Also returned as X-RateLimit-Reset.
34
+ attr_accessor :rate_limit_reset
35
+
36
+ # Whether cost was actually deducted.
37
+ attr_accessor :metering
38
+
39
+ # Also returned in the x-request-id header.
40
+ attr_accessor :request_id
41
+
42
+ class EnumAttributeValidator
43
+ attr_reader :datatype
44
+ attr_reader :allowable_values
45
+
46
+ def initialize(datatype, allowable_values)
47
+ @allowable_values = allowable_values.map do |value|
48
+ case datatype.to_s
49
+ when /Integer/i
50
+ value.to_i
51
+ when /Float/i
52
+ value.to_f
53
+ else
54
+ value
55
+ end
56
+ end
57
+ end
58
+
59
+ def valid?(value)
60
+ !value || allowable_values.include?(value)
61
+ end
62
+ end
63
+
64
+ # Attribute mapping from ruby-style variable name to JSON key.
65
+ def self.attribute_map
66
+ {
67
+ :'data' => :'data',
68
+ :'cost' => :'cost',
69
+ :'credits_remaining' => :'credits_remaining',
70
+ :'rate_limit_limit' => :'rate_limit_limit',
71
+ :'rate_limit_remaining' => :'rate_limit_remaining',
72
+ :'rate_limit_reset' => :'rate_limit_reset',
73
+ :'metering' => :'metering',
74
+ :'request_id' => :'request_id'
75
+ }
76
+ end
77
+
78
+ # Returns attribute mapping this model knows about
79
+ def self.acceptable_attribute_map
80
+ attribute_map
81
+ end
82
+
83
+ # Returns all the JSON keys this model knows about
84
+ def self.acceptable_attributes
85
+ acceptable_attribute_map.values
86
+ end
87
+
88
+ # Attribute type mapping.
89
+ def self.openapi_types
90
+ {
91
+ :'data' => :'Object',
92
+ :'cost' => :'Integer',
93
+ :'credits_remaining' => :'Integer',
94
+ :'rate_limit_limit' => :'Integer',
95
+ :'rate_limit_remaining' => :'Integer',
96
+ :'rate_limit_reset' => :'Integer',
97
+ :'metering' => :'String',
98
+ :'request_id' => :'String'
99
+ }
100
+ end
101
+
102
+ # List of attributes with nullable: true
103
+ def self.openapi_nullable
104
+ Set.new([
105
+ :'data',
106
+ ])
107
+ end
108
+
109
+ # Initializes the object
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ def initialize(attributes = {})
112
+ if (!attributes.is_a?(Hash))
113
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Abliteration::Envelope` initialize method"
114
+ end
115
+
116
+ # check to see if the attribute exists and convert string to symbol for hash key
117
+ acceptable_attribute_map = self.class.acceptable_attribute_map
118
+ attributes = attributes.each_with_object({}) { |(k, v), h|
119
+ if (!acceptable_attribute_map.key?(k.to_sym))
120
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Abliteration::Envelope`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
121
+ end
122
+ h[k.to_sym] = v
123
+ }
124
+
125
+ if attributes.key?(:'data')
126
+ self.data = attributes[:'data']
127
+ else
128
+ self.data = nil
129
+ end
130
+
131
+ if attributes.key?(:'cost')
132
+ self.cost = attributes[:'cost']
133
+ else
134
+ self.cost = nil
135
+ end
136
+
137
+ if attributes.key?(:'credits_remaining')
138
+ self.credits_remaining = attributes[:'credits_remaining']
139
+ else
140
+ self.credits_remaining = nil
141
+ end
142
+
143
+ if attributes.key?(:'rate_limit_limit')
144
+ self.rate_limit_limit = attributes[:'rate_limit_limit']
145
+ else
146
+ self.rate_limit_limit = nil
147
+ end
148
+
149
+ if attributes.key?(:'rate_limit_remaining')
150
+ self.rate_limit_remaining = attributes[:'rate_limit_remaining']
151
+ else
152
+ self.rate_limit_remaining = nil
153
+ end
154
+
155
+ if attributes.key?(:'rate_limit_reset')
156
+ self.rate_limit_reset = attributes[:'rate_limit_reset']
157
+ else
158
+ self.rate_limit_reset = nil
159
+ end
160
+
161
+ if attributes.key?(:'metering')
162
+ self.metering = attributes[:'metering']
163
+ else
164
+ self.metering = nil
165
+ end
166
+
167
+ if attributes.key?(:'request_id')
168
+ self.request_id = attributes[:'request_id']
169
+ else
170
+ self.request_id = nil
171
+ end
172
+ end
173
+
174
+ # Show invalid properties with the reasons. Usually used together with valid?
175
+ # @return Array for valid properties with the reasons
176
+ def list_invalid_properties
177
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
178
+ invalid_properties = Array.new
179
+ if @cost.nil?
180
+ invalid_properties.push('invalid value for "cost", cost cannot be nil.')
181
+ end
182
+
183
+ if @credits_remaining.nil?
184
+ invalid_properties.push('invalid value for "credits_remaining", credits_remaining cannot be nil.')
185
+ end
186
+
187
+ if @rate_limit_limit.nil?
188
+ invalid_properties.push('invalid value for "rate_limit_limit", rate_limit_limit cannot be nil.')
189
+ end
190
+
191
+ if @rate_limit_remaining.nil?
192
+ invalid_properties.push('invalid value for "rate_limit_remaining", rate_limit_remaining cannot be nil.')
193
+ end
194
+
195
+ if @rate_limit_reset.nil?
196
+ invalid_properties.push('invalid value for "rate_limit_reset", rate_limit_reset cannot be nil.')
197
+ end
198
+
199
+ if @metering.nil?
200
+ invalid_properties.push('invalid value for "metering", metering cannot be nil.')
201
+ end
202
+
203
+ if @request_id.nil?
204
+ invalid_properties.push('invalid value for "request_id", request_id cannot be nil.')
205
+ end
206
+
207
+ invalid_properties
208
+ end
209
+
210
+ # Check to see if the all the properties in the model are valid
211
+ # @return true if the model is valid
212
+ def valid?
213
+ warn '[DEPRECATED] the `valid?` method is obsolete'
214
+ return false if @cost.nil?
215
+ return false if @credits_remaining.nil?
216
+ return false if @rate_limit_limit.nil?
217
+ return false if @rate_limit_remaining.nil?
218
+ return false if @rate_limit_reset.nil?
219
+ return false if @metering.nil?
220
+ metering_validator = EnumAttributeValidator.new('String', ["preview", "billed"])
221
+ return false unless metering_validator.valid?(@metering)
222
+ return false if @request_id.nil?
223
+ true
224
+ end
225
+
226
+ # Custom attribute writer method with validation
227
+ # @param [Object] cost Value to be assigned
228
+ def cost=(cost)
229
+ if cost.nil?
230
+ fail ArgumentError, 'cost cannot be nil'
231
+ end
232
+
233
+ @cost = cost
234
+ end
235
+
236
+ # Custom attribute writer method with validation
237
+ # @param [Object] credits_remaining Value to be assigned
238
+ def credits_remaining=(credits_remaining)
239
+ if credits_remaining.nil?
240
+ fail ArgumentError, 'credits_remaining cannot be nil'
241
+ end
242
+
243
+ @credits_remaining = credits_remaining
244
+ end
245
+
246
+ # Custom attribute writer method with validation
247
+ # @param [Object] rate_limit_limit Value to be assigned
248
+ def rate_limit_limit=(rate_limit_limit)
249
+ if rate_limit_limit.nil?
250
+ fail ArgumentError, 'rate_limit_limit cannot be nil'
251
+ end
252
+
253
+ @rate_limit_limit = rate_limit_limit
254
+ end
255
+
256
+ # Custom attribute writer method with validation
257
+ # @param [Object] rate_limit_remaining Value to be assigned
258
+ def rate_limit_remaining=(rate_limit_remaining)
259
+ if rate_limit_remaining.nil?
260
+ fail ArgumentError, 'rate_limit_remaining cannot be nil'
261
+ end
262
+
263
+ @rate_limit_remaining = rate_limit_remaining
264
+ end
265
+
266
+ # Custom attribute writer method with validation
267
+ # @param [Object] rate_limit_reset Value to be assigned
268
+ def rate_limit_reset=(rate_limit_reset)
269
+ if rate_limit_reset.nil?
270
+ fail ArgumentError, 'rate_limit_reset cannot be nil'
271
+ end
272
+
273
+ @rate_limit_reset = rate_limit_reset
274
+ end
275
+
276
+ # Custom attribute writer method checking allowed values (enum).
277
+ # @param [Object] metering Object to be assigned
278
+ def metering=(metering)
279
+ validator = EnumAttributeValidator.new('String', ["preview", "billed"])
280
+ unless validator.valid?(metering)
281
+ fail ArgumentError, "invalid value for \"metering\", must be one of #{validator.allowable_values}."
282
+ end
283
+ @metering = metering
284
+ end
285
+
286
+ # Custom attribute writer method with validation
287
+ # @param [Object] request_id Value to be assigned
288
+ def request_id=(request_id)
289
+ if request_id.nil?
290
+ fail ArgumentError, 'request_id cannot be nil'
291
+ end
292
+
293
+ @request_id = request_id
294
+ end
295
+
296
+ # Checks equality by comparing each attribute.
297
+ # @param [Object] Object to be compared
298
+ def ==(o)
299
+ return true if self.equal?(o)
300
+ self.class == o.class &&
301
+ data == o.data &&
302
+ cost == o.cost &&
303
+ credits_remaining == o.credits_remaining &&
304
+ rate_limit_limit == o.rate_limit_limit &&
305
+ rate_limit_remaining == o.rate_limit_remaining &&
306
+ rate_limit_reset == o.rate_limit_reset &&
307
+ metering == o.metering &&
308
+ request_id == o.request_id
309
+ end
310
+
311
+ # @see the `==` method
312
+ # @param [Object] Object to be compared
313
+ def eql?(o)
314
+ self == o
315
+ end
316
+
317
+ # Calculates hash code according to all attributes.
318
+ # @return [Integer] Hash code
319
+ def hash
320
+ [data, cost, credits_remaining, rate_limit_limit, rate_limit_remaining, rate_limit_reset, metering, request_id].hash
321
+ end
322
+
323
+ # Builds the object from hash
324
+ # @param [Hash] attributes Model attributes in the form of hash
325
+ # @return [Object] Returns the model itself
326
+ def self.build_from_hash(attributes)
327
+ return nil unless attributes.is_a?(Hash)
328
+ attributes = attributes.transform_keys(&:to_sym)
329
+ transformed_hash = {}
330
+ openapi_types.each_pair do |key, type|
331
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
332
+ transformed_hash["#{key}"] = nil
333
+ elsif type =~ /\AArray<(.*)>/i
334
+ # check to ensure the input is an array given that the attribute
335
+ # is documented as an array but the input is not
336
+ if attributes[attribute_map[key]].is_a?(Array)
337
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
338
+ end
339
+ elsif !attributes[attribute_map[key]].nil?
340
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
341
+ end
342
+ end
343
+ new(transformed_hash)
344
+ end
345
+
346
+ # Returns the object in the form of hash
347
+ # @return [Hash] Returns the object in the form of hash
348
+ def to_hash
349
+ hash = {}
350
+ self.class.attribute_map.each_pair do |attr, param|
351
+ value = self.send(attr)
352
+ if value.nil?
353
+ is_nullable = self.class.openapi_nullable.include?(attr)
354
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
355
+ end
356
+
357
+ hash[param] = _to_hash(value)
358
+ end
359
+ hash
360
+ end
361
+
362
+ end
363
+
364
+ end