Class: Cheminee::DefaultApi

Inherits:
Object
  • Object
show all
Defined in:
lib/cheminee/api/default_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ DefaultApi

Returns a new instance of DefaultApi.



19
20
21
# File 'lib/cheminee/api/default_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/cheminee/api/default_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#v1_indexes_get(opts = {}) ⇒ Array<IndexMeta>

List indexes

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



25
26
27
28
# File 'lib/cheminee/api/default_api.rb', line 25

def v1_indexes_get(opts = {})
  data, _status_code, _headers = v1_indexes_get_with_http_info(opts)
  data
end

#v1_indexes_get_with_http_info(opts = {}) ⇒ Array<(Array<IndexMeta>, Integer, Hash)>

List indexes

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<IndexMeta>, Integer, Hash)>)

    Array<IndexMeta> data, response status code and response headers



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/cheminee/api/default_api.rb', line 33

def v1_indexes_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.v1_indexes_get ...'
  end
  # resource path
  local_var_path = '/v1/indexes'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<IndexMeta>'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"DefaultApi.v1_indexes_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#v1_indexes_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#v1_indexes_index_bulk_index_post(index, bulk_request, opts = {}) ⇒ PostIndexBulkResponseOk

Index a list of SMILES and associated, free-form JSON attributes which are indexed and searchable

