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,201 @@
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 AuthorDetail < ApiModelBase
18
+ attr_accessor :author
19
+
20
+ attr_accessor :total_models
21
+
22
+ attr_accessor :total_downloads
23
+
24
+ attr_accessor :total_likes
25
+
26
+ attr_accessor :first_seen_at
27
+
28
+ attr_accessor :models
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'author' => :'author',
34
+ :'total_models' => :'total_models',
35
+ :'total_downloads' => :'total_downloads',
36
+ :'total_likes' => :'total_likes',
37
+ :'first_seen_at' => :'first_seen_at',
38
+ :'models' => :'models'
39
+ }
40
+ end
41
+
42
+ # Returns attribute mapping this model knows about
43
+ def self.acceptable_attribute_map
44
+ attribute_map
45
+ end
46
+
47
+ # Returns all the JSON keys this model knows about
48
+ def self.acceptable_attributes
49
+ acceptable_attribute_map.values
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.openapi_types
54
+ {
55
+ :'author' => :'String',
56
+ :'total_models' => :'Integer',
57
+ :'total_downloads' => :'Integer',
58
+ :'total_likes' => :'Integer',
59
+ :'first_seen_at' => :'String',
60
+ :'models' => :'Array<ModelSummary>'
61
+ }
62
+ end
63
+
64
+ # List of attributes with nullable: true
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ ])
68
+ end
69
+
70
+ # List of class defined in allOf (OpenAPI v3)
71
+ def self.openapi_all_of
72
+ [
73
+ :'Author'
74
+ ]
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Abliteration::AuthorDetail` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ acceptable_attribute_map = self.class.acceptable_attribute_map
86
+ attributes = attributes.each_with_object({}) { |(k, v), h|
87
+ if (!acceptable_attribute_map.key?(k.to_sym))
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Abliteration::AuthorDetail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
89
+ end
90
+ h[k.to_sym] = v
91
+ }
92
+
93
+ if attributes.key?(:'author')
94
+ self.author = attributes[:'author']
95
+ end
96
+
97
+ if attributes.key?(:'total_models')
98
+ self.total_models = attributes[:'total_models']
99
+ end
100
+
101
+ if attributes.key?(:'total_downloads')
102
+ self.total_downloads = attributes[:'total_downloads']
103
+ end
104
+
105
+ if attributes.key?(:'total_likes')
106
+ self.total_likes = attributes[:'total_likes']
107
+ end
108
+
109
+ if attributes.key?(:'first_seen_at')
110
+ self.first_seen_at = attributes[:'first_seen_at']
111
+ end
112
+
113
+ if attributes.key?(:'models')
114
+ if (value = attributes[:'models']).is_a?(Array)
115
+ self.models = value
116
+ end
117
+ end
118
+ end
119
+
120
+ # Show invalid properties with the reasons. Usually used together with valid?
121
+ # @return Array for valid properties with the reasons
122
+ def list_invalid_properties
123
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
124
+ invalid_properties = Array.new
125
+ invalid_properties
126
+ end
127
+
128
+ # Check to see if the all the properties in the model are valid
129
+ # @return true if the model is valid
130
+ def valid?
131
+ warn '[DEPRECATED] the `valid?` method is obsolete'
132
+ true
133
+ end
134
+
135
+ # Checks equality by comparing each attribute.
136
+ # @param [Object] Object to be compared
137
+ def ==(o)
138
+ return true if self.equal?(o)
139
+ self.class == o.class &&
140
+ author == o.author &&
141
+ total_models == o.total_models &&
142
+ total_downloads == o.total_downloads &&
143
+ total_likes == o.total_likes &&
144
+ first_seen_at == o.first_seen_at &&
145
+ models == o.models
146
+ end
147
+
148
+ # @see the `==` method
149
+ # @param [Object] Object to be compared
150
+ def eql?(o)
151
+ self == o
152
+ end
153
+
154
+ # Calculates hash code according to all attributes.
155
+ # @return [Integer] Hash code
156
+ def hash
157
+ [author, total_models, total_downloads, total_likes, first_seen_at, models].hash
158
+ end
159
+
160
+ # Builds the object from hash
161
+ # @param [Hash] attributes Model attributes in the form of hash
162
+ # @return [Object] Returns the model itself
163
+ def self.build_from_hash(attributes)
164
+ return nil unless attributes.is_a?(Hash)
165
+ attributes = attributes.transform_keys(&:to_sym)
166
+ transformed_hash = {}
167
+ openapi_types.each_pair do |key, type|
168
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
169
+ transformed_hash["#{key}"] = nil
170
+ elsif type =~ /\AArray<(.*)>/i
171
+ # check to ensure the input is an array given that the attribute
172
+ # is documented as an array but the input is not
173
+ if attributes[attribute_map[key]].is_a?(Array)
174
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
175
+ end
176
+ elsif !attributes[attribute_map[key]].nil?
177
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
178
+ end
179
+ end
180
+ new(transformed_hash)
181
+ end
182
+
183
+ # Returns the object in the form of hash
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_hash
186
+ hash = {}
187
+ self.class.attribute_map.each_pair do |attr, param|
188
+ value = self.send(attr)
189
+ if value.nil?
190
+ is_nullable = self.class.openapi_nullable.include?(attr)
191
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
192
+ end
193
+
194
+ hash[param] = _to_hash(value)
195
+ end
196
+ hash
197
+ end
198
+
199
+ end
200
+
201
+ end
@@ -0,0 +1,165 @@
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 DaiPoint < ApiModelBase
18
+ attr_accessor :month
19
+
20
+ attr_accessor :weighted_dai_pct
21
+
22
+ attr_accessor :bases_included
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'month' => :'month',
28
+ :'weighted_dai_pct' => :'weighted_dai_pct',
29
+ :'bases_included' => :'bases_included'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'month' => :'String',
47
+ :'weighted_dai_pct' => :'Float',
48
+ :'bases_included' => :'Integer'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Abliteration::DaiPoint` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ acceptable_attribute_map = self.class.acceptable_attribute_map
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!acceptable_attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Abliteration::DaiPoint`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'month')
75
+ self.month = attributes[:'month']
76
+ end
77
+
78
+ if attributes.key?(:'weighted_dai_pct')
79
+ self.weighted_dai_pct = attributes[:'weighted_dai_pct']
80
+ end
81
+
82
+ if attributes.key?(:'bases_included')
83
+ self.bases_included = attributes[:'bases_included']
84
+ end
85
+ end
86
+
87
+ # Show invalid properties with the reasons. Usually used together with valid?
88
+ # @return Array for valid properties with the reasons
89
+ def list_invalid_properties
90
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
91
+ invalid_properties = Array.new
92
+ invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ warn '[DEPRECATED] the `valid?` method is obsolete'
99
+ true
100
+ end
101
+
102
+ # Checks equality by comparing each attribute.
103
+ # @param [Object] Object to be compared
104
+ def ==(o)
105
+ return true if self.equal?(o)
106
+ self.class == o.class &&
107
+ month == o.month &&
108
+ weighted_dai_pct == o.weighted_dai_pct &&
109
+ bases_included == o.bases_included
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ def hash
121
+ [month, weighted_dai_pct, bases_included].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def self.build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ attributes = attributes.transform_keys(&:to_sym)
130
+ transformed_hash = {}
131
+ openapi_types.each_pair do |key, type|
132
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = nil
134
+ elsif type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[attribute_map[key]].is_a?(Array)
138
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
139
+ end
140
+ elsif !attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
142
+ end
143
+ end
144
+ new(transformed_hash)
145
+ end
146
+
147
+ # Returns the object in the form of hash
148
+ # @return [Hash] Returns the object in the form of hash
149
+ def to_hash
150
+ hash = {}
151
+ self.class.attribute_map.each_pair do |attr, param|
152
+ value = self.send(attr)
153
+ if value.nil?
154
+ is_nullable = self.class.openapi_nullable.include?(attr)
155
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
156
+ end
157
+
158
+ hash[param] = _to_hash(value)
159
+ end
160
+ hash
161
+ end
162
+
163
+ end
164
+
165
+ end
@@ -0,0 +1,247 @@
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 Dataset < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :author
21
+
22
+ attr_accessor :slug
23
+
24
+ attr_accessor :category
25
+
26
+ attr_accessor :license
27
+
28
+ attr_accessor :downloads
29
+
30
+ attr_accessor :downloads_all
31
+
32
+ attr_accessor :likes
33
+
34
+ attr_accessor :gated
35
+
36
+ attr_accessor :created_at
37
+
38
+ attr_accessor :first_seen_at
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'id' => :'id',
44
+ :'author' => :'author',
45
+ :'slug' => :'slug',
46
+ :'category' => :'category',
47
+ :'license' => :'license',
48
+ :'downloads' => :'downloads',
49
+ :'downloads_all' => :'downloads_all',
50
+ :'likes' => :'likes',
51
+ :'gated' => :'gated',
52
+ :'created_at' => :'created_at',
53
+ :'first_seen_at' => :'first_seen_at'
54
+ }
55
+ end
56
+
57
+ # Returns attribute mapping this model knows about
58
+ def self.acceptable_attribute_map
59
+ attribute_map
60
+ end
61
+
62
+ # Returns all the JSON keys this model knows about
63
+ def self.acceptable_attributes
64
+ acceptable_attribute_map.values
65
+ end
66
+
67
+ # Attribute type mapping.
68
+ def self.openapi_types
69
+ {
70
+ :'id' => :'String',
71
+ :'author' => :'String',
72
+ :'slug' => :'String',
73
+ :'category' => :'String',
74
+ :'license' => :'String',
75
+ :'downloads' => :'Integer',
76
+ :'downloads_all' => :'Integer',
77
+ :'likes' => :'Integer',
78
+ :'gated' => :'Integer',
79
+ :'created_at' => :'String',
80
+ :'first_seen_at' => :'String'
81
+ }
82
+ end
83
+
84
+ # List of attributes with nullable: true
85
+ def self.openapi_nullable
86
+ Set.new([
87
+ :'author',
88
+ :'slug',
89
+ :'category',
90
+ :'license',
91
+ :'downloads',
92
+ :'downloads_all',
93
+ :'likes',
94
+ :'gated',
95
+ :'created_at',
96
+ :'first_seen_at'
97
+ ])
98
+ end
99
+
100
+ # Initializes the object
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ def initialize(attributes = {})
103
+ if (!attributes.is_a?(Hash))
104
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Abliteration::Dataset` initialize method"
105
+ end
106
+
107
+ # check to see if the attribute exists and convert string to symbol for hash key
108
+ acceptable_attribute_map = self.class.acceptable_attribute_map
109
+ attributes = attributes.each_with_object({}) { |(k, v), h|
110
+ if (!acceptable_attribute_map.key?(k.to_sym))
111
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Abliteration::Dataset`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
112
+ end
113
+ h[k.to_sym] = v
114
+ }
115
+
116
+ if attributes.key?(:'id')
117
+ self.id = attributes[:'id']
118
+ end
119
+
120
+ if attributes.key?(:'author')
121
+ self.author = attributes[:'author']
122
+ end
123
+
124
+ if attributes.key?(:'slug')
125
+ self.slug = attributes[:'slug']
126
+ end
127
+
128
+ if attributes.key?(:'category')
129
+ self.category = attributes[:'category']
130
+ end
131
+
132
+ if attributes.key?(:'license')
133
+ self.license = attributes[:'license']
134
+ end
135
+
136
+ if attributes.key?(:'downloads')
137
+ self.downloads = attributes[:'downloads']
138
+ end
139
+
140
+ if attributes.key?(:'downloads_all')
141
+ self.downloads_all = attributes[:'downloads_all']
142
+ end
143
+
144
+ if attributes.key?(:'likes')
145
+ self.likes = attributes[:'likes']
146
+ end
147
+
148
+ if attributes.key?(:'gated')
149
+ self.gated = attributes[:'gated']
150
+ end
151
+
152
+ if attributes.key?(:'created_at')
153
+ self.created_at = attributes[:'created_at']
154
+ end
155
+
156
+ if attributes.key?(:'first_seen_at')
157
+ self.first_seen_at = attributes[:'first_seen_at']
158
+ end
159
+ end
160
+
161
+ # Show invalid properties with the reasons. Usually used together with valid?
162
+ # @return Array for valid properties with the reasons
163
+ def list_invalid_properties
164
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
165
+ invalid_properties = Array.new
166
+ invalid_properties
167
+ end
168
+
169
+ # Check to see if the all the properties in the model are valid
170
+ # @return true if the model is valid
171
+ def valid?
172
+ warn '[DEPRECATED] the `valid?` method is obsolete'
173
+ true
174
+ end
175
+
176
+ # Checks equality by comparing each attribute.
177
+ # @param [Object] Object to be compared
178
+ def ==(o)
179
+ return true if self.equal?(o)
180
+ self.class == o.class &&
181
+ id == o.id &&
182
+ author == o.author &&
183
+ slug == o.slug &&
184
+ category == o.category &&
185
+ license == o.license &&
186
+ downloads == o.downloads &&
187
+ downloads_all == o.downloads_all &&
188
+ likes == o.likes &&
189
+ gated == o.gated &&
190
+ created_at == o.created_at &&
191
+ first_seen_at == o.first_seen_at
192
+ end
193
+
194
+ # @see the `==` method
195
+ # @param [Object] Object to be compared
196
+ def eql?(o)
197
+ self == o
198
+ end
199
+
200
+ # Calculates hash code according to all attributes.
201
+ # @return [Integer] Hash code
202
+ def hash
203
+ [id, author, slug, category, license, downloads, downloads_all, likes, gated, created_at, first_seen_at].hash
204
+ end
205
+
206
+ # Builds the object from hash
207
+ # @param [Hash] attributes Model attributes in the form of hash
208
+ # @return [Object] Returns the model itself
209
+ def self.build_from_hash(attributes)
210
+ return nil unless attributes.is_a?(Hash)
211
+ attributes = attributes.transform_keys(&:to_sym)
212
+ transformed_hash = {}
213
+ openapi_types.each_pair do |key, type|
214
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
215
+ transformed_hash["#{key}"] = nil
216
+ elsif type =~ /\AArray<(.*)>/i
217
+ # check to ensure the input is an array given that the attribute
218
+ # is documented as an array but the input is not
219
+ if attributes[attribute_map[key]].is_a?(Array)
220
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
221
+ end
222
+ elsif !attributes[attribute_map[key]].nil?
223
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
224
+ end
225
+ end
226
+ new(transformed_hash)
227
+ end
228
+
229
+ # Returns the object in the form of hash
230
+ # @return [Hash] Returns the object in the form of hash
231
+ def to_hash
232
+ hash = {}
233
+ self.class.attribute_map.each_pair do |attr, param|
234
+ value = self.send(attr)
235
+ if value.nil?
236
+ is_nullable = self.class.openapi_nullable.include?(attr)
237
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
238
+ end
239
+
240
+ hash[param] = _to_hash(value)
241
+ end
242
+ hash
243
+ end
244
+
245
+ end
246
+
247
+ end