Skip to content

Commit

Permalink
Release v0.3.38
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Jun 3, 2024
1 parent be2016b commit 796090f
Show file tree
Hide file tree
Showing 182 changed files with 5,178 additions and 6,624 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Install dependencies
run: poetry install
- name: Test
run: poetry run pytest .
run: poetry run pytest ./tests/custom/

publish:
needs: [compile, test]
Expand Down
195 changes: 103 additions & 92 deletions poetry.lock

Large diffs are not rendered by default.

25 changes: 24 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,35 @@
[tool.poetry]
name = "mercoa"
version = "v0.3.37"
version = "v0.3.38"
description = ""
readme = "README.md"
authors = []
keywords = []

classifiers = [
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: OS Independent",
"Operating System :: POSIX",
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed"
]
packages = [
{ include = "mercoa", from = "src"}
]

[project.urls]
Repository = 'https://github.com/mercoa-finance/python'

[tool.poetry.dependencies]
python = "^3.8"
httpx = ">=0.21.2"
Expand All @@ -19,6 +41,7 @@ mypy = "1.9.0"
pytest = "^7.4.0"
pytest-asyncio = "^0.23.5"
python-dateutil = "^2.9.0"
types-python-dateutil = "^2.9.0.20240316"

[tool.pytest.ini_options]
testpaths = [ "tests" ]
Expand Down
59 changes: 2 additions & 57 deletions src/mercoa/bank_lookup/client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# This file was auto-generated by Fern from our API Definition.

import typing
import urllib.parse
from json.decoder import JSONDecodeError

from ..commons.errors.bad_request import BadRequest
Expand All @@ -13,9 +12,7 @@
from ..commons.errors.unimplemented import Unimplemented
from ..core.api_error import ApiError
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.jsonable_encoder import jsonable_encoder
from ..core.pydantic_utilities import pydantic_v1
from ..core.remove_none_from_dict import remove_none_from_dict
from ..core.request_options import RequestOptions
from .types.bank_lookup_response import BankLookupResponse

Expand Down Expand Up @@ -54,33 +51,7 @@ def find(
)
"""
_response = self._client_wrapper.httpx_client.request(
method="GET",
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "bankLookup"),
params=jsonable_encoder(
remove_none_from_dict(
{
"routingNumber": routing_number,
**(
request_options.get("additional_query_parameters", {})
if request_options is not None
else {}
),
}
)
),
headers=jsonable_encoder(
remove_none_from_dict(
{
**self._client_wrapper.get_headers(),
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
}
)
),
timeout=request_options.get("timeout_in_seconds")
if request_options is not None and request_options.get("timeout_in_seconds") is not None
else self._client_wrapper.get_timeout(),
retries=0,
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
"bankLookup", method="GET", params={"routingNumber": routing_number}, request_options=request_options
)
try:
_response_json = _response.json()
Expand Down Expand Up @@ -140,33 +111,7 @@ async def find(
)
"""
_response = await self._client_wrapper.httpx_client.request(
method="GET",
url=urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "bankLookup"),
params=jsonable_encoder(
remove_none_from_dict(
{
"routingNumber": routing_number,
**(
request_options.get("additional_query_parameters", {})
if request_options is not None
else {}
),
}
)
),
headers=jsonable_encoder(
remove_none_from_dict(
{
**self._client_wrapper.get_headers(),
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
}
)
),
timeout=request_options.get("timeout_in_seconds")
if request_options is not None and request_options.get("timeout_in_seconds") is not None
else self._client_wrapper.get_timeout(),
retries=0,
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
"bankLookup", method="GET", params={"routingNumber": routing_number}, request_options=request_options
)
try:
_response_json = _response.json()
Expand Down
10 changes: 7 additions & 3 deletions src/mercoa/bank_lookup/types/bank_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import typing

from ...core.datetime_utils import serialize_datetime
from ...core.pydantic_utilities import pydantic_v1
from ...core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1


class BankAddress(pydantic_v1.BaseModel):
Expand Down Expand Up @@ -33,8 +33,12 @@ def json(self, **kwargs: typing.Any) -> str:
return super().json(**kwargs_with_defaults)

def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
return super().dict(**kwargs_with_defaults)
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}

return deep_union_pydantic_dicts(
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
)

class Config:
frozen = True
Expand Down
10 changes: 7 additions & 3 deletions src/mercoa/bank_lookup/types/bank_lookup_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import typing

from ...core.datetime_utils import serialize_datetime
from ...core.pydantic_utilities import pydantic_v1
from ...core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
from .bank_address import BankAddress


Expand Down Expand Up @@ -34,8 +34,12 @@ def json(self, **kwargs: typing.Any) -> str:
return super().json(**kwargs_with_defaults)

def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
return super().dict(**kwargs_with_defaults)
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}

return deep_union_pydantic_dicts(
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
)

class Config:
frozen = True
Expand Down
4 changes: 2 additions & 2 deletions src/mercoa/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