Parameters:

  • index (String)
  • bulk_request (BulkRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



82
83
84
85
# File 'lib/cheminee/api/default_api.rb', line 82

def v1_indexes_index_bulk_index_post(index, bulk_request, opts = {})
  data, _status_code, _headers = v1_indexes_index_bulk_index_post_with_http_info(index, bulk_request, opts)
  data
end

#v1_indexes_index_bulk_index_post_with_http_info(index, bulk_request, opts = {}) ⇒ Array<(PostIndexBulkResponseOk, Integer, Hash)>

Index a list of SMILES and associated, free-form JSON attributes which are indexed and searchable

Parameters:

  • index (String)
  • bulk_request (BulkRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(PostIndexBulkResponseOk, Integer, Hash)>)

    PostIndexBulkResponseOk data, response status code and response headers



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/cheminee/api/default_api.rb', line 92

def v1_indexes_index_bulk_index_post_with_http_info(index, bulk_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.v1_indexes_index_bulk_index_post ...'
  end
  # verify the required parameter 'index' is set
  if @api_client.config.client_side_validation && index.nil?
    fail ArgumentError, "Missing the required parameter 'index' when calling DefaultApi.v1_indexes_index_bulk_index_post"
  end
  # verify the required parameter 'bulk_request' is set
  if @api_client.config.client_side_validation && bulk_request.nil?
    fail ArgumentError, "Missing the required parameter 'bulk_request' when calling DefaultApi.v1_indexes_index_bulk_index_post"
  end
  # resource path
  local_var_path = '/v1/indexes/{index}/bulk_index'.sub('{' + 'index' + '}', CGI.escape(index.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json; charset=utf-8'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(bulk_request)

  # return_type
  return_type = opts[:debug_return_type] || 'PostIndexBulkResponseOk'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"DefaultApi.v1_indexes_index_bulk_index_post",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#v1_indexes_index_bulk_index_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#v1_indexes_index_get(index, opts = {}) ⇒ Array<IndexMeta>

Get extended information about an index

Parameters:

  • index (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



153
154
155
156
# File 'lib/cheminee/api/default_api.rb', line 153

def v1_indexes_index_get(index, opts = {})
  data, _status_code, _headers = v1_indexes_index_get_with_http_info(index, opts)
  data
end

#v1_indexes_index_get_with_http_info(index, opts = {}) ⇒ Array<(Array<IndexMeta>, Integer, Hash)>

Get extended information about an index

Parameters:

  • index (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<IndexMeta>, Integer, Hash)>)

    Array<IndexMeta> data, response status code and response headers



162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/cheminee/api/default_api.rb', line 162

def v1_indexes_index_get_with_http_info(index, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.v1_indexes_index_get ...'
  end
  # verify the required parameter 'index' is set
  if @api_client.config.client_side_validation && index.nil?
    fail ArgumentError, "Missing the required parameter 'index' when calling DefaultApi.v1_indexes_index_get"
  end
  # resource path
  local_var_path = '/v1/indexes/{index}'.sub('{' + 'index' + '}', CGI.escape(index.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<IndexMeta>'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"DefaultApi.v1_indexes_index_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#v1_indexes_index_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#v1_indexes_index_post(index, schema, opts = {}) ⇒ IndexMeta

Create an index

Parameters:

  • index (String)
  • schema (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sort_by (String)

Returns:



216
217
218
219
# File 'lib/cheminee/api/default_api.rb', line 216

def v1_indexes_index_post(index, schema, opts = {})
  data, _status_code, _headers = v1_indexes_index_post_with_http_info(index, schema, opts)
  data
end

#v1_indexes_index_post_with_http_info(index, schema, opts = {}) ⇒ Array<(IndexMeta, Integer, Hash)>

Create an index

Parameters:

  • index (String)
  • schema (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sort_by (String)

Returns:

  • (Array<(IndexMeta, Integer, Hash)>)

    IndexMeta data, response status code and response headers



227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
# File 'lib/cheminee/api/default_api.rb', line 227

def v1_indexes_index_post_with_http_info(index, schema, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.v1_indexes_index_post ...'
  end
  # verify the required parameter 'index' is set
  if @api_client.config.client_side_validation && index.nil?
    fail ArgumentError, "Missing the required parameter 'index' when calling DefaultApi.v1_indexes_index_post"
  end
  # verify the required parameter 'schema' is set
  if @api_client.config.client_side_validation && schema.nil?
    fail ArgumentError, "Missing the required parameter 'schema' when calling DefaultApi.v1_indexes_index_post"
  end
  # resource path
  local_var_path = '/v1/indexes/{index}'.sub('{' + 'index' + '}', CGI.escape(index.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'schema'] = schema
  query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'IndexMeta'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"DefaultApi.v1_indexes_index_post",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#v1_indexes_index_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#v1_indexes_index_search_substructure_get(index, smile, opts = {}) ⇒ Array<StructureSearchHit>

Perform substructure search against index

Parameters:

  • index (String)
  • smile (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :result_limit (Integer)
  • :tautomer_limit (Integer)

Returns:



288
289
290
291
# File 'lib/cheminee/api/default_api.rb', line 288

def v1_indexes_index_search_substructure_get(index, smile, opts = {})
  data, _status_code, _headers = v1_indexes_index_search_substructure_get_with_http_info(index, smile, opts)
  data
end

#v1_indexes_index_search_substructure_get_with_http_info(index, smile, opts = {}) ⇒ Array<(Array<StructureSearchHit>, Integer, Hash)>

Perform substructure search against index

Parameters:

  • index (String)
  • smile (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :result_limit (Integer)
  • :tautomer_limit (Integer)

Returns:

  • (Array<(Array<StructureSearchHit>, Integer, Hash)>)

    Array<StructureSearchHit> data, response status code and response headers



300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
# File 'lib/cheminee/api/default_api.rb', line 300

def v1_indexes_index_search_substructure_get_with_http_info(index, smile, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.v1_indexes_index_search_substructure_get ...'
  end
  # verify the required parameter 'index' is set
  if @api_client.config.client_side_validation && index.nil?
    fail ArgumentError, "Missing the required parameter 'index' when calling DefaultApi.v1_indexes_index_search_substructure_get"
  end
  # verify the required parameter 'smile' is set
  if @api_client.config.client_side_validation && smile.nil?
    fail ArgumentError, "Missing the required parameter 'smile' when calling DefaultApi.v1_indexes_index_search_substructure_get"
  end
  # resource path
  local_var_path = '/v1/indexes/{index}/search/substructure'.sub('{' + 'index' + '}', CGI.escape(index.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'smile'] = smile
  query_params[:'result_limit'] = opts[:'result_limit'] if !opts[:'result_limit'].nil?
  query_params[:'tautomer_limit'] = opts[:'tautomer_limit'] if !opts[:'tautomer_limit'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<StructureSearchHit>'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"DefaultApi.v1_indexes_index_search_substructure_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#v1_indexes_index_search_substructure_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#v1_schemas_get(opts = {}) ⇒ Array<Schema>

List schemas available for creating indexes

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



358
359
360
361
# File 'lib/cheminee/api/default_api.rb', line 358

def v1_schemas_get(opts = {})
  data, _status_code, _headers = v1_schemas_get_with_http_info(opts)
  data
end

#v1_schemas_get_with_http_info(opts = {}) ⇒ Array<(Array<Schema>, Integer, Hash)>

List schemas available for creating indexes

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<Schema>, Integer, Hash)>)

    Array<Schema> data, response status code and response headers



366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
# File 'lib/cheminee/api/default_api.rb', line 366

def v1_schemas_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.v1_schemas_get ...'
  end
  # resource path
  local_var_path = '/v1/schemas'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<Schema>'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"DefaultApi.v1_schemas_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#v1_schemas_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#v1_standardize_post(smile, opts = {}) ⇒ Array<StandardizedSmile>

Pass a list of SMILES through fragment_parent, uncharger, and canonicalization routines

Parameters:

  • smile (Array<Smile>)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



414
415
416
417
# File 'lib/cheminee/api/default_api.rb', line 414

def v1_standardize_post(smile, opts = {})
  data, _status_code, _headers = v1_standardize_post_with_http_info(smile, opts)
  data
end

#v1_standardize_post_with_http_info(smile, opts = {}) ⇒ Array<(Array<StandardizedSmile>, Integer, Hash)>

Pass a list of SMILES through fragment_parent, uncharger, and canonicalization routines

Parameters:

  • smile (Array<Smile>)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<StandardizedSmile>, Integer, Hash)>)

    Array<StandardizedSmile> data, response status code and response headers



423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
# File 'lib/cheminee/api/default_api.rb', line 423

def v1_standardize_post_with_http_info(smile, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.v1_standardize_post ...'
  end
  # verify the required parameter 'smile' is set
  if @api_client.config.client_side_validation && smile.nil?
    fail ArgumentError, "Missing the required parameter 'smile' when calling DefaultApi.v1_standardize_post"
  end
  # resource path
  local_var_path = '/v1/standardize'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json; charset=utf-8'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(smile)

  # return_type
  return_type = opts[:debug_return_type] || 'Array<StandardizedSmile>'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"DefaultApi.v1_standardize_post",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#v1_standardize_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end