checkbox_sdk.client package

Subpackages

Submodules

checkbox_sdk.client.asynchronous module

checkbox_sdk.client.base module

class checkbox_sdk.client.base.BaseAsyncCheckBoxClient(base_url: str = 'https://api.checkbox.in.ua', requests_timeout: int = 60, proxy: str | Dict[str, str] | None = None, verify_ssl: bool = True, trust_env: bool = True, api_version: str = '1', storage: SessionStorage | None = None, client_name: str = 'checkbox-sdk', client_version: str = '1.1.0', integration_key: str | None = None)

Bases: BaseCheckBoxClient, ABC

abstract async emit(call: AbstractMethod, storage: SessionStorage | None = None, request_timeout: float | None = None)

Abstract method to be implemented by subclasses to send an asynchronous request to the Checkbox API.

Параметри:
  • call – The method encapsulating the API request details.

  • storage – Optional session storage to use for the request. If not provided, the default storage will be used.

  • request_timeout – Optional timeout for the request. If not provided, the client’s default timeout will be used.

Повертає:

The response from the API.

This method must be implemented by any subclass.

class checkbox_sdk.client.base.BaseCheckBoxClient(base_url: str = 'https://api.checkbox.in.ua', requests_timeout: int = 60, proxy: str | Dict[str, str] | None = None, verify_ssl: bool = True, trust_env: bool = True, api_version: str = '1', storage: SessionStorage | None = None, client_name: str = 'checkbox-sdk', client_version: str = '1.1.0', integration_key: str | None = None)

Bases: ABC

Abstract base class for interacting with the Checkbox API.

This class provides foundational methods and properties for making API requests, managing session storage, and handling common configurations like proxies, SSL verification, and request timeouts.

Параметри:
  • base_url – The base URL for the Checkbox API. Defaults to BASE_API_URL.

  • requests_timeout – The timeout for API requests, in seconds. Defaults to DEFAULT_REQUEST_TIMEOUT.

  • proxy – Optional proxy configuration. Can be a string URL or a dictionary of proxies.

  • verify_ssl – Whether to verify SSL certificates. Defaults to True.

  • trust_env – Whether to trust environment variables for proxy configuration. Defaults to True.

  • api_version – The version of the API to use. Defaults to API_VERSION.

  • storage – Optional session storage to use for requests. Defaults to a new SessionStorage instance.

  • client_name – The name of the client, used for identifying requests. Defaults to «checkbox-sdk».

  • client_version – The version of the client. Defaults to the package version __version__.

  • integration_key – Optional integration key for accessing the API. Defaults to None.

base_url

The base URL for the Checkbox API.

api_version

The version of the API to use.

timeout

The timeout for API requests, in seconds.

proxy

The proxy configuration for the client.

verify_ssl

Whether SSL certificates are verified.

storage

The session storage instance used for requests.

client_name

The name of the client.

client_version

The version of the client.

integration_key

The integration key for accessing the API.

trust_env

Whether to trust environment variables for proxy configuration.

property client_headers: Dict[str, Any]

Constructs the headers to be used in API requests.

Повертає:

A dictionary of headers including the client name, version, and optionally the integration key.

static handle_wait_status(result: Dict[str, Any], field: str, expected_value: Set[Any], initial: float)
set_license_key(storage: SessionStorage | None, license_key: str | None) None

Sets the license key in the session storage.

Параметри:
  • storage – Optional session storage to use. If not provided, the default storage will be used.

  • license_key – The license key to set in the storage. If None, no action is taken.

class checkbox_sdk.client.base.BaseSyncCheckBoxClient(base_url: str = 'https://api.checkbox.in.ua', requests_timeout: int = 60, proxy: str | Dict[str, str] | None = None, verify_ssl: bool = True, trust_env: bool = True, api_version: str = '1', storage: SessionStorage | None = None, client_name: str = 'checkbox-sdk', client_version: str = '1.1.0', integration_key: str | None = None)

Bases: BaseCheckBoxClient, ABC

abstract emit(call: AbstractMethod, storage: SessionStorage | None = None, request_timeout: float | None = None)

Abstract method to be implemented by subclasses to send a request to the Checkbox API.

Параметри:
  • call – The method encapsulating the API request details.

  • storage – Optional session storage to use for the request. If not provided, the default storage will be used.

  • request_timeout – Optional timeout for the request. If not provided, the client’s default timeout will be used.

Повертає:

The response from the API.

This method must be implemented by any subclass.

checkbox_sdk.client.synchronous module

Module contents