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,265 @@
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 MethodDetail < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :label
21
+
22
+ attr_accessor :category
23
+
24
+ attr_accessor :wiki_slug
25
+
26
+ attr_accessor :model_count
27
+
28
+ attr_accessor :total_downloads
29
+
30
+ attr_accessor :wiki_url
31
+
32
+ attr_accessor :top_authors
33
+
34
+ attr_accessor :sample_models
35
+
36
+ class EnumAttributeValidator
37
+ attr_reader :datatype
38
+ attr_reader :allowable_values
39
+
40
+ def initialize(datatype, allowable_values)
41
+ @allowable_values = allowable_values.map do |value|
42
+ case datatype.to_s
43
+ when /Integer/i
44
+ value.to_i
45
+ when /Float/i
46
+ value.to_f
47
+ else
48
+ value
49
+ end
50
+ end
51
+ end
52
+
53
+ def valid?(value)
54
+ !value || allowable_values.include?(value)
55
+ end
56
+ end
57
+
58
+ # Attribute mapping from ruby-style variable name to JSON key.
59
+ def self.attribute_map
60
+ {
61
+ :'id' => :'id',
62
+ :'label' => :'label',
63
+ :'category' => :'category',
64
+ :'wiki_slug' => :'wiki_slug',
65
+ :'model_count' => :'model_count',
66
+ :'total_downloads' => :'total_downloads',
67
+ :'wiki_url' => :'wiki_url',
68
+ :'top_authors' => :'top_authors',
69
+ :'sample_models' => :'sample_models'
70
+ }
71
+ end
72
+
73
+ # Returns attribute mapping this model knows about
74
+ def self.acceptable_attribute_map
75
+ attribute_map
76
+ end
77
+
78
+ # Returns all the JSON keys this model knows about
79
+ def self.acceptable_attributes
80
+ acceptable_attribute_map.values
81
+ end
82
+
83
+ # Attribute type mapping.
84
+ def self.openapi_types
85
+ {
86
+ :'id' => :'String',
87
+ :'label' => :'String',
88
+ :'category' => :'String',
89
+ :'wiki_slug' => :'String',
90
+ :'model_count' => :'Integer',
91
+ :'total_downloads' => :'Integer',
92
+ :'wiki_url' => :'String',
93
+ :'top_authors' => :'Array<MethodDetailAllOfTopAuthors>',
94
+ :'sample_models' => :'Array<ModelSummary>'
95
+ }
96
+ end
97
+
98
+ # List of attributes with nullable: true
99
+ def self.openapi_nullable
100
+ Set.new([
101
+ :'wiki_url',
102
+ ])
103
+ end
104
+
105
+ # List of class defined in allOf (OpenAPI v3)
106
+ def self.openapi_all_of
107
+ [
108
+ :'Method'
109
+ ]
110
+ end
111
+
112
+ # Initializes the object
113
+ # @param [Hash] attributes Model attributes in the form of hash
114
+ def initialize(attributes = {})
115
+ if (!attributes.is_a?(Hash))
116
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Abliteration::MethodDetail` initialize method"
117
+ end
118
+
119
+ # check to see if the attribute exists and convert string to symbol for hash key
120
+ acceptable_attribute_map = self.class.acceptable_attribute_map
121
+ attributes = attributes.each_with_object({}) { |(k, v), h|
122
+ if (!acceptable_attribute_map.key?(k.to_sym))
123
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Abliteration::MethodDetail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
124
+ end
125
+ h[k.to_sym] = v
126
+ }
127
+
128
+ if attributes.key?(:'id')
129
+ self.id = attributes[:'id']
130
+ end
131
+
132
+ if attributes.key?(:'label')
133
+ self.label = attributes[:'label']
134
+ end
135
+
136
+ if attributes.key?(:'category')
137
+ self.category = attributes[:'category']
138
+ end
139
+
140
+ if attributes.key?(:'wiki_slug')
141
+ self.wiki_slug = attributes[:'wiki_slug']
142
+ end
143
+
144
+ if attributes.key?(:'model_count')
145
+ self.model_count = attributes[:'model_count']
146
+ end
147
+
148
+ if attributes.key?(:'total_downloads')
149
+ self.total_downloads = attributes[:'total_downloads']
150
+ end
151
+
152
+ if attributes.key?(:'wiki_url')
153
+ self.wiki_url = attributes[:'wiki_url']
154
+ end
155
+
156
+ if attributes.key?(:'top_authors')
157
+ if (value = attributes[:'top_authors']).is_a?(Array)
158
+ self.top_authors = value
159
+ end
160
+ end
161
+
162
+ if attributes.key?(:'sample_models')
163
+ if (value = attributes[:'sample_models']).is_a?(Array)
164
+ self.sample_models = value
165
+ end
166
+ end
167
+ end
168
+
169
+ # Show invalid properties with the reasons. Usually used together with valid?
170
+ # @return Array for valid properties with the reasons
171
+ def list_invalid_properties
172
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
173
+ invalid_properties = Array.new
174
+ invalid_properties
175
+ end
176
+
177
+ # Check to see if the all the properties in the model are valid
178
+ # @return true if the model is valid
179
+ def valid?
180
+ warn '[DEPRECATED] the `valid?` method is obsolete'
181
+ category_validator = EnumAttributeValidator.new('String', ["original", "repackage", "merged", "unclassified"])
182
+ return false unless category_validator.valid?(@category)
183
+ true
184
+ end
185
+
186
+ # Custom attribute writer method checking allowed values (enum).
187
+ # @param [Object] category Object to be assigned
188
+ def category=(category)
189
+ validator = EnumAttributeValidator.new('String', ["original", "repackage", "merged", "unclassified"])
190
+ unless validator.valid?(category)
191
+ fail ArgumentError, "invalid value for \"category\", must be one of #{validator.allowable_values}."
192
+ end
193
+ @category = category
194
+ end
195
+
196
+ # Checks equality by comparing each attribute.
197
+ # @param [Object] Object to be compared
198
+ def ==(o)
199
+ return true if self.equal?(o)
200
+ self.class == o.class &&
201
+ id == o.id &&
202
+ label == o.label &&
203
+ category == o.category &&
204
+ wiki_slug == o.wiki_slug &&
205
+ model_count == o.model_count &&
206
+ total_downloads == o.total_downloads &&
207
+ wiki_url == o.wiki_url &&
208
+ top_authors == o.top_authors &&
209
+ sample_models == o.sample_models
210
+ end
211
+
212
+ # @see the `==` method
213
+ # @param [Object] Object to be compared
214
+ def eql?(o)
215
+ self == o
216
+ end
217
+
218
+ # Calculates hash code according to all attributes.
219
+ # @return [Integer] Hash code
220
+ def hash
221
+ [id, label, category, wiki_slug, model_count, total_downloads, wiki_url, top_authors, sample_models].hash
222
+ end
223
+
224
+ # Builds the object from hash
225
+ # @param [Hash] attributes Model attributes in the form of hash
226
+ # @return [Object] Returns the model itself
227
+ def self.build_from_hash(attributes)
228
+ return nil unless attributes.is_a?(Hash)
229
+ attributes = attributes.transform_keys(&:to_sym)
230
+ transformed_hash = {}
231
+ openapi_types.each_pair do |key, type|
232
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
233
+ transformed_hash["#{key}"] = nil
234
+ elsif type =~ /\AArray<(.*)>/i
235
+ # check to ensure the input is an array given that the attribute
236
+ # is documented as an array but the input is not
237
+ if attributes[attribute_map[key]].is_a?(Array)
238
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
239
+ end
240
+ elsif !attributes[attribute_map[key]].nil?
241
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
242
+ end
243
+ end
244
+ new(transformed_hash)
245
+ end
246
+
247
+ # Returns the object in the form of hash
248
+ # @return [Hash] Returns the object in the form of hash
249
+ def to_hash
250
+ hash = {}
251
+ self.class.attribute_map.each_pair do |attr, param|
252
+ value = self.send(attr)
253
+ if value.nil?
254
+ is_nullable = self.class.openapi_nullable.include?(attr)
255
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
256
+ end
257
+
258
+ hash[param] = _to_hash(value)
259
+ end
260
+ hash
261
+ end
262
+
263
+ end
264
+
265
+ end
@@ -0,0 +1,156 @@
1
+ =begin
2
+ #abliteration.org Public API
3
+
4
+ #Read access to the abliteration.org catalog: models and their method classification, alignment datasets and their passports, the M-code taxonomy, the four flagship indices and the curated field timeline. Every call is authenticated with a bearer key and metered in credits against the same wallet the Research Agent spends from. There is no free tier for machine traffic and no separate billing. Responses report `cost` and `credits_remaining` on every success. While `metering` reads `preview`, the cost shown is what the call will bill once metering is enabled and nothing is actually deducted; when it reads `billed`, it was.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Abliteration
17
+ class MethodDetailAllOfTopAuthors < ApiModelBase
18
+ attr_accessor :author
19
+
20
+ attr_accessor :count
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'author' => :'author',
26
+ :'count' => :'count'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'author' => :'String',
44
+ :'count' => :'Integer'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Abliteration::MethodDetailAllOfTopAuthors` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Abliteration::MethodDetailAllOfTopAuthors`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'author')
71
+ self.author = attributes[:'author']
72
+ end
73
+
74
+ if attributes.key?(:'count')
75
+ self.count = attributes[:'count']
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
83
+ invalid_properties = Array.new
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ warn '[DEPRECATED] the `valid?` method is obsolete'
91
+ true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ author == o.author &&
100
+ count == o.count
101
+ end
102
+
103
+ # @see the `==` method
104
+ # @param [Object] Object to be compared
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Integer] Hash code
111
+ def hash
112
+ [author, count].hash
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def self.build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ attributes = attributes.transform_keys(&:to_sym)
121
+ transformed_hash = {}
122
+ openapi_types.each_pair do |key, type|
123
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
124
+ transformed_hash["#{key}"] = nil
125
+ elsif type =~ /\AArray<(.*)>/i
126
+ # check to ensure the input is an array given that the attribute
127
+ # is documented as an array but the input is not
128
+ if attributes[attribute_map[key]].is_a?(Array)
129
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
130
+ end
131
+ elsif !attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
133
+ end
134
+ end
135
+ new(transformed_hash)
136
+ end
137
+
138
+ # Returns the object in the form of hash
139
+ # @return [Hash] Returns the object in the form of hash
140
+ def to_hash
141
+ hash = {}
142
+ self.class.attribute_map.each_pair do |attr, param|
143
+ value = self.send(attr)
144
+ if value.nil?
145
+ is_nullable = self.class.openapi_nullable.include?(attr)
146
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
147
+ end
148
+
149
+ hash[param] = _to_hash(value)
150
+ end
151
+ hash
152
+ end
153
+
154
+ end
155
+
156
+ end
@@ -0,0 +1,196 @@
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 catalog record, plus files, benchmarks and an author summary.
18
+ class ModelDetail < ApiModelBase
19
+ attr_accessor :id
20
+
21
+ attr_accessor :author
22
+
23
+ attr_accessor :name
24
+
25
+ attr_accessor :files
26
+
27
+ attr_accessor :benchmarks
28
+
29
+ attr_accessor :author_summary
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'id' => :'id',
35
+ :'author' => :'author',
36
+ :'name' => :'name',
37
+ :'files' => :'files',
38
+ :'benchmarks' => :'benchmarks',
39
+ :'author_summary' => :'author_summary'
40
+ }
41
+ end
42
+
43
+ # Returns attribute mapping this model knows about
44
+ def self.acceptable_attribute_map
45
+ attribute_map
46
+ end
47
+
48
+ # Returns all the JSON keys this model knows about
49
+ def self.acceptable_attributes
50
+ acceptable_attribute_map.values
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.openapi_types
55
+ {
56
+ :'id' => :'String',
57
+ :'author' => :'String',
58
+ :'name' => :'String',
59
+ :'files' => :'Array<Object>',
60
+ :'benchmarks' => :'Object',
61
+ :'author_summary' => :'Author'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ :'author_summary'
69
+ ])
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ if (!attributes.is_a?(Hash))
76
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Abliteration::ModelDetail` initialize method"
77
+ end
78
+
79
+ # check to see if the attribute exists and convert string to symbol for hash key
80
+ acceptable_attribute_map = self.class.acceptable_attribute_map
81
+ attributes = attributes.each_with_object({}) { |(k, v), h|
82
+ if (!acceptable_attribute_map.key?(k.to_sym))
83
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Abliteration::ModelDetail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
84
+ end
85
+ h[k.to_sym] = v
86
+ }
87
+
88
+ if attributes.key?(:'id')
89
+ self.id = attributes[:'id']
90
+ end
91
+
92
+ if attributes.key?(:'author')
93
+ self.author = attributes[:'author']
94
+ end
95
+
96
+ if attributes.key?(:'name')
97
+ self.name = attributes[:'name']
98
+ end
99
+
100
+ if attributes.key?(:'files')
101
+ if (value = attributes[:'files']).is_a?(Array)
102
+ self.files = value
103
+ end
104
+ end
105
+
106
+ if attributes.key?(:'benchmarks')
107
+ self.benchmarks = attributes[:'benchmarks']
108
+ end
109
+
110
+ if attributes.key?(:'author_summary')
111
+ self.author_summary = attributes[:'author_summary']
112
+ end
113
+ end
114
+
115
+ # Show invalid properties with the reasons. Usually used together with valid?
116
+ # @return Array for valid properties with the reasons
117
+ def list_invalid_properties
118
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
119
+ invalid_properties = Array.new
120
+ invalid_properties
121
+ end
122
+
123
+ # Check to see if the all the properties in the model are valid
124
+ # @return true if the model is valid
125
+ def valid?
126
+ warn '[DEPRECATED] the `valid?` method is obsolete'
127
+ true
128
+ end
129
+
130
+ # Checks equality by comparing each attribute.
131
+ # @param [Object] Object to be compared
132
+ def ==(o)
133
+ return true if self.equal?(o)
134
+ self.class == o.class &&
135
+ id == o.id &&
136
+ author == o.author &&
137
+ name == o.name &&
138
+ files == o.files &&
139
+ benchmarks == o.benchmarks &&
140
+ author_summary == o.author_summary
141
+ end
142
+
143
+ # @see the `==` method
144
+ # @param [Object] Object to be compared
145
+ def eql?(o)
146
+ self == o
147
+ end
148
+
149
+ # Calculates hash code according to all attributes.
150
+ # @return [Integer] Hash code
151
+ def hash
152
+ [id, author, name, files, benchmarks, author_summary].hash
153
+ end
154
+
155
+ # Builds the object from hash
156
+ # @param [Hash] attributes Model attributes in the form of hash
157
+ # @return [Object] Returns the model itself
158
+ def self.build_from_hash(attributes)
159
+ return nil unless attributes.is_a?(Hash)
160
+ attributes = attributes.transform_keys(&:to_sym)
161
+ transformed_hash = {}
162
+ openapi_types.each_pair do |key, type|
163
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
164
+ transformed_hash["#{key}"] = nil
165
+ elsif type =~ /\AArray<(.*)>/i
166
+ # check to ensure the input is an array given that the attribute
167
+ # is documented as an array but the input is not
168
+ if attributes[attribute_map[key]].is_a?(Array)
169
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
170
+ end
171
+ elsif !attributes[attribute_map[key]].nil?
172
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
173
+ end
174
+ end
175
+ new(transformed_hash)
176
+ end
177
+
178
+ # Returns the object in the form of hash
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_hash
181
+ hash = {}
182
+ self.class.attribute_map.each_pair do |attr, param|
183
+ value = self.send(attr)
184
+ if value.nil?
185
+ is_nullable = self.class.openapi_nullable.include?(attr)
186
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
187
+ end
188
+
189
+ hash[param] = _to_hash(value)
190
+ end
191
+ hash
192
+ end
193
+
194
+ end
195
+
196
+ end