class Mercoa:
"""
Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions.
Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.
Parameters
----------
Expand Down Expand Up @@ -84,7 +84,7 @@ def __init__(

class AsyncMercoa:
"""
Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions.
Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.
Parameters
----------
Expand Down
10 changes: 7 additions & 3 deletions src/mercoa/commons/types/address.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import typing

from ...core.datetime_utils import serialize_datetime
from ...core.pydantic_utilities import pydantic_v1
from ...core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1


class Address(pydantic_v1.BaseModel):
Expand Down Expand Up @@ -43,8 +43,12 @@ def json(self, **kwargs: typing.Any) -> str:
return super().json(**kwargs_with_defaults)

def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
return super().dict(**kwargs_with_defaults)
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}

return deep_union_pydantic_dicts(
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
)

class Config:
frozen = True
Expand Down
10 changes: 7 additions & 3 deletions src/mercoa/commons/types/birth_date.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import typing

from ...core.datetime_utils import serialize_datetime
from ...core.pydantic_utilities import pydantic_v1
from ...core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1


class BirthDate(pydantic_v1.BaseModel):
Expand All @@ -29,8 +29,12 @@ def json(self, **kwargs: typing.Any) -> str:
return super().json(**kwargs_with_defaults)

def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
return super().dict(**kwargs_with_defaults)
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}

return deep_union_pydantic_dicts(
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
)

class Config:
frozen = True
Expand Down
10 changes: 7 additions & 3 deletions src/mercoa/commons/types/full_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import typing

from ...core.datetime_utils import serialize_datetime
from ...core.pydantic_utilities import pydantic_v1
from ...core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1


class FullName(pydantic_v1.BaseModel):
Expand All @@ -31,8 +31,12 @@ def json(self, **kwargs: typing.Any) -> str:
return super().json(**kwargs_with_defaults)

def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
return super().dict(**kwargs_with_defaults)
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}

return deep_union_pydantic_dicts(
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
)

class Config:
frozen = True
Expand Down
10 changes: 7 additions & 3 deletions src/mercoa/commons/types/individual_government_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import typing

from ...core.datetime_utils import serialize_datetime
from ...core.pydantic_utilities import pydantic_v1
from ...core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1


class IndividualGovernmentId(pydantic_v1.BaseModel):
Expand All @@ -28,8 +28,12 @@ def json(self, **kwargs: typing.Any) -> str:
return super().json(**kwargs_with_defaults)

def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
return super().dict(**kwargs_with_defaults)
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}

return deep_union_pydantic_dicts(
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
)

class Config:
frozen = True
Expand Down
10 changes: 7 additions & 3 deletions src/mercoa/commons/types/phone_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import typing

from ...core.datetime_utils import serialize_datetime
from ...core.pydantic_utilities import pydantic_v1
from ...core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1


class PhoneNumber(pydantic_v1.BaseModel):
Expand All @@ -27,8 +27,12 @@ def json(self, **kwargs: typing.Any) -> str:
return super().json(**kwargs_with_defaults)

def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
return super().dict(**kwargs_with_defaults)
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}

return deep_union_pydantic_dicts(
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
)

class Config:
frozen = True
Expand Down
5 changes: 4 additions & 1 deletion src/mercoa/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from .file import File, convert_file_dict_to_httpx_tuples
from .http_client import AsyncHttpClient, HttpClient
from .jsonable_encoder import jsonable_encoder
from .pydantic_utilities import pydantic_v1
from .pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
from .query_encoder import encode_query
from .remove_none_from_dict import remove_none_from_dict
from .request_options import RequestOptions

Expand All @@ -20,6 +21,8 @@
"RequestOptions",
"SyncClientWrapper",
"convert_file_dict_to_httpx_tuples",
"deep_union_pydantic_dicts",
"encode_query",
"jsonable_encoder",
"pydantic_v1",
"remove_none_from_dict",
Expand Down
16 changes: 13 additions & 3 deletions src/mercoa/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ 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.3.37",
"X-Fern-SDK-Version": "v0.3.38",
}
headers["Authorization"] = f"Bearer {self._get_token()}"
return headers
Expand Down Expand Up @@ -51,7 +51,12 @@ def __init__(
httpx_client: httpx.Client,
):
super().__init__(token=token, base_url=base_url, timeout=timeout)
self.httpx_client = HttpClient(httpx_client=httpx_client)
self.httpx_client = HttpClient(
httpx_client=httpx_client,
base_headers=self.get_headers(),
base_timeout=self.get_timeout(),
base_url=self.get_base_url(),
)


class AsyncClientWrapper(BaseClientWrapper):
Expand All @@ -64,4 +69,9 @@ def __init__(
httpx_client: httpx.AsyncClient,
):
super().__init__(token=token, base_url=base_url, timeout=timeout)
self.httpx_client = AsyncHttpClient(httpx_client=httpx_client)
self.httpx_client = AsyncHttpClient(
httpx_client=httpx_client,
base_headers=self.get_headers(),
base_timeout=self.get_timeout(),
base_url=self.get_base_url(),
)
Loading

0 comments on commit 796090f

Please sign in to comment.