Skip to content

Bump SDK to match Merge API, April 2024 #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 22, 2024
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
270 changes: 135 additions & 135 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "MergePythonClient"
version = "1.0.7"
version = "1.0.8"
description = ""
readme = "README.md"
authors = []
Expand Down
2 changes: 1 addition & 1 deletion src/merge/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def get_headers(self) -> typing.Dict[str, str]:
headers: typing.Dict[str, str] = {
"X-Fern-Language": "Python",
"X-Fern-SDK-Name": "MergePythonClient",
"X-Fern-SDK-Version": "1.0.7",
"X-Fern-SDK-Version": "1.0.8",
}
if self._account_token is not None:
headers["X-Account-Token"] = self._account_token
Expand Down
6 changes: 3 additions & 3 deletions src/merge/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@


class MergeEnvironment(enum.Enum):
PRODUCTION = "https://api.merge.dev"
SANDBOX = "https://api-sandbox.merge.dev"
PRODUCTION_EU = "https://api-eu.merge.dev"
PRODUCTION = "https://api.merge.dev/api"
SANDBOX = "https://api-sandbox.merge.dev/api"
PRODUCTION_EU = "https://api-eu.merge.dev/api"
16 changes: 16 additions & 0 deletions src/merge/resources/accounting/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,14 @@
PaginatedTrackingCategoryList,
PaginatedTransactionList,
PaginatedVendorCreditList,
PatchedPaymentRequest,
PatchedPaymentRequestAccount,
PatchedPaymentRequestAccountingPeriod,
PatchedPaymentRequestAppliedToLinesItem,
PatchedPaymentRequestCompany,
PatchedPaymentRequestContact,
PatchedPaymentRequestCurrency,
PatchedPaymentRequestTrackingCategoriesItem,
Payment,
PaymentAccount,
PaymentAccountingPeriod,
Expand Down Expand Up @@ -652,6 +660,14 @@
"PaginatedTrackingCategoryList",
"PaginatedTransactionList",
"PaginatedVendorCreditList",
"PatchedPaymentRequest",
"PatchedPaymentRequestAccount",
"PatchedPaymentRequestAccountingPeriod",
"PatchedPaymentRequestAppliedToLinesItem",
"PatchedPaymentRequestCompany",
"PatchedPaymentRequestContact",
"PatchedPaymentRequestCurrency",
"PatchedPaymentRequestTrackingCategoriesItem",
"Payment",
"PaymentAccount",
"PaymentAccountingPeriod",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def retrieve(self, *, request_options: typing.Optional[RequestOptions] = None) -
"""
_response = self._client_wrapper.httpx_client.request(
"GET",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/accounting/v1/account-details"),
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "accounting/v1/account-details"),
params=jsonable_encoder(
request_options.get("additional_query_parameters") if request_options is not None else None
),
Expand Down Expand Up @@ -84,7 +84,7 @@ async def retrieve(self, *, request_options: typing.Optional[RequestOptions] = N
"""
_response = await self._client_wrapper.httpx_client.request(
"GET",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/accounting/v1/account-details"),
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "accounting/v1/account-details"),
params=jsonable_encoder(
request_options.get("additional_query_parameters") if request_options is not None else None
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ def retrieve(self, public_token: str, *, request_options: typing.Optional[Reques
api_key="YOUR_API_KEY",
)
client.accounting.account_token.retrieve(
public_token="string",
public_token="public_token",
)
"""
_response = self._client_wrapper.httpx_client.request(
"GET",
urllib.parse.urljoin(
f"{self._client_wrapper.get_base_url()}/", f"api/accounting/v1/account-token/{public_token}"
f"{self._client_wrapper.get_base_url()}/", f"accounting/v1/account-token/{public_token}"
),
params=jsonable_encoder(
request_options.get("additional_query_parameters") if request_options is not None else None
Expand Down Expand Up @@ -91,13 +91,13 @@ async def retrieve(
api_key="YOUR_API_KEY",
)
await client.accounting.account_token.retrieve(
public_token="string",
public_token="public_token",
)
"""
_response = await self._client_wrapper.httpx_client.request(
"GET",
urllib.parse.urljoin(
f"{self._client_wrapper.get_base_url()}/", f"api/accounting/v1/account-token/{public_token}"
f"{self._client_wrapper.get_base_url()}/", f"accounting/v1/account-token/{public_token}"
),
params=jsonable_encoder(
request_options.get("additional_query_parameters") if request_options is not None else None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def list(
"""
_response = self._client_wrapper.httpx_client.request(
"GET",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/accounting/v1/accounting-periods"),
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "accounting/v1/accounting-periods"),
params=jsonable_encoder(
remove_none_from_dict(
{
Expand Down Expand Up @@ -115,14 +115,12 @@ def retrieve(
api_key="YOUR_API_KEY",
)
client.accounting.accounting_periods.retrieve(
id="string",
id="id",
)
"""
_response = self._client_wrapper.httpx_client.request(
"GET",
urllib.parse.urljoin(
f"{self._client_wrapper.get_base_url()}/", f"api/accounting/v1/accounting-periods/{id}"
),
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"accounting/v1/accounting-periods/{id}"),
params=jsonable_encoder(
remove_none_from_dict(
{
Expand Down Expand Up @@ -193,7 +191,7 @@ async def list(
"""
_response = await self._client_wrapper.httpx_client.request(
"GET",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/accounting/v1/accounting-periods"),
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "accounting/v1/accounting-periods"),
params=jsonable_encoder(
remove_none_from_dict(
{
Expand Down Expand Up @@ -253,14 +251,12 @@ async def retrieve(
api_key="YOUR_API_KEY",
)
await client.accounting.accounting_periods.retrieve(
id="string",
id="id",
)
"""
_response = await self._client_wrapper.httpx_client.request(
"GET",
urllib.parse.urljoin(
f"{self._client_wrapper.get_base_url()}/", f"api/accounting/v1/accounting-periods/{id}"
),
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"accounting/v1/accounting-periods/{id}"),
params=jsonable_encoder(
remove_none_from_dict(
{
Expand Down
80 changes: 18 additions & 62 deletions src/merge/resources/accounting/resources/accounts/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,29 +80,21 @@ def list(

- remote_id: typing.Optional[str]. The API provider's ID for the given object.

- show_enum_origins: typing.Optional[AccountsListRequestShowEnumOrigins]. Which fields should be returned in non-normalized form.
- show_enum_origins: typing.Optional[AccountsListRequestShowEnumOrigins]. A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter)

- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
---
from merge.client import Merge
from merge.resources.accounting import (
AccountsListRequestRemoteFields,
AccountsListRequestShowEnumOrigins,
)

client = Merge(
account_token="YOUR_ACCOUNT_TOKEN",
api_key="YOUR_API_KEY",
)
client.accounting.accounts.list(
expand="company",
remote_fields=AccountsListRequestRemoteFields.CLASSIFICATION,
show_enum_origins=AccountsListRequestShowEnumOrigins.CLASSIFICATION,
)
client.accounting.accounts.list()
"""
_response = self._client_wrapper.httpx_client.request(
"GET",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/accounting/v1/accounts"),
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "accounting/v1/accounts"),
params=jsonable_encoder(
remove_none_from_dict(
{
Expand Down Expand Up @@ -175,19 +167,12 @@ def create(
api_key="YOUR_API_KEY",
)
client.accounting.accounts.create(
model=AccountRequest(
name="Cash",
description="Cash",
type="Asset",
account_number="X12Y9AB",
parent_account="22d92d6c-22f9-11ed-861d-0242ac120002",
company="595c8f97-2ac4-45b7-b000-41bdf43240b5",
),
model=AccountRequest(),
)
"""
_response = self._client_wrapper.httpx_client.request(
"POST",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/accounting/v1/accounts"),
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "accounting/v1/accounts"),
params=jsonable_encoder(
remove_none_from_dict(
{
Expand Down Expand Up @@ -249,30 +234,23 @@ def retrieve(

- remote_fields: typing.Optional[AccountsRetrieveRequestRemoteFields]. Deprecated. Use show_enum_origins.

- show_enum_origins: typing.Optional[AccountsRetrieveRequestShowEnumOrigins]. Which fields should be returned in non-normalized form.
- show_enum_origins: typing.Optional[AccountsRetrieveRequestShowEnumOrigins]. A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter)

- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
---
from merge.client import Merge
from merge.resources.accounting import (
AccountsRetrieveRequestRemoteFields,
AccountsRetrieveRequestShowEnumOrigins,
)

client = Merge(
account_token="YOUR_ACCOUNT_TOKEN",
api_key="YOUR_API_KEY",
)
client.accounting.accounts.retrieve(
id="string",
expand="company",
remote_fields=AccountsRetrieveRequestRemoteFields.CLASSIFICATION,
show_enum_origins=AccountsRetrieveRequestShowEnumOrigins.CLASSIFICATION,
id="id",
)
"""
_response = self._client_wrapper.httpx_client.request(
"GET",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/accounting/v1/accounts/{id}"),
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"accounting/v1/accounts/{id}"),
params=jsonable_encoder(
remove_none_from_dict(
{
Expand Down Expand Up @@ -325,7 +303,7 @@ def meta_post_retrieve(self, *, request_options: typing.Optional[RequestOptions]
"""
_response = self._client_wrapper.httpx_client.request(
"GET",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/accounting/v1/accounts/meta/post"),
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "accounting/v1/accounts/meta/post"),
params=jsonable_encoder(
request_options.get("additional_query_parameters") if request_options is not None else None
),
Expand Down Expand Up @@ -400,29 +378,21 @@ async def list(

- remote_id: typing.Optional[str]. The API provider's ID for the given object.

- show_enum_origins: typing.Optional[AccountsListRequestShowEnumOrigins]. Which fields should be returned in non-normalized form.
- show_enum_origins: typing.Optional[AccountsListRequestShowEnumOrigins]. A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter)

- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
---
from merge.client import AsyncMerge
from merge.resources.accounting import (
AccountsListRequestRemoteFields,
AccountsListRequestShowEnumOrigins,
)

client = AsyncMerge(
account_token="YOUR_ACCOUNT_TOKEN",
api_key="YOUR_API_KEY",
)
await client.accounting.accounts.list(
expand="company",
remote_fields=AccountsListRequestRemoteFields.CLASSIFICATION,
show_enum_origins=AccountsListRequestShowEnumOrigins.CLASSIFICATION,
)
await client.accounting.accounts.list()
"""
_response = await self._client_wrapper.httpx_client.request(
"GET",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/accounting/v1/accounts"),
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "accounting/v1/accounts"),
params=jsonable_encoder(
remove_none_from_dict(
{
Expand Down Expand Up @@ -495,19 +465,12 @@ async def create(
api_key="YOUR_API_KEY",
)
await client.accounting.accounts.create(
model=AccountRequest(
name="Cash",
description="Cash",
type="Asset",
account_number="X12Y9AB",
parent_account="22d92d6c-22f9-11ed-861d-0242ac120002",
company="595c8f97-2ac4-45b7-b000-41bdf43240b5",
),
model=AccountRequest(),
)
"""
_response = await self._client_wrapper.httpx_client.request(
"POST",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/accounting/v1/accounts"),
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "accounting/v1/accounts"),
params=jsonable_encoder(
remove_none_from_dict(
{
Expand Down Expand Up @@ -569,30 +532,23 @@ async def retrieve(

- remote_fields: typing.Optional[AccountsRetrieveRequestRemoteFields]. Deprecated. Use show_enum_origins.

- show_enum_origins: typing.Optional[AccountsRetrieveRequestShowEnumOrigins]. Which fields should be returned in non-normalized form.
- show_enum_origins: typing.Optional[AccountsRetrieveRequestShowEnumOrigins]. A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter)

- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
---
from merge.client import AsyncMerge
from merge.resources.accounting import (
AccountsRetrieveRequestRemoteFields,
AccountsRetrieveRequestShowEnumOrigins,
)

client = AsyncMerge(
account_token="YOUR_ACCOUNT_TOKEN",
api_key="YOUR_API_KEY",
)
await client.accounting.accounts.retrieve(
id="string",
expand="company",
remote_fields=AccountsRetrieveRequestRemoteFields.CLASSIFICATION,
show_enum_origins=AccountsRetrieveRequestShowEnumOrigins.CLASSIFICATION,
id="id",
)
"""
_response = await self._client_wrapper.httpx_client.request(
"GET",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/accounting/v1/accounts/{id}"),
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"accounting/v1/accounts/{id}"),
params=jsonable_encoder(
remove_none_from_dict(
{
Expand Down Expand Up @@ -645,7 +601,7 @@ async def meta_post_retrieve(self, *, request_options: typing.Optional[RequestOp
"""
_response = await self._client_wrapper.httpx_client.request(
"GET",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/accounting/v1/accounts/meta/post"),
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "accounting/v1/accounts/meta/post"),
params=jsonable_encoder(
request_options.get("additional_query_parameters") if request_options is not None else None
),
Expand Down
Loading
Loading