cheminee 0.1.9 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +6 -5
- data/docs/DefaultApi.md +14 -8
- data/docs/StructureResponseError.md +18 -0
- data/docs/StructureSearchHit.md +26 -0
- data/lib/cheminee/api/default_api.rb +18 -12
- data/lib/cheminee/models/structure_response_error.rb +221 -0
- data/lib/cheminee/models/structure_search_hit.rb +281 -0
- data/lib/cheminee/version.rb +1 -1
- data/lib/cheminee.rb +2 -1
- data/pkg/cheminee-0.1.11.gem +0 -0
- data/spec/models/structure_response_error_spec.rb +36 -0
- data/spec/models/structure_search_hit_spec.rb +60 -0
- metadata +11 -3
- data/pkg/cheminee-0.1.9.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da3fea5c8532f2c03b773e8c378d76b9b863d63871d3a652005fb1ac4a5e42eb
|
4
|
+
data.tar.gz: ca8a3fcd161189d76446afff6972e23120b464a005f9626740dc0e709e48d68c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78b57e19442eb546e41d598065faa049817dca18c5486e95303824fa3acad26dd002ddef9f23c651afa190aacfde005bd1a20d0b749bd5fd32625d3e551912a7
|
7
|
+
data.tar.gz: 181bfc1ff46edc3e07321371d4b989cfab7b896820e10d421698e1b9eba14be43b63dda276d29b1803dd221d87d890c5bb3721860e055ef87f2bd1fd9ab2106f
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -7,7 +7,7 @@ Cheminée: The Chemical Structure Search Engine
|
|
7
7
|
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
8
8
|
|
9
9
|
- API version: 1.0
|
10
|
-
- Package version: 0.1.
|
10
|
+
- Package version: 0.1.11
|
11
11
|
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
12
12
|
For more information, please visit [https://github.com/rdkit-rs/cheminee](https://github.com/rdkit-rs/cheminee)
|
13
13
|
|
@@ -24,16 +24,16 @@ gem build cheminee.gemspec
|
|
24
24
|
Then either install the gem locally:
|
25
25
|
|
26
26
|
```shell
|
27
|
-
gem install ./cheminee-0.1.
|
27
|
+
gem install ./cheminee-0.1.11.gem
|
28
28
|
```
|
29
29
|
|
30
|
-
(for development, run `gem install --dev ./cheminee-0.1.
|
30
|
+
(for development, run `gem install --dev ./cheminee-0.1.11.gem` to install the development dependencies)
|
31
31
|
|
32
32
|
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
33
33
|
|
34
34
|
Finally add this to the Gemfile:
|
35
35
|
|
36
|
-
gem 'cheminee', '~> 0.1.
|
36
|
+
gem 'cheminee', '~> 0.1.11'
|
37
37
|
|
38
38
|
### Install from Git
|
39
39
|
|
@@ -98,7 +98,8 @@ Class | Method | HTTP request | Description
|
|
98
98
|
- [Cheminee::Schema](docs/Schema.md)
|
99
99
|
- [Cheminee::Smile](docs/Smile.md)
|
100
100
|
- [Cheminee::StandardizedSmile](docs/StandardizedSmile.md)
|
101
|
-
- [Cheminee::
|
101
|
+
- [Cheminee::StructureResponseError](docs/StructureResponseError.md)
|
102
|
+
- [Cheminee::StructureSearchHit](docs/StructureSearchHit.md)
|
102
103
|
|
103
104
|
|
104
105
|
## Documentation for Authorization
|
data/docs/DefaultApi.md
CHANGED
@@ -268,7 +268,7 @@ No authorization required
|
|
268
268
|
|
269
269
|
## v1_indexes_index_search_substructure_get
|
270
270
|
|
271
|
-
> <Array<
|
271
|
+
> <Array<StructureSearchHit>> v1_indexes_index_search_substructure_get(index, smile, opts)
|
272
272
|
|
273
273
|
Perform substructure search against index
|
274
274
|
|
@@ -280,11 +280,15 @@ require 'cheminee'
|
|
280
280
|
|
281
281
|
api_instance = Cheminee::DefaultApi.new
|
282
282
|
index = 'index_example' # String |
|
283
|
-
|
283
|
+
smile = 'smile_example' # String |
|
284
|
+
opts = {
|
285
|
+
result_limit: 56, # Integer |
|
286
|
+
tautomer_limit: 56 # Integer |
|
287
|
+
}
|
284
288
|
|
285
289
|
begin
|
286
290
|
# Perform substructure search against index
|
287
|
-
result = api_instance.v1_indexes_index_search_substructure_get(index,
|
291
|
+
result = api_instance.v1_indexes_index_search_substructure_get(index, smile, opts)
|
288
292
|
p result
|
289
293
|
rescue Cheminee::ApiError => e
|
290
294
|
puts "Error when calling DefaultApi->v1_indexes_index_search_substructure_get: #{e}"
|
@@ -295,15 +299,15 @@ end
|
|
295
299
|
|
296
300
|
This returns an Array which contains the response data, status code and headers.
|
297
301
|
|
298
|
-
> <Array(<Array<
|
302
|
+
> <Array(<Array<StructureSearchHit>>, Integer, Hash)> v1_indexes_index_search_substructure_get_with_http_info(index, smile, opts)
|
299
303
|
|
300
304
|
```ruby
|
301
305
|
begin
|
302
306
|
# Perform substructure search against index
|
303
|
-
data, status_code, headers = api_instance.v1_indexes_index_search_substructure_get_with_http_info(index,
|
307
|
+
data, status_code, headers = api_instance.v1_indexes_index_search_substructure_get_with_http_info(index, smile, opts)
|
304
308
|
p status_code # => 2xx
|
305
309
|
p headers # => { ... }
|
306
|
-
p data # => <Array<
|
310
|
+
p data # => <Array<StructureSearchHit>>
|
307
311
|
rescue Cheminee::ApiError => e
|
308
312
|
puts "Error when calling DefaultApi->v1_indexes_index_search_substructure_get_with_http_info: #{e}"
|
309
313
|
end
|
@@ -314,11 +318,13 @@ end
|
|
314
318
|
| Name | Type | Description | Notes |
|
315
319
|
| ---- | ---- | ----------- | ----- |
|
316
320
|
| **index** | **String** | | |
|
317
|
-
| **
|
321
|
+
| **smile** | **String** | | |
|
322
|
+
| **result_limit** | **Integer** | | [optional] |
|
323
|
+
| **tautomer_limit** | **Integer** | | [optional] |
|
318
324
|
|
319
325
|
### Return type
|
320
326
|
|
321
|
-
[**Array<
|
327
|
+
[**Array<StructureSearchHit>**](StructureSearchHit.md)
|
322
328
|
|
323
329
|
### Authorization
|
324
330
|
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# Cheminee::StructureResponseError
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **error** | **String** | | |
|
8
|
+
|
9
|
+
## Example
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'cheminee'
|
13
|
+
|
14
|
+
instance = Cheminee::StructureResponseError.new(
|
15
|
+
error: null
|
16
|
+
)
|
17
|
+
```
|
18
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# Cheminee::StructureSearchHit
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **extra_data** | **Object** | | |
|
8
|
+
| **smiles** | **String** | | |
|
9
|
+
| **score** | **Float** | | |
|
10
|
+
| **query** | **String** | | |
|
11
|
+
| **used_tautomers** | **Boolean** | | |
|
12
|
+
|
13
|
+
## Example
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
require 'cheminee'
|
17
|
+
|
18
|
+
instance = Cheminee::StructureSearchHit.new(
|
19
|
+
extra_data: null,
|
20
|
+
smiles: null,
|
21
|
+
score: null,
|
22
|
+
query: null,
|
23
|
+
used_tautomers: null
|
24
|
+
)
|
25
|
+
```
|
26
|
+
|
@@ -280,20 +280,24 @@ module Cheminee
|
|
280
280
|
|
281
281
|
# Perform substructure search against index
|
282
282
|
# @param index [String]
|
283
|
-
# @param
|
283
|
+
# @param smile [String]
|
284
284
|
# @param [Hash] opts the optional parameters
|
285
|
-
# @
|
286
|
-
|
287
|
-
|
285
|
+
# @option opts [Integer] :result_limit
|
286
|
+
# @option opts [Integer] :tautomer_limit
|
287
|
+
# @return [Array<StructureSearchHit>]
|
288
|
+
def v1_indexes_index_search_substructure_get(index, smile, opts = {})
|
289
|
+
data, _status_code, _headers = v1_indexes_index_search_substructure_get_with_http_info(index, smile, opts)
|
288
290
|
data
|
289
291
|
end
|
290
292
|
|
291
293
|
# Perform substructure search against index
|
292
294
|
# @param index [String]
|
293
|
-
# @param
|
295
|
+
# @param smile [String]
|
294
296
|
# @param [Hash] opts the optional parameters
|
295
|
-
# @
|
296
|
-
|
297
|
+
# @option opts [Integer] :result_limit
|
298
|
+
# @option opts [Integer] :tautomer_limit
|
299
|
+
# @return [Array<(Array<StructureSearchHit>, Integer, Hash)>] Array<StructureSearchHit> data, response status code and response headers
|
300
|
+
def v1_indexes_index_search_substructure_get_with_http_info(index, smile, opts = {})
|
297
301
|
if @api_client.config.debugging
|
298
302
|
@api_client.config.logger.debug 'Calling API: DefaultApi.v1_indexes_index_search_substructure_get ...'
|
299
303
|
end
|
@@ -301,16 +305,18 @@ module Cheminee
|
|
301
305
|
if @api_client.config.client_side_validation && index.nil?
|
302
306
|
fail ArgumentError, "Missing the required parameter 'index' when calling DefaultApi.v1_indexes_index_search_substructure_get"
|
303
307
|
end
|
304
|
-
# verify the required parameter '
|
305
|
-
if @api_client.config.client_side_validation &&
|
306
|
-
fail ArgumentError, "Missing the required parameter '
|
308
|
+
# verify the required parameter 'smile' is set
|
309
|
+
if @api_client.config.client_side_validation && smile.nil?
|
310
|
+
fail ArgumentError, "Missing the required parameter 'smile' when calling DefaultApi.v1_indexes_index_search_substructure_get"
|
307
311
|
end
|
308
312
|
# resource path
|
309
313
|
local_var_path = '/v1/indexes/{index}/search/substructure'.sub('{' + 'index' + '}', CGI.escape(index.to_s))
|
310
314
|
|
311
315
|
# query parameters
|
312
316
|
query_params = opts[:query_params] || {}
|
313
|
-
query_params[:'
|
317
|
+
query_params[:'smile'] = smile
|
318
|
+
query_params[:'result_limit'] = opts[:'result_limit'] if !opts[:'result_limit'].nil?
|
319
|
+
query_params[:'tautomer_limit'] = opts[:'tautomer_limit'] if !opts[:'tautomer_limit'].nil?
|
314
320
|
|
315
321
|
# header parameters
|
316
322
|
header_params = opts[:header_params] || {}
|
@@ -324,7 +330,7 @@ module Cheminee
|
|
324
330
|
post_body = opts[:debug_body]
|
325
331
|
|
326
332
|
# return_type
|
327
|
-
return_type = opts[:debug_return_type] || 'Array<
|
333
|
+
return_type = opts[:debug_return_type] || 'Array<StructureSearchHit>'
|
328
334
|
|
329
335
|
# auth_names
|
330
336
|
auth_names = opts[:debug_auth_names] || []
|
@@ -0,0 +1,221 @@
|
|
1
|
+
=begin
|
2
|
+
#Cheminée
|
3
|
+
|
4
|
+
#Cheminée: The Chemical Structure Search Engine
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 7.1.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Cheminee
|
17
|
+
class StructureResponseError
|
18
|
+
attr_accessor :error
|
19
|
+
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'error' => :'error'
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
# Returns all the JSON keys this model knows about
|
28
|
+
def self.acceptable_attributes
|
29
|
+
attribute_map.values
|
30
|
+
end
|
31
|
+
|
32
|
+
# Attribute type mapping.
|
33
|
+
def self.openapi_types
|
34
|
+
{
|
35
|
+
:'error' => :'String'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# List of attributes with nullable: true
|
40
|
+
def self.openapi_nullable
|
41
|
+
Set.new([
|
42
|
+
])
|
43
|
+
end
|
44
|
+
|
45
|
+
# Initializes the object
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
+
def initialize(attributes = {})
|
48
|
+
if (!attributes.is_a?(Hash))
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Cheminee::StructureResponseError` initialize method"
|
50
|
+
end
|
51
|
+
|
52
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
53
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Cheminee::StructureResponseError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
|
+
end
|
57
|
+
h[k.to_sym] = v
|
58
|
+
}
|
59
|
+
|
60
|
+
if attributes.key?(:'error')
|
61
|
+
self.error = attributes[:'error']
|
62
|
+
else
|
63
|
+
self.error = nil
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
68
|
+
# @return Array for valid properties with the reasons
|
69
|
+
def list_invalid_properties
|
70
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
71
|
+
invalid_properties = Array.new
|
72
|
+
if @error.nil?
|
73
|
+
invalid_properties.push('invalid value for "error", error cannot be nil.')
|
74
|
+
end
|
75
|
+
|
76
|
+
invalid_properties
|
77
|
+
end
|
78
|
+
|
79
|
+
# Check to see if the all the properties in the model are valid
|
80
|
+
# @return true if the model is valid
|
81
|
+
def valid?
|
82
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
83
|
+
return false if @error.nil?
|
84
|
+
true
|
85
|
+
end
|
86
|
+
|
87
|
+
# Checks equality by comparing each attribute.
|
88
|
+
# @param [Object] Object to be compared
|
89
|
+
def ==(o)
|
90
|
+
return true if self.equal?(o)
|
91
|
+
self.class == o.class &&
|
92
|
+
error == o.error
|
93
|
+
end
|
94
|
+
|
95
|
+
# @see the `==` method
|
96
|
+
# @param [Object] Object to be compared
|
97
|
+
def eql?(o)
|
98
|
+
self == o
|
99
|
+
end
|
100
|
+
|
101
|
+
# Calculates hash code according to all attributes.
|
102
|
+
# @return [Integer] Hash code
|
103
|
+
def hash
|
104
|
+
[error].hash
|
105
|
+
end
|
106
|
+
|
107
|
+
# Builds the object from hash
|
108
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
109
|
+
# @return [Object] Returns the model itself
|
110
|
+
def self.build_from_hash(attributes)
|
111
|
+
return nil unless attributes.is_a?(Hash)
|
112
|
+
attributes = attributes.transform_keys(&:to_sym)
|
113
|
+
transformed_hash = {}
|
114
|
+
openapi_types.each_pair do |key, type|
|
115
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
116
|
+
transformed_hash["#{key}"] = nil
|
117
|
+
elsif type =~ /\AArray<(.*)>/i
|
118
|
+
# check to ensure the input is an array given that the attribute
|
119
|
+
# is documented as an array but the input is not
|
120
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
121
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
122
|
+
end
|
123
|
+
elsif !attributes[attribute_map[key]].nil?
|
124
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
125
|
+
end
|
126
|
+
end
|
127
|
+
new(transformed_hash)
|
128
|
+
end
|
129
|
+
|
130
|
+
# Deserializes the data based on type
|
131
|
+
# @param string type Data type
|
132
|
+
# @param string value Value to be deserialized
|
133
|
+
# @return [Object] Deserialized data
|
134
|
+
def self._deserialize(type, value)
|
135
|
+
case type.to_sym
|
136
|
+
when :Time
|
137
|
+
Time.parse(value)
|
138
|
+
when :Date
|
139
|
+
Date.parse(value)
|
140
|
+
when :String
|
141
|
+
value.to_s
|
142
|
+
when :Integer
|
143
|
+
value.to_i
|
144
|
+
when :Float
|
145
|
+
value.to_f
|
146
|
+
when :Boolean
|
147
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
148
|
+
true
|
149
|
+
else
|
150
|
+
false
|
151
|
+
end
|
152
|
+
when :Object
|
153
|
+
# generic object (usually a Hash), return directly
|
154
|
+
value
|
155
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
156
|
+
inner_type = Regexp.last_match[:inner_type]
|
157
|
+
value.map { |v| _deserialize(inner_type, v) }
|
158
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
159
|
+
k_type = Regexp.last_match[:k_type]
|
160
|
+
v_type = Regexp.last_match[:v_type]
|
161
|
+
{}.tap do |hash|
|
162
|
+
value.each do |k, v|
|
163
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
else # model
|
167
|
+
# models (e.g. Pet) or oneOf
|
168
|
+
klass = Cheminee.const_get(type)
|
169
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
# Returns the string representation of the object
|
174
|
+
# @return [String] String presentation of the object
|
175
|
+
def to_s
|
176
|
+
to_hash.to_s
|
177
|
+
end
|
178
|
+
|
179
|
+
# to_body is an alias to to_hash (backward compatibility)
|
180
|
+
# @return [Hash] Returns the object in the form of hash
|
181
|
+
def to_body
|
182
|
+
to_hash
|
183
|
+
end
|
184
|
+
|
185
|
+
# Returns the object in the form of hash
|
186
|
+
# @return [Hash] Returns the object in the form of hash
|
187
|
+
def to_hash
|
188
|
+
hash = {}
|
189
|
+
self.class.attribute_map.each_pair do |attr, param|
|
190
|
+
value = self.send(attr)
|
191
|
+
if value.nil?
|
192
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
193
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
194
|
+
end
|
195
|
+
|
196
|
+
hash[param] = _to_hash(value)
|
197
|
+
end
|
198
|
+
hash
|
199
|
+
end
|
200
|
+
|
201
|
+
# Outputs non-array value in the form of hash
|
202
|
+
# For object, use to_hash. Otherwise, just return the value
|
203
|
+
# @param [Object] value Any valid value
|
204
|
+
# @return [Hash] Returns the value in the form of hash
|
205
|
+
def _to_hash(value)
|
206
|
+
if value.is_a?(Array)
|
207
|
+
value.compact.map { |v| _to_hash(v) }
|
208
|
+
elsif value.is_a?(Hash)
|
209
|
+
{}.tap do |hash|
|
210
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
211
|
+
end
|
212
|
+
elsif value.respond_to? :to_hash
|
213
|
+
value.to_hash
|
214
|
+
else
|
215
|
+
value
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
end
|
220
|
+
|
221
|
+
end
|
@@ -0,0 +1,281 @@
|
|
1
|
+
=begin
|
2
|
+
#Cheminée
|
3
|
+
|
4
|
+
#Cheminée: The Chemical Structure Search Engine
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 7.1.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Cheminee
|
17
|
+
class StructureSearchHit
|
18
|
+
attr_accessor :extra_data
|
19
|
+
|
20
|
+
attr_accessor :smiles
|
21
|
+
|
22
|
+
attr_accessor :score
|
23
|
+
|
24
|
+
attr_accessor :query
|
25
|
+
|
26
|
+
attr_accessor :used_tautomers
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
:'extra_data' => :'extra_data',
|
32
|
+
:'smiles' => :'smiles',
|
33
|
+
:'score' => :'score',
|
34
|
+
:'query' => :'query',
|
35
|
+
:'used_tautomers' => :'used_tautomers'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# Returns all the JSON keys this model knows about
|
40
|
+
def self.acceptable_attributes
|
41
|
+
attribute_map.values
|
42
|
+
end
|
43
|
+
|
44
|
+
# Attribute type mapping.
|
45
|
+
def self.openapi_types
|
46
|
+
{
|
47
|
+
:'extra_data' => :'Object',
|
48
|
+
:'smiles' => :'String',
|
49
|
+
:'score' => :'Float',
|
50
|
+
:'query' => :'String',
|
51
|
+
:'used_tautomers' => :'Boolean'
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
# List of attributes with nullable: true
|
56
|
+
def self.openapi_nullable
|
57
|
+
Set.new([
|
58
|
+
:'extra_data',
|
59
|
+
])
|
60
|
+
end
|
61
|
+
|
62
|
+
# Initializes the object
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
64
|
+
def initialize(attributes = {})
|
65
|
+
if (!attributes.is_a?(Hash))
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Cheminee::StructureSearchHit` initialize method"
|
67
|
+
end
|
68
|
+
|
69
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
70
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
71
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
72
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Cheminee::StructureSearchHit`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
73
|
+
end
|
74
|
+
h[k.to_sym] = v
|
75
|
+
}
|
76
|
+
|
77
|
+
if attributes.key?(:'extra_data')
|
78
|
+
self.extra_data = attributes[:'extra_data']
|
79
|
+
else
|
80
|
+
self.extra_data = nil
|
81
|
+
end
|
82
|
+
|
83
|
+
if attributes.key?(:'smiles')
|
84
|
+
self.smiles = attributes[:'smiles']
|
85
|
+
else
|
86
|
+
self.smiles = nil
|
87
|
+
end
|
88
|
+
|
89
|
+
if attributes.key?(:'score')
|
90
|
+
self.score = attributes[:'score']
|
91
|
+
else
|
92
|
+
self.score = nil
|
93
|
+
end
|
94
|
+
|
95
|
+
if attributes.key?(:'query')
|
96
|
+
self.query = attributes[:'query']
|
97
|
+
else
|
98
|
+
self.query = nil
|
99
|
+
end
|
100
|
+
|
101
|
+
if attributes.key?(:'used_tautomers')
|
102
|
+
self.used_tautomers = attributes[:'used_tautomers']
|
103
|
+
else
|
104
|
+
self.used_tautomers = nil
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
109
|
+
# @return Array for valid properties with the reasons
|
110
|
+
def list_invalid_properties
|
111
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
112
|
+
invalid_properties = Array.new
|
113
|
+
if @smiles.nil?
|
114
|
+
invalid_properties.push('invalid value for "smiles", smiles cannot be nil.')
|
115
|
+
end
|
116
|
+
|
117
|
+
if @score.nil?
|
118
|
+
invalid_properties.push('invalid value for "score", score cannot be nil.')
|
119
|
+
end
|
120
|
+
|
121
|
+
if @query.nil?
|
122
|
+
invalid_properties.push('invalid value for "query", query cannot be nil.')
|
123
|
+
end
|
124
|
+
|
125
|
+
if @used_tautomers.nil?
|
126
|
+
invalid_properties.push('invalid value for "used_tautomers", used_tautomers cannot be nil.')
|
127
|
+
end
|
128
|
+
|
129
|
+
invalid_properties
|
130
|
+
end
|
131
|
+
|
132
|
+
# Check to see if the all the properties in the model are valid
|
133
|
+
# @return true if the model is valid
|
134
|
+
def valid?
|
135
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
136
|
+
return false if @smiles.nil?
|
137
|
+
return false if @score.nil?
|
138
|
+
return false if @query.nil?
|
139
|
+
return false if @used_tautomers.nil?
|
140
|
+
true
|
141
|
+
end
|
142
|
+
|
143
|
+
# Checks equality by comparing each attribute.
|
144
|
+
# @param [Object] Object to be compared
|
145
|
+
def ==(o)
|
146
|
+
return true if self.equal?(o)
|
147
|
+
self.class == o.class &&
|
148
|
+
extra_data == o.extra_data &&
|
149
|
+
smiles == o.smiles &&
|
150
|
+
score == o.score &&
|
151
|
+
query == o.query &&
|
152
|
+
used_tautomers == o.used_tautomers
|
153
|
+
end
|
154
|
+
|
155
|
+
# @see the `==` method
|
156
|
+
# @param [Object] Object to be compared
|
157
|
+
def eql?(o)
|
158
|
+
self == o
|
159
|
+
end
|
160
|
+
|
161
|
+
# Calculates hash code according to all attributes.
|
162
|
+
# @return [Integer] Hash code
|
163
|
+
def hash
|
164
|
+
[extra_data, smiles, score, query, used_tautomers].hash
|
165
|
+
end
|
166
|
+
|
167
|
+
# Builds the object from hash
|
168
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
169
|
+
# @return [Object] Returns the model itself
|
170
|
+
def self.build_from_hash(attributes)
|
171
|
+
return nil unless attributes.is_a?(Hash)
|
172
|
+
attributes = attributes.transform_keys(&:to_sym)
|
173
|
+
transformed_hash = {}
|
174
|
+
openapi_types.each_pair do |key, type|
|
175
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
176
|
+
transformed_hash["#{key}"] = nil
|
177
|
+
elsif type =~ /\AArray<(.*)>/i
|
178
|
+
# check to ensure the input is an array given that the attribute
|
179
|
+
# is documented as an array but the input is not
|
180
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
181
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
182
|
+
end
|
183
|
+
elsif !attributes[attribute_map[key]].nil?
|
184
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
185
|
+
end
|
186
|
+
end
|
187
|
+
new(transformed_hash)
|
188
|
+
end
|
189
|
+
|
190
|
+
# Deserializes the data based on type
|
191
|
+
# @param string type Data type
|
192
|
+
# @param string value Value to be deserialized
|
193
|
+
# @return [Object] Deserialized data
|
194
|
+
def self._deserialize(type, value)
|
195
|
+
case type.to_sym
|
196
|
+
when :Time
|
197
|
+
Time.parse(value)
|
198
|
+
when :Date
|
199
|
+
Date.parse(value)
|
200
|
+
when :String
|
201
|
+
value.to_s
|
202
|
+
when :Integer
|
203
|
+
value.to_i
|
204
|
+
when :Float
|
205
|
+
value.to_f
|
206
|
+
when :Boolean
|
207
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
208
|
+
true
|
209
|
+
else
|
210
|
+
false
|
211
|
+
end
|
212
|
+
when :Object
|
213
|
+
# generic object (usually a Hash), return directly
|
214
|
+
value
|
215
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
216
|
+
inner_type = Regexp.last_match[:inner_type]
|
217
|
+
value.map { |v| _deserialize(inner_type, v) }
|
218
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
219
|
+
k_type = Regexp.last_match[:k_type]
|
220
|
+
v_type = Regexp.last_match[:v_type]
|
221
|
+
{}.tap do |hash|
|
222
|
+
value.each do |k, v|
|
223
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
224
|
+
end
|
225
|
+
end
|
226
|
+
else # model
|
227
|
+
# models (e.g. Pet) or oneOf
|
228
|
+
klass = Cheminee.const_get(type)
|
229
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
230
|
+
end
|
231
|
+
end
|
232
|
+
|
233
|
+
# Returns the string representation of the object
|
234
|
+
# @return [String] String presentation of the object
|
235
|
+
def to_s
|
236
|
+
to_hash.to_s
|
237
|
+
end
|
238
|
+
|
239
|
+
# to_body is an alias to to_hash (backward compatibility)
|
240
|
+
# @return [Hash] Returns the object in the form of hash
|
241
|
+
def to_body
|
242
|
+
to_hash
|
243
|
+
end
|
244
|
+
|
245
|
+
# Returns the object in the form of hash
|
246
|
+
# @return [Hash] Returns the object in the form of hash
|
247
|
+
def to_hash
|
248
|
+
hash = {}
|
249
|
+
self.class.attribute_map.each_pair do |attr, param|
|
250
|
+
value = self.send(attr)
|
251
|
+
if value.nil?
|
252
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
253
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
254
|
+
end
|
255
|
+
|
256
|
+
hash[param] = _to_hash(value)
|
257
|
+
end
|
258
|
+
hash
|
259
|
+
end
|
260
|
+
|
261
|
+
# Outputs non-array value in the form of hash
|
262
|
+
# For object, use to_hash. Otherwise, just return the value
|
263
|
+
# @param [Object] value Any valid value
|
264
|
+
# @return [Hash] Returns the value in the form of hash
|
265
|
+
def _to_hash(value)
|
266
|
+
if value.is_a?(Array)
|
267
|
+
value.compact.map { |v| _to_hash(v) }
|
268
|
+
elsif value.is_a?(Hash)
|
269
|
+
{}.tap do |hash|
|
270
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
271
|
+
end
|
272
|
+
elsif value.respond_to? :to_hash
|
273
|
+
value.to_hash
|
274
|
+
else
|
275
|
+
value
|
276
|
+
end
|
277
|
+
end
|
278
|
+
|
279
|
+
end
|
280
|
+
|
281
|
+
end
|
data/lib/cheminee/version.rb
CHANGED
data/lib/cheminee.rb
CHANGED
@@ -29,7 +29,8 @@ require 'cheminee/models/post_index_bulk_response_ok_status'
|
|
29
29
|
require 'cheminee/models/schema'
|
30
30
|
require 'cheminee/models/smile'
|
31
31
|
require 'cheminee/models/standardized_smile'
|
32
|
-
require 'cheminee/models/
|
32
|
+
require 'cheminee/models/structure_response_error'
|
33
|
+
require 'cheminee/models/structure_search_hit'
|
33
34
|
|
34
35
|
# APIs
|
35
36
|
require 'cheminee/api/default_api'
|
Binary file
|
@@ -0,0 +1,36 @@
|
|
1
|
+
=begin
|
2
|
+
#Cheminée
|
3
|
+
|
4
|
+
#Cheminée: The Chemical Structure Search Engine
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 7.1.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for Cheminee::StructureResponseError
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe Cheminee::StructureResponseError do
|
21
|
+
let(:instance) { Cheminee::StructureResponseError.new }
|
22
|
+
|
23
|
+
describe 'test an instance of StructureResponseError' do
|
24
|
+
it 'should create an instance of StructureResponseError' do
|
25
|
+
# uncomment below to test the instance creation
|
26
|
+
#expect(instance).to be_instance_of(Cheminee::StructureResponseError)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test attribute "error"' do
|
31
|
+
it 'should work' do
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
=begin
|
2
|
+
#Cheminée
|
3
|
+
|
4
|
+
#Cheminée: The Chemical Structure Search Engine
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 7.1.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for Cheminee::StructureSearchHit
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe Cheminee::StructureSearchHit do
|
21
|
+
let(:instance) { Cheminee::StructureSearchHit.new }
|
22
|
+
|
23
|
+
describe 'test an instance of StructureSearchHit' do
|
24
|
+
it 'should create an instance of StructureSearchHit' do
|
25
|
+
# uncomment below to test the instance creation
|
26
|
+
#expect(instance).to be_instance_of(Cheminee::StructureSearchHit)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test attribute "extra_data"' do
|
31
|
+
it 'should work' do
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe 'test attribute "smiles"' do
|
37
|
+
it 'should work' do
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
describe 'test attribute "score"' do
|
43
|
+
it 'should work' do
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
describe 'test attribute "query"' do
|
49
|
+
it 'should work' do
|
50
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
describe 'test attribute "used_tautomers"' do
|
55
|
+
it 'should work' do
|
56
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cheminee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Xavier Lange
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -75,6 +75,8 @@ files:
|
|
75
75
|
- docs/Schema.md
|
76
76
|
- docs/Smile.md
|
77
77
|
- docs/StandardizedSmile.md
|
78
|
+
- docs/StructureResponseError.md
|
79
|
+
- docs/StructureSearchHit.md
|
78
80
|
- docs/SubstructureSearchHit.md
|
79
81
|
- git_push.sh
|
80
82
|
- lib/cheminee.rb
|
@@ -94,11 +96,13 @@ files:
|
|
94
96
|
- lib/cheminee/models/schema.rb
|
95
97
|
- lib/cheminee/models/smile.rb
|
96
98
|
- lib/cheminee/models/standardized_smile.rb
|
99
|
+
- lib/cheminee/models/structure_response_error.rb
|
100
|
+
- lib/cheminee/models/structure_search_hit.rb
|
97
101
|
- lib/cheminee/models/substructure_search_hit.rb
|
98
102
|
- lib/cheminee/version.rb
|
99
103
|
- openapi-generator-config.json
|
100
104
|
- openapi.json
|
101
|
-
- pkg/cheminee-0.1.
|
105
|
+
- pkg/cheminee-0.1.11.gem
|
102
106
|
- spec/api/default_api_spec.rb
|
103
107
|
- spec/api_client_spec.rb
|
104
108
|
- spec/configuration_spec.rb
|
@@ -114,6 +118,8 @@ files:
|
|
114
118
|
- spec/models/schema_spec.rb
|
115
119
|
- spec/models/smile_spec.rb
|
116
120
|
- spec/models/standardized_smile_spec.rb
|
121
|
+
- spec/models/structure_response_error_spec.rb
|
122
|
+
- spec/models/structure_search_hit_spec.rb
|
117
123
|
- spec/models/substructure_search_hit_spec.rb
|
118
124
|
- spec/spec_helper.rb
|
119
125
|
homepage: https://github.com/rdkit-rs/cheminee-ruby
|
@@ -147,12 +153,14 @@ test_files:
|
|
147
153
|
- spec/models/post_index_bulk_response_error_spec.rb
|
148
154
|
- spec/models/standardized_smile_spec.rb
|
149
155
|
- spec/models/smile_spec.rb
|
156
|
+
- spec/models/structure_response_error_spec.rb
|
150
157
|
- spec/models/get_indexes_response_error_spec.rb
|
151
158
|
- spec/models/bulk_request_spec.rb
|
152
159
|
- spec/models/substructure_search_hit_spec.rb
|
153
160
|
- spec/models/bulk_request_doc_spec.rb
|
154
161
|
- spec/models/post_index_bulk_response_ok_status_spec.rb
|
155
162
|
- spec/models/schema_spec.rb
|
163
|
+
- spec/models/structure_search_hit_spec.rb
|
156
164
|
- spec/models/list_index_response_err_spec.rb
|
157
165
|
- spec/models/index_meta_spec.rb
|
158
166
|
- spec/models/create_index_error_spec.rb
|
data/pkg/cheminee-0.1.9.gem
DELETED
Binary file
|