Client

class optimeering_beta.OptimeeringClient(configuration=None, header_name=None, header_value=None, cookie=None)

Main class to interact with the API.

All APIs are accessible through an instance of this class.

Parameters:
  • configuration (Configuration) – The Configuration object to use with the 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

Example:

>>> from optimeering_beta import Configuration, OptimeeringClient
>>> configuration = Configuration(host="https://beta.optimeering.com")
>>> client = OptimeeringClient(configuration=configuration)
>>> configuration_with_api_key = Configuration(api_key="SecretKeyHere")
>>> client_with_api_key = OptimeeringClient(configuration=configuration_with_api_key)
property user_agent

User agent for this API client

classmethod get_default()

Return new instance of OptimeeringClient.

This method returns newly created, based on default constructor, object of OptimeeringClient class or returns a copy of default OptimeeringClient.

Returns:

The OptimeeringClient object.

classmethod set_default(default)

Set default instance of OptimeeringClient.

It stores default OptimeeringClient.

Parameters:

default – object of OptimeeringClient.

param_serialize(method, resource_path, path_params=None, query_params=None, header_params=None, body=None, post_params=None, files=None, auth_settings=None, collection_formats=None, _host=None, _request_auth=None)

Builds the HTTP request params needed by the request.

Parameters:
  • method – Method to call.

  • resource_path – Path to method endpoint.

  • 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.

  • dict – key -> filename, value -> filepath, for multipart/form-data.

  • collection_formats – dict of collection formats for path, query, header, and post parameters.

  • _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:

tuple of form (path, http_method, query_params, header_params, body, post_params, files)

call_api(method, url, header_params=None, body=None, post_params=None, _request_timeout=None)

Makes the HTTP request (synchronous)

Parameters:
  • method – Method to call.

  • url – Path to method endpoint.

  • header_params – Header parameters to be placed in the request header.

  • body – Request body.

  • dict (post_params) – Request post form parameters, for application/x-www-form-urlencoded, multipart/form-data.

  • _request_timeout – timeout setting for this request.

Returns:

RESTResponse

response_deserialize(response_data, response_types_map=None)

Deserializes response into an object.

Parameters:
  • response_data – RESTResponse object to be deserialized.

  • response_types_map – dict of response types.

Returns:

ApiResponse

sanitize_for_serialization(obj)

Builds a JSON POST object.

If obj is None, return None. If obj is SecretStr, return obj.get_secret_value() If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict.

Parameters:

obj – The data to serialize.

Returns:

The serialized form of data.

deserialize(response_text, response_type, content_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.

  • content_type – content type of response.

Returns:

deserialized object.

parameters_to_tuples(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:

Parameters as list of tuples, collections formatted

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)

files_parameters(files)

Builds form parameters.

Parameters:

files – File parameters.

Returns:

Form parameters with files.

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).

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.

  • request_auth – if set, the provided settings will override the token in the configuration.

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().

property access_api

Collection of methods to interact with AccessApi

Return type:

AccessApi

property predictions_api

Collection of methods to interact with PredictionsApi

Return type:

PredictionsApi