Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions apimatic_core_interfaces/client/http_client_provider.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
from abc import ABC, abstractmethod
from requests import Session


class HttpClientProvider(ABC):
"""Defines a contract for providing HTTP client configuration.

Classes implementing this interface are expected to supply a configured
HTTP session and timeout value that will be used by the SDK's internal
HTTP layer when making network requests.

This allows developers to inject their own custom HTTP clients while
maintaining compatibility with the SDK's request/response handling.
"""

@property
@abstractmethod
def timeout(self) -> float:
"""The default request timeout in seconds.

Returns:
float: The timeout duration to apply to all outgoing HTTP requests.
"""

@property
@abstractmethod
def session(self) -> Session:
"""The underlying HTTP session instance.

Returns:
Session: A configured ``requests.Session`` object used to perform
network operations such as GET, POST, and PUT calls.
"""
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
setuptools>=68.0.0
setuptools>=68.0.0
requests~=2.31
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

setup(
name='apimatic-core-interfaces',
version='0.1.7',
version='0.1.8',
description='An abstract layer of the functionalities provided by apimatic-core-library, requests-client-adapter '
'and APIMatic SDKs.',
long_description=long_description,
Expand Down
Loading