antimatter.client.api_client#

Antimatter Public API

Interact with the Antimatter Cloud API

The version of the OpenAPI document: 1.1.3 Contact: support@antimatter.io Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.

Module Contents#

Classes#

ApiClient

Generic API client for OpenAPI client library builds.

class antimatter.client.api_client.ApiClient(configuration=None, header_name=None, header_value=None, cookie=None)#

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.

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

property user_agent#

User agent for this API client

PRIMITIVE_TYPES = ()#
NATIVE_TYPES_MAPPING#
set_default_header(header_name, header_value)#
classmethod get_default()#

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.

classmethod set_default(default)#

Set default instance of ApiClient.

It stores default ApiClient.

Parameters:

default – object of ApiClient.

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) Tuple#

Builds the HTTP request params needed by the request. :param method: Method to call. :param resource_path: Path to method endpoint. :param path_params: Path parameters in the url. :param query_params: Query parameters in the url. :param header_params: Header parameters to be

placed in the request header.

Parameters:
  • 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) antimatter.client.rest.RESTResponse#

Makes the HTTP request (synchronous) :param method: Method to call. :param url: Path to method endpoint. :param header_params: Header parameters to be

placed in the request header.

Parameters:
  • 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: antimatter.client.rest.RESTResponse = None, response_types_map=None) antimatter.client.api_response.ApiResponse#

Deserializes response into an object. :param response_data: RESTResponse object to be deserialized. :param response_types_map: dict of response types. :return: ApiResponse

sanitize_for_serialization(obj)#

Builds a JSON POST object.

If obj is None, return None. 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 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)#

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.

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=None)#

Builds form parameters.

Parameters:

files – File parameters.

Returns:

Form parameters with files.

select_header_accept(accepts: List[str]) str | None#

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