snowflake.core.cortex.search_service.ApiClientΒΆ
- class snowflake.core.cortex.search_service.ApiClient(root: Root, configuration=None, header_name=None, header_value=None, cookie=None)ΒΆ
Bases:
object
Generic API client for OpenAPI client library builds.
OpenAPI generic API client. This client handles the client- server communication, and is invariant across implementations. Specifics of the methods and models for each application are generated from the OpenAPI templates.
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually.
- Parameters:
configuration β .Configuration object for this client
header_name β a header to pass when making calls to the API.
header_value β a header value to pass when making calls to the API.
cookie β a cookie to include in the header when making calls to the API
Attributes
- user_agentΒΆ
User agent for this API client.
Methods
- call_api(root, resource_path, method, path_params=None, query_params=None, header_params=None, body=None, post_params=None, files=None, response_types_map=None, auth_settings=None, async_req=None, _return_http_data_only=None, collection_formats=None, _preload_content=True, _request_timeout=None, _host=None, _request_auth=None)ΒΆ
Makes the HTTP request (synchronous) and returns deserialized data.
To make an async_req request, set the async_req parameter.
- Parameters:
resource_path β Path to method endpoint.
method β Method to call.
path_params β Path parameters in the url.
query_params β Query parameters in the url.
header_params β Header parameters to be placed in the request header.
body β Request body.
dict (files) β Request post form parameters, for application/x-www-form-urlencoded, multipart/form-data.
list (auth_settings) β Auth Settings names for the request.
response β Response data type.
dict β key -> filename, value -> filepath, for multipart/form-data.
bool (async_req) β execute request asynchronously
_return_http_data_only β response data without head status code and headers
collection_formats β dict of collection formats for path, query, header, and post parameters.
_preload_content β if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True.
_request_timeout β timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth β set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
- Returns:
If async_req parameter is True, the request will be called asynchronously. The method will return the request thread. If parameter async_req is False or missing, then the method will return the response directly.
- deserialize(response, response_type)ΒΆ
Deserializes response into an object.
- Parameters:
response β RESTResponse object to be deserialized.
response_type β class literal for deserialized object, or string of class name.
- Returns:
deserialized object.
- files_parameters(files=None)ΒΆ
Builds form parameters.
- Parameters:
files β File parameters.
- Returns:
Form parameters with files.
- classmethod get_default(root: Root)ΒΆ
Return new instance of ApiClient.
This method returns newly created, based on default constructor, object of ApiClient class or returns a copy of default ApiClient.
- Returns:
The ApiClient object.
- static get_path_and_chunk_count_from_header(links_str)ΒΆ
- static has_large_results_message_in_body(body)ΒΆ
- static large_results(response)ΒΆ
Returns a tuple of the result URL and number of chunks; returns None if no large results are detected.
- Parameters:
response β A RESTResponse object in which to check for large results.
- Returns:
A Tuple of (results_url, number_of_chunks) if there are large results, or else None.
- parameters_to_url_query(params, collection_formats)ΒΆ
Get parameters as list of tuples, formatting collections.
- Parameters:
params β Parameters as dict or list of two-tuples
collection_formats (dict) β Parameter collection formats
- Returns:
URL query string (e.g. a=Hello%20World&b=123)
- request(root, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, _request_timeout=None)ΒΆ
Makes the HTTP request using RESTClient.
- request_with_retry(root, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, _request_timeout=None)ΒΆ
Response time by default one hour.
- select_header_accept(accepts)ΒΆ
Returns Accept based on an array of accepts provided.
- Parameters:
accepts β List of headers.
- Returns:
Accept (e.g. application/json).
- select_header_content_type(content_types)ΒΆ
Returns Content-Type based on an array of content_types provided.
- Parameters:
content_types β List of content-types.
- Returns:
Content-Type (e.g. application/json).
- classmethod set_default(default)ΒΆ
Set default instance of ApiClient.
It stores default ApiClient.
- Parameters:
default β object of ApiClient.
- set_default_header(header_name, header_value)ΒΆ
- update_params_for_auth(headers, queries, auth_settings, resource_path, method, body, request_auth=None)ΒΆ
Updates header and query params based on authentication setting.
- Parameters:
headers β Header parameters dict to be updated.
queries β Query parameters tuple list to be updated.
auth_settings β Authentication setting identifiers list.
- Resource_path:
A string representation of the HTTP request resource path.
- Method:
A string representation of the HTTP request method.
- Body:
A object representing the body of the HTTP request.
The object type is the return value of sanitize_for_serialization(). :param request_auth: if set, the provided settings will
override the token in the configuration.