=begin #Cheminée #Cheminée: The Chemical Structure Search Engine The version of the OpenAPI document: 1.0 Generated by: https://openapi-generator.tech OpenAPI Generator version: 7.3.0-SNAPSHOT =end require 'cgi' module Cheminee class DefaultApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # List indexes # @param [Hash] opts the optional parameters # @return [Array] def v1_indexes_get(opts = {}) data, _status_code, _headers = v1_indexes_get_with_http_info(opts) data end # List indexes # @param [Hash] opts the optional parameters # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers 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' # 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 # Index a list of SMILES and associated, free-form JSON attributes which are indexed and searchable # @param index [String] # @param bulk_request [BulkRequest] # @param [Hash] opts the optional parameters # @return [PostIndexBulkResponseOk] 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 # Index a list of SMILES and associated, free-form JSON attributes which are indexed and searchable # @param index [String] # @param bulk_request [BulkRequest] # @param [Hash] opts the optional parameters # @return [Array<(PostIndexBulkResponseOk, Integer, Hash)>] PostIndexBulkResponseOk data, response status code and response headers 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 # Get extended information about an index # @param index [String] # @param [Hash] opts the optional parameters # @return [IndexSchema] def v1_indexes_index_get(index, opts = {}) data, _status_code, _headers = v1_indexes_index_get_with_http_info(index, opts) data end # Get extended information about an index # @param index [String] # @param [Hash] opts the optional parameters # @return [Array<(IndexSchema, Integer, Hash)>] IndexSchema data, response status code and response headers 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] || 'IndexSchema' # 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 # Create an index # @param index [String] # @param schema [String] # @param [Hash] opts the optional parameters # @option opts [String] :sort_by # @return [IndexMeta] def v1_indexes_index_post(index, schema, opts = {}) data, _status_code, _headers = v1_indexes_index_post_with_http_info(index, schema, opts) data end # Create an index # @param index [String] # @param schema [String] # @param [Hash] opts the optional parameters # @option opts [String] :sort_by # @return [Array<(IndexMeta, Integer, Hash)>] IndexMeta data, response status code and response headers 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 # Perform basic query search against index # @param index [String] # @param query [String] # @param [Hash] opts the optional parameters # @option opts [Integer] :limit # @return [Array] def v1_indexes_index_search_basic_get(index, query, opts = {}) data, _status_code, _headers = v1_indexes_index_search_basic_get_with_http_info(index, query, opts) data end # Perform basic query search against index # @param index [String] # @param query [String] # @param [Hash] opts the optional parameters # @option opts [Integer] :limit # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def v1_indexes_index_search_basic_get_with_http_info(index, query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DefaultApi.v1_indexes_index_search_basic_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_basic_get" end # verify the required parameter 'query' is set if @api_client.config.client_side_validation && query.nil? fail ArgumentError, "Missing the required parameter 'query' when calling DefaultApi.v1_indexes_index_search_basic_get" end # resource path local_var_path = '/v1/indexes/{index}/search/basic'.sub('{' + 'index' + '}', CGI.escape(index.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'query'] = query query_params[:'limit'] = opts[:'limit'] if !opts[:'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' # auth_names auth_names = opts[:debug_auth_names] || [] new_options = opts.merge( :operation => :"DefaultApi.v1_indexes_index_search_basic_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_basic_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Perform substructure search against index # @param index [String] # @param smiles [String] # @param [Hash] opts the optional parameters # @option opts [Integer] :result_limit # @option opts [Integer] :tautomer_limit # @option opts [String] :extra_query # @return [Array] def v1_indexes_index_search_substructure_get(index, smiles, opts = {}) data, _status_code, _headers = v1_indexes_index_search_substructure_get_with_http_info(index, smiles, opts) data end # Perform substructure search against index # @param index [String] # @param smiles [String] # @param [Hash] opts the optional parameters # @option opts [Integer] :result_limit # @option opts [Integer] :tautomer_limit # @option opts [String] :extra_query # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def v1_indexes_index_search_substructure_get_with_http_info(index, smiles, 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 'smiles' is set if @api_client.config.client_side_validation && smiles.nil? fail ArgumentError, "Missing the required parameter 'smiles' 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[:'smiles'] = smiles query_params[:'result_limit'] = opts[:'result_limit'] if !opts[:'result_limit'].nil? query_params[:'tautomer_limit'] = opts[:'tautomer_limit'] if !opts[:'tautomer_limit'].nil? query_params[:'extra_query'] = opts[:'extra_query'] if !opts[:'extra_query'].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' # 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 # List schemas available for creating indexes # @param [Hash] opts the optional parameters # @return [Array] def v1_schemas_get(opts = {}) data, _status_code, _headers = v1_schemas_get_with_http_info(opts) data end # List schemas available for creating indexes # @param [Hash] opts the optional parameters # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers 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' # 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 # Pass a list of SMILES through fragment_parent, uncharger, and canonicalization routines # @param smiles [Array] # @param [Hash] opts the optional parameters # @return [Array] def v1_standardize_post(smiles, opts = {}) data, _status_code, _headers = v1_standardize_post_with_http_info(smiles, opts) data end # Pass a list of SMILES through fragment_parent, uncharger, and canonicalization routines # @param smiles [Array] # @param [Hash] opts the optional parameters # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def v1_standardize_post_with_http_info(smiles, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DefaultApi.v1_standardize_post ...' end # verify the required parameter 'smiles' is set if @api_client.config.client_side_validation && smiles.nil? fail ArgumentError, "Missing the required parameter 'smiles' 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(smiles) # return_type return_type = opts[:debug_return_type] || 'Array' # 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 end end