Skip to content

Commit

Permalink
Release 0.3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Dec 14, 2023
1 parent 5b605a7 commit b4d7a7a
Show file tree
Hide file tree
Showing 32 changed files with 1,065 additions and 37 deletions.
519 changes: 519 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "mercoa"
version = "v0.3.5"
version = "0.3.6"
description = ""
readme = "README.md"
authors = []
Expand All @@ -11,7 +11,7 @@ packages = [
[tool.poetry.dependencies]
python = "^3.7"
httpx = ">=0.21.2"
pydantic = ">= 1.9.2, < 3"
pydantic = ">= 1.9.2, < 2.5.0"

[tool.poetry.dev-dependencies]
mypy = "0.971"
Expand Down
6 changes: 6 additions & 0 deletions src/mercoa/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
CloudMailinAttachment,
CloudMailinEnvelope,
CloudMailinRequest,
CodatProviderRequest,
ColorSchemeRequest,
ColorSchemeResponse,
CommentId,
Expand Down Expand Up @@ -75,6 +76,8 @@
EntityUserRequest,
EntityUserResponse,
EntityWithPaymentMethodResponse,
ExternalAccountingSystemProviderRequest,
ExternalAccountingSystemProviderRequest_Codat,
FindCounterpartiesResponse,
FindEntityResponse,
FindInvoiceResponse,
Expand Down Expand Up @@ -242,6 +245,7 @@
"CloudMailinAttachment",
"CloudMailinEnvelope",
"CloudMailinRequest",
"CodatProviderRequest",
"ColorSchemeRequest",
"ColorSchemeResponse",
"CommentId",
Expand Down Expand Up @@ -279,6 +283,8 @@
"EntityUserRequest",
"EntityUserResponse",
"EntityWithPaymentMethodResponse",
"ExternalAccountingSystemProviderRequest",
"ExternalAccountingSystemProviderRequest_Codat",
"FindCounterpartiesResponse",
"FindEntityResponse",
"FindInvoiceResponse",
Expand Down
10 changes: 6 additions & 4 deletions src/mercoa/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ def __init__(
base_url: typing.Optional[str] = None,
environment: MercoaEnvironment = MercoaEnvironment.PRODUCTION,
token: typing.Union[str, typing.Callable[[], str]],
timeout: typing.Optional[float] = 60
timeout: typing.Optional[float] = 60,
httpx_client: typing.Optional[httpx.Client] = None
):
self._client_wrapper = SyncClientWrapper(
base_url=_get_base_url(base_url=base_url, environment=environment),
token=token,
httpx_client=httpx.Client(timeout=timeout),
httpx_client=httpx.Client(timeout=timeout) if httpx_client is None else httpx_client,
)
self.entity = EntityClient(client_wrapper=self._client_wrapper)
self.invoice = InvoiceClient(client_wrapper=self._client_wrapper)
Expand All @@ -43,12 +44,13 @@ def __init__(
base_url: typing.Optional[str] = None,
environment: MercoaEnvironment = MercoaEnvironment.PRODUCTION,
token: typing.Union[str, typing.Callable[[], str]],
timeout: typing.Optional[float] = 60
timeout: typing.Optional[float] = 60,
httpx_client: typing.Optional[httpx.AsyncClient] = None
):
self._client_wrapper = AsyncClientWrapper(
base_url=_get_base_url(base_url=base_url, environment=environment),
token=token,
httpx_client=httpx.AsyncClient(timeout=timeout),
httpx_client=httpx.AsyncClient(timeout=timeout) if httpx_client is None else httpx_client,
)
self.entity = AsyncEntityClient(client_wrapper=self._client_wrapper)
self.invoice = AsyncInvoiceClient(client_wrapper=self._client_wrapper)
Expand Down
2 changes: 1 addition & 1 deletion src/mercoa/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,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.5",
"X-Fern-SDK-Version": "0.3.6",
}
headers["Authorization"] = f"Bearer {self._get_token()}"
return headers
Expand Down
6 changes: 6 additions & 0 deletions src/mercoa/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
from .ocr import CloudMailinAttachment, CloudMailinEnvelope, CloudMailinRequest, OcrFailure, OcrResponse
from .organization_types import (
BusinessOnboardingOptions,
CodatProviderRequest,
ColorSchemeRequest,
ColorSchemeResponse,
EmailLogResponse,
Expand All @@ -141,6 +142,8 @@
EmailSenderProvider,
EmailSenderRequest,
EmailSenderResponse,
ExternalAccountingSystemProviderRequest,
ExternalAccountingSystemProviderRequest_Codat,
IndividualOnboardingOptions,
InvoiceNotificationConfigurationRequest,
InvoiceNotificationConfigurationResponse,
Expand Down Expand Up @@ -246,6 +249,7 @@
"CloudMailinAttachment",
"CloudMailinEnvelope",
"CloudMailinRequest",
"CodatProviderRequest",
"ColorSchemeRequest",
"ColorSchemeResponse",
"CommentId",
Expand Down Expand Up @@ -283,6 +287,8 @@
"EntityUserRequest",
"EntityUserResponse",
"EntityWithPaymentMethodResponse",
"ExternalAccountingSystemProviderRequest",
"ExternalAccountingSystemProviderRequest_Codat",
"FindCounterpartiesResponse",
"FindEntityResponse",
"FindInvoiceResponse",
Expand Down
14 changes: 14 additions & 0 deletions src/mercoa/resources/entity/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# This file was auto-generated by Fern from our API Definition.

from .resources import (
CodatCompanyCreationRequest,
CodatCompanyResponse,
ExternalAccountingSystemCompanyCreationRequest,
ExternalAccountingSystemCompanyCreationRequest_Codat,
ExternalAccountingSystemCompanyResponse,
ExternalAccountingSystemCompanyResponse_Codat,
NumApproverLessThanOneError,
NumApproversUserListMismatchError,
approval_policy,
counterparty,
external_accounting_system,
invoice,
metadata,
notification_policy,
Expand All @@ -14,10 +21,17 @@
)

__all__ = [
"CodatCompanyCreationRequest",
"CodatCompanyResponse",
"ExternalAccountingSystemCompanyCreationRequest",
"ExternalAccountingSystemCompanyCreationRequest_Codat",
"ExternalAccountingSystemCompanyResponse",
"ExternalAccountingSystemCompanyResponse_Codat",
"NumApproverLessThanOneError",
"NumApproversUserListMismatchError",
"approval_policy",
"counterparty",
"external_accounting_system",
"invoice",
"metadata",
"notification_policy",
Expand Down
14 changes: 6 additions & 8 deletions src/mercoa/resources/entity/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
from ..entity_types.types.token_generation_options import TokenGenerationOptions
from .resources.approval_policy.client import ApprovalPolicyClient, AsyncApprovalPolicyClient
from .resources.counterparty.client import AsyncCounterpartyClient, CounterpartyClient
from .resources.external_accounting_system.client import (
AsyncExternalAccountingSystemClient,
ExternalAccountingSystemClient,
)
from .resources.invoice.client import AsyncInvoiceClient, InvoiceClient
from .resources.metadata.client import AsyncMetadataClient, MetadataClient
from .resources.notification_policy.client import AsyncNotificationPolicyClient, NotificationPolicyClient
Expand All @@ -52,6 +56,7 @@ def __init__(self, *, client_wrapper: SyncClientWrapper):
self.user = UserClient(client_wrapper=self._client_wrapper)
self.approval_policy = ApprovalPolicyClient(client_wrapper=self._client_wrapper)
self.counterparty = CounterpartyClient(client_wrapper=self._client_wrapper)
self.external_accounting_system = ExternalAccountingSystemClient(client_wrapper=self._client_wrapper)
self.invoice = InvoiceClient(client_wrapper=self._client_wrapper)
self.metadata = MetadataClient(client_wrapper=self._client_wrapper)
self.notification_policy = NotificationPolicyClient(client_wrapper=self._client_wrapper)
Expand All @@ -70,7 +75,6 @@ def find(
name: typing.Optional[str] = None,
limit: typing.Optional[int] = None,
starting_after: typing.Optional[EntityId] = None,
owned_by_org: typing.Optional[bool] = None,
) -> FindEntityResponse:
"""
Search all entities with the given filters. If no filters are provided, all entities will be returned.
Expand All @@ -95,8 +99,6 @@ def find(
- limit: typing.Optional[int]. Number of entities to return. Limit can range between 1 and 100, and the default is 10.
- starting_after: typing.Optional[EntityId]. The ID of the entity to start after. If not provided, the first page of entities will be returned.
- owned_by_org: typing.Optional[bool]. [DEPRECATED - use isCustomer] If true, only entities with a direct relationship to the requesting organization will be returned. If false or not provided, all entities will be returned.
"""
_response = self._client_wrapper.httpx_client.request(
"GET",
Expand All @@ -112,7 +114,6 @@ def find(
"name": name,
"limit": limit,
"startingAfter": starting_after,
"ownedByOrg": owned_by_org,
}
),
headers=self._client_wrapper.get_headers(),
Expand Down Expand Up @@ -528,6 +529,7 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper):
self.user = AsyncUserClient(client_wrapper=self._client_wrapper)
self.approval_policy = AsyncApprovalPolicyClient(client_wrapper=self._client_wrapper)
self.counterparty = AsyncCounterpartyClient(client_wrapper=self._client_wrapper)
self.external_accounting_system = AsyncExternalAccountingSystemClient(client_wrapper=self._client_wrapper)
self.invoice = AsyncInvoiceClient(client_wrapper=self._client_wrapper)
self.metadata = AsyncMetadataClient(client_wrapper=self._client_wrapper)
self.notification_policy = AsyncNotificationPolicyClient(client_wrapper=self._client_wrapper)
Expand All @@ -546,7 +548,6 @@ async def find(
name: typing.Optional[str] = None,
limit: typing.Optional[int] = None,
starting_after: typing.Optional[EntityId] = None,
owned_by_org: typing.Optional[bool] = None,
) -> FindEntityResponse:
"""
Search all entities with the given filters. If no filters are provided, all entities will be returned.
Expand All @@ -571,8 +572,6 @@ async def find(
- limit: typing.Optional[int]. Number of entities to return. Limit can range between 1 and 100, and the default is 10.
- starting_after: typing.Optional[EntityId]. The ID of the entity to start after. If not provided, the first page of entities will be returned.
- owned_by_org: typing.Optional[bool]. [DEPRECATED - use isCustomer] If true, only entities with a direct relationship to the requesting organization will be returned. If false or not provided, all entities will be returned.
"""
_response = await self._client_wrapper.httpx_client.request(
"GET",
Expand All @@ -588,7 +587,6 @@ async def find(
"name": name,
"limit": limit,
"startingAfter": starting_after,
"ownedByOrg": owned_by_org,
}
),
headers=self._client_wrapper.get_headers(),
Expand Down
16 changes: 16 additions & 0 deletions src/mercoa/resources/entity/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from . import (
approval_policy,
counterparty,
external_accounting_system,
invoice,
metadata,
notification_policy,
Expand All @@ -11,12 +12,27 @@
user,
)
from .approval_policy import NumApproverLessThanOneError, NumApproversUserListMismatchError
from .external_accounting_system import (
CodatCompanyCreationRequest,
CodatCompanyResponse,
ExternalAccountingSystemCompanyCreationRequest,
ExternalAccountingSystemCompanyCreationRequest_Codat,
ExternalAccountingSystemCompanyResponse,
ExternalAccountingSystemCompanyResponse_Codat,
)

__all__ = [
"CodatCompanyCreationRequest",
"CodatCompanyResponse",
"ExternalAccountingSystemCompanyCreationRequest",
"ExternalAccountingSystemCompanyCreationRequest_Codat",
"ExternalAccountingSystemCompanyResponse",
"ExternalAccountingSystemCompanyResponse_Codat",
"NumApproverLessThanOneError",
"NumApproversUserListMismatchError",
"approval_policy",
"counterparty",
"external_accounting_system",
"invoice",
"metadata",
"notification_policy",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This file was auto-generated by Fern from our API Definition.

from .types import (
CodatCompanyCreationRequest,
CodatCompanyResponse,
ExternalAccountingSystemCompanyCreationRequest,
ExternalAccountingSystemCompanyCreationRequest_Codat,
ExternalAccountingSystemCompanyResponse,
ExternalAccountingSystemCompanyResponse_Codat,
)

__all__ = [
"CodatCompanyCreationRequest",
"CodatCompanyResponse",
"ExternalAccountingSystemCompanyCreationRequest",
"ExternalAccountingSystemCompanyCreationRequest_Codat",
"ExternalAccountingSystemCompanyResponse",
"ExternalAccountingSystemCompanyResponse_Codat",
]
Loading

0 comments on commit b4d7a7a

Please sign in to comment.