-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c8b9c76
commit 902e9cd
Showing
150 changed files
with
3,240 additions
and
1,657 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
# This file was auto-generated by Fern from our API Definition. | ||
|
||
from .api_error import ApiError | ||
from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper | ||
from .datetime_utils import serialize_datetime | ||
from .jsonable_encoder import jsonable_encoder | ||
from .remove_none_from_headers import remove_none_from_headers | ||
from .remove_none_from_dict import remove_none_from_dict | ||
|
||
__all__ = ["ApiError", "jsonable_encoder", "remove_none_from_headers", "serialize_datetime"] | ||
__all__ = [ | ||
"ApiError", | ||
"AsyncClientWrapper", | ||
"BaseClientWrapper", | ||
"SyncClientWrapper", | ||
"jsonable_encoder", | ||
"remove_none_from_dict", | ||
"serialize_datetime", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# This file was auto-generated by Fern from our API Definition. | ||
|
||
import typing | ||
|
||
import httpx | ||
|
||
|
||
class BaseClientWrapper: | ||
def __init__(self, *, token: typing.Union[str, typing.Callable[[], str]], base_url: str): | ||
self._token = token | ||
self._base_url = base_url | ||
|
||
def get_headers(self) -> typing.Dict[str, str]: | ||
headers: typing.Dict[str, str] = { | ||
"X-Fern-Language": "Python", | ||
"X-Fern-SDK-Name": "mercoa", | ||
"X-Fern-SDK-Version": "v0.2.13", | ||
} | ||
headers["Authorization"] = f"Bearer {self._get_token()}" | ||
return headers | ||
|
||
def _get_token(self) -> str: | ||
if isinstance(self._token, str): | ||
return self._token | ||
else: | ||
return self._token() | ||
|
||
def get_base_url(self) -> str: | ||
return self._base_url | ||
|
||
|
||
class SyncClientWrapper(BaseClientWrapper): | ||
def __init__( | ||
self, *, token: typing.Union[str, typing.Callable[[], str]], base_url: str, httpx_client: httpx.Client | ||
): | ||
super().__init__(token=token, base_url=base_url) | ||
self.httpx_client = httpx_client | ||
|
||
|
||
class AsyncClientWrapper(BaseClientWrapper): | ||
def __init__( | ||
self, *, token: typing.Union[str, typing.Callable[[], str]], base_url: str, httpx_client: httpx.AsyncClient | ||
): | ||
super().__init__(token=token, base_url=base_url) | ||
self.httpx_client = httpx_client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# This file was auto-generated by Fern from our API Definition. | ||
|
||
from typing import Any, Dict, Optional | ||
|
||
|
||
def remove_none_from_dict(original: Dict[str, Optional[Any]]) -> Dict[str, Any]: | ||
new: Dict[str, Any] = {} | ||
for key, value in original.items(): | ||
if value is not None: | ||
new[key] = value | ||
return new |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.