mergepythonclient 1.0.5__py3-none-any.whl → 1.0.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- merge/core/__init__.py +2 -0
- merge/core/client_wrapper.py +1 -1
- merge/core/request_options.py +29 -0
- merge/resources/accounting/resources/account_details/client.py +38 -6
- merge/resources/accounting/resources/account_token/client.py +60 -6
- merge/resources/accounting/resources/accounting_periods/client.py +124 -28
- merge/resources/accounting/resources/accounts/client.py +241 -80
- merge/resources/accounting/resources/addresses/client.py +66 -28
- merge/resources/accounting/resources/async_passthrough/client.py +110 -32
- merge/resources/accounting/resources/attachments/client.py +235 -54
- merge/resources/accounting/resources/audit_trail/client.py +62 -22
- merge/resources/accounting/resources/available_actions/client.py +56 -6
- merge/resources/accounting/resources/balance_sheets/client.py +136 -50
- merge/resources/accounting/resources/cash_flow_statements/client.py +136 -50
- merge/resources/accounting/resources/company_info/client.py +126 -38
- merge/resources/accounting/resources/contacts/client.py +255 -112
- merge/resources/accounting/resources/credit_notes/client.py +146 -68
- merge/resources/accounting/resources/delete_account/client.py +44 -6
- merge/resources/accounting/resources/expenses/client.py +241 -86
- merge/resources/accounting/resources/force_resync/client.py +47 -6
- merge/resources/accounting/resources/generate_key/client.py +48 -8
- merge/resources/accounting/resources/income_statements/client.py +136 -50
- merge/resources/accounting/resources/invoices/client.py +271 -130
- merge/resources/accounting/resources/issues/client.py +130 -62
- merge/resources/accounting/resources/items/client.py +150 -74
- merge/resources/accounting/resources/journal_entries/client.py +243 -92
- merge/resources/accounting/resources/link_token/client.py +74 -6
- merge/resources/accounting/resources/linked_accounts/client.py +76 -36
- merge/resources/accounting/resources/passthrough/client.py +92 -8
- merge/resources/accounting/resources/payments/client.py +243 -70
- merge/resources/accounting/resources/phone_numbers/client.py +68 -10
- merge/resources/accounting/resources/purchase_orders/client.py +265 -132
- merge/resources/accounting/resources/regenerate_key/client.py +48 -8
- merge/resources/accounting/resources/selective_sync/client.py +149 -36
- merge/resources/accounting/resources/sync_status/client.py +64 -8
- merge/resources/accounting/resources/tax_rates/client.py +136 -50
- merge/resources/accounting/resources/tracking_categories/client.py +158 -82
- merge/resources/accounting/resources/transactions/client.py +140 -52
- merge/resources/accounting/resources/vendor_credits/client.py +140 -52
- merge/resources/accounting/resources/webhook_receivers/client.py +118 -14
- merge/resources/ats/resources/account_details/client.py +38 -6
- merge/resources/ats/resources/account_token/client.py +60 -6
- merge/resources/ats/resources/activities/client.py +273 -80
- merge/resources/ats/resources/applications/client.py +379 -76
- merge/resources/ats/resources/async_passthrough/client.py +110 -32
- merge/resources/ats/resources/attachments/client.py +289 -96
- merge/resources/ats/resources/audit_trail/client.py +62 -22
- merge/resources/ats/resources/available_actions/client.py +56 -6
- merge/resources/ats/resources/candidates/client.py +505 -90
- merge/resources/ats/resources/delete_account/client.py +44 -6
- merge/resources/ats/resources/departments/client.py +134 -38
- merge/resources/ats/resources/eeocs/client.py +142 -66
- merge/resources/ats/resources/force_resync/client.py +47 -6
- merge/resources/ats/resources/generate_key/client.py +48 -8
- merge/resources/ats/resources/interviews/client.py +299 -94
- merge/resources/ats/resources/issues/client.py +130 -62
- merge/resources/ats/resources/job_interview_stages/client.py +136 -50
- merge/resources/ats/resources/jobs/client.py +216 -102
- merge/resources/ats/resources/link_token/client.py +74 -6
- merge/resources/ats/resources/linked_accounts/client.py +76 -36
- merge/resources/ats/resources/offers/client.py +152 -76
- merge/resources/ats/resources/offices/client.py +134 -38
- merge/resources/ats/resources/passthrough/client.py +92 -8
- merge/resources/ats/resources/regenerate_key/client.py +48 -8
- merge/resources/ats/resources/reject_reasons/client.py +134 -38
- merge/resources/ats/resources/scorecards/client.py +154 -78
- merge/resources/ats/resources/selective_sync/client.py +149 -32
- merge/resources/ats/resources/sync_status/client.py +64 -8
- merge/resources/ats/resources/tags/client.py +68 -28
- merge/resources/ats/resources/users/client.py +146 -70
- merge/resources/ats/resources/webhook_receivers/client.py +118 -14
- merge/resources/crm/resources/account_details/client.py +38 -6
- merge/resources/crm/resources/account_token/client.py +60 -6
- merge/resources/crm/resources/accounts/client.py +411 -124
- merge/resources/crm/resources/association_types/client.py +291 -68
- merge/resources/crm/resources/associations/client.py +150 -58
- merge/resources/crm/resources/async_passthrough/client.py +110 -32
- merge/resources/crm/resources/audit_trail/client.py +62 -22
- merge/resources/crm/resources/available_actions/client.py +56 -6
- merge/resources/crm/resources/contacts/client.py +465 -230
- merge/resources/crm/resources/custom_object_classes/client.py +134 -48
- merge/resources/crm/resources/custom_objects/client.py +275 -76
- merge/resources/crm/resources/delete_account/client.py +44 -6
- merge/resources/crm/resources/engagement_types/client.py +182 -60
- merge/resources/crm/resources/engagements/client.py +398 -109
- merge/resources/crm/resources/force_resync/client.py +47 -6
- merge/resources/crm/resources/generate_key/client.py +48 -8
- merge/resources/crm/resources/issues/client.py +130 -62
- merge/resources/crm/resources/leads/client.py +297 -148
- merge/resources/crm/resources/link_token/client.py +74 -6
- merge/resources/crm/resources/linked_accounts/client.py +76 -36
- merge/resources/crm/resources/notes/client.py +293 -92
- merge/resources/crm/resources/opportunities/client.py +434 -147
- merge/resources/crm/resources/passthrough/client.py +92 -8
- merge/resources/crm/resources/regenerate_key/client.py +48 -8
- merge/resources/crm/resources/selective_sync/client.py +149 -32
- merge/resources/crm/resources/stages/client.py +182 -60
- merge/resources/crm/resources/sync_status/client.py +64 -8
- merge/resources/crm/resources/tasks/client.py +395 -106
- merge/resources/crm/resources/users/client.py +241 -70
- merge/resources/crm/resources/webhook_receivers/client.py +118 -14
- merge/resources/filestorage/resources/account_details/client.py +38 -6
- merge/resources/filestorage/resources/account_token/client.py +60 -6
- merge/resources/filestorage/resources/async_passthrough/client.py +110 -32
- merge/resources/filestorage/resources/audit_trail/client.py +62 -22
- merge/resources/filestorage/resources/available_actions/client.py +56 -6
- merge/resources/filestorage/resources/delete_account/client.py +44 -6
- merge/resources/filestorage/resources/drives/client.py +136 -40
- merge/resources/filestorage/resources/files/client.py +295 -68
- merge/resources/filestorage/resources/folders/client.py +233 -60
- merge/resources/filestorage/resources/force_resync/client.py +47 -6
- merge/resources/filestorage/resources/generate_key/client.py +48 -8
- merge/resources/filestorage/resources/groups/client.py +134 -38
- merge/resources/filestorage/resources/issues/client.py +130 -62
- merge/resources/filestorage/resources/link_token/client.py +74 -6
- merge/resources/filestorage/resources/linked_accounts/client.py +76 -36
- merge/resources/filestorage/resources/passthrough/client.py +92 -8
- merge/resources/filestorage/resources/regenerate_key/client.py +48 -8
- merge/resources/filestorage/resources/selective_sync/client.py +149 -36
- merge/resources/filestorage/resources/sync_status/client.py +64 -8
- merge/resources/filestorage/resources/users/client.py +136 -40
- merge/resources/filestorage/resources/webhook_receivers/client.py +118 -14
- merge/resources/hris/resources/account_details/client.py +38 -6
- merge/resources/hris/resources/account_token/client.py +60 -6
- merge/resources/hris/resources/async_passthrough/client.py +110 -32
- merge/resources/hris/resources/audit_trail/client.py +62 -22
- merge/resources/hris/resources/available_actions/client.py +56 -6
- merge/resources/hris/resources/bank_info/client.py +164 -88
- merge/resources/hris/resources/benefits/client.py +136 -50
- merge/resources/hris/resources/companies/client.py +134 -38
- merge/resources/hris/resources/delete_account/client.py +44 -6
- merge/resources/hris/resources/dependents/client.py +124 -40
- merge/resources/hris/resources/employee_payroll_runs/client.py +138 -50
- merge/resources/hris/resources/employees/client.py +359 -122
- merge/resources/hris/resources/employer_benefits/client.py +134 -38
- merge/resources/hris/resources/employments/client.py +136 -58
- merge/resources/hris/resources/force_resync/client.py +47 -6
- merge/resources/hris/resources/generate_key/client.py +48 -8
- merge/resources/hris/resources/groups/client.py +146 -70
- merge/resources/hris/resources/issues/client.py +130 -62
- merge/resources/hris/resources/link_token/client.py +74 -6
- merge/resources/hris/resources/linked_accounts/client.py +76 -36
- merge/resources/hris/resources/locations/client.py +146 -70
- merge/resources/hris/resources/passthrough/client.py +92 -8
- merge/resources/hris/resources/pay_groups/client.py +134 -38
- merge/resources/hris/resources/payroll_runs/client.py +138 -60
- merge/resources/hris/resources/regenerate_key/client.py +48 -8
- merge/resources/hris/resources/selective_sync/client.py +149 -32
- merge/resources/hris/resources/sync_status/client.py +64 -8
- merge/resources/hris/resources/teams/client.py +136 -50
- merge/resources/hris/resources/time_off/client.py +241 -78
- merge/resources/hris/resources/time_off_balances/client.py +160 -84
- merge/resources/hris/resources/timesheet_entries/client.py +245 -64
- merge/resources/hris/resources/webhook_receivers/client.py +118 -14
- merge/resources/ticketing/resources/account_details/client.py +38 -6
- merge/resources/ticketing/resources/account_token/client.py +60 -6
- merge/resources/ticketing/resources/accounts/client.py +134 -38
- merge/resources/ticketing/resources/async_passthrough/client.py +110 -32
- merge/resources/ticketing/resources/attachments/client.py +303 -78
- merge/resources/ticketing/resources/audit_trail/client.py +62 -22
- merge/resources/ticketing/resources/available_actions/client.py +56 -6
- merge/resources/ticketing/resources/collections/client.py +220 -106
- merge/resources/ticketing/resources/comments/client.py +233 -60
- merge/resources/ticketing/resources/contacts/client.py +134 -48
- merge/resources/ticketing/resources/delete_account/client.py +44 -6
- merge/resources/ticketing/resources/force_resync/client.py +47 -6
- merge/resources/ticketing/resources/generate_key/client.py +48 -8
- merge/resources/ticketing/resources/issues/client.py +130 -62
- merge/resources/ticketing/resources/link_token/client.py +74 -6
- merge/resources/ticketing/resources/linked_accounts/client.py +76 -36
- merge/resources/ticketing/resources/passthrough/client.py +92 -8
- merge/resources/ticketing/resources/projects/client.py +194 -60
- merge/resources/ticketing/resources/regenerate_key/client.py +48 -8
- merge/resources/ticketing/resources/roles/client.py +134 -38
- merge/resources/ticketing/resources/selective_sync/client.py +149 -36
- merge/resources/ticketing/resources/sync_status/client.py +64 -8
- merge/resources/ticketing/resources/tags/client.py +134 -38
- merge/resources/ticketing/resources/teams/client.py +134 -38
- merge/resources/ticketing/resources/tickets/client.py +513 -182
- merge/resources/ticketing/resources/users/client.py +128 -40
- merge/resources/ticketing/resources/webhook_receivers/client.py +118 -14
- {mergepythonclient-1.0.5.dist-info → mergepythonclient-1.0.6.dist-info}/METADATA +4 -5
- {mergepythonclient-1.0.5.dist-info → mergepythonclient-1.0.6.dist-info}/RECORD +185 -184
- {mergepythonclient-1.0.5.dist-info → mergepythonclient-1.0.6.dist-info}/LICENSE.md +0 -0
- {mergepythonclient-1.0.5.dist-info → mergepythonclient-1.0.6.dist-info}/WHEEL +0 -0
merge/core/__init__.py
CHANGED
|
@@ -5,11 +5,13 @@ from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWra
|
|
|
5
5
|
from .datetime_utils import serialize_datetime
|
|
6
6
|
from .jsonable_encoder import jsonable_encoder
|
|
7
7
|
from .remove_none_from_dict import remove_none_from_dict
|
|
8
|
+
from .request_options import RequestOptions
|
|
8
9
|
|
|
9
10
|
__all__ = [
|
|
10
11
|
"ApiError",
|
|
11
12
|
"AsyncClientWrapper",
|
|
12
13
|
"BaseClientWrapper",
|
|
14
|
+
"RequestOptions",
|
|
13
15
|
"SyncClientWrapper",
|
|
14
16
|
"jsonable_encoder",
|
|
15
17
|
"remove_none_from_dict",
|
merge/core/client_wrapper.py
CHANGED
|
@@ -21,7 +21,7 @@ class BaseClientWrapper:
|
|
|
21
21
|
headers: typing.Dict[str, str] = {
|
|
22
22
|
"X-Fern-Language": "Python",
|
|
23
23
|
"X-Fern-SDK-Name": "MergePythonClient",
|
|
24
|
-
"X-Fern-SDK-Version": "1.0.
|
|
24
|
+
"X-Fern-SDK-Version": "1.0.6",
|
|
25
25
|
}
|
|
26
26
|
if self._account_token is not None:
|
|
27
27
|
headers["X-Account-Token"] = self._account_token
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
try:
|
|
6
|
+
from typing import NotRequired # type: ignore
|
|
7
|
+
except ImportError:
|
|
8
|
+
from typing_extensions import NotRequired # type: ignore
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class RequestOptions(typing.TypedDict):
|
|
12
|
+
"""
|
|
13
|
+
Additional options for request-specific configuration when calling APIs via the SDK.
|
|
14
|
+
This is used primarily as an optional final parameter for service functions.
|
|
15
|
+
|
|
16
|
+
Attributes:
|
|
17
|
+
- timeout_in_seconds: int. The number of seconds to await an API call before timing out.
|
|
18
|
+
|
|
19
|
+
- additional_headers: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's header dict
|
|
20
|
+
|
|
21
|
+
- additional_query_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's query parameters dict
|
|
22
|
+
|
|
23
|
+
- additional_body_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's body parameters dict
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
timeout_in_seconds: NotRequired[int]
|
|
27
|
+
additional_headers: NotRequired[typing.Dict[str, typing.Any]]
|
|
28
|
+
additional_query_parameters: NotRequired[typing.Dict[str, typing.Any]]
|
|
29
|
+
additional_body_parameters: NotRequired[typing.Dict[str, typing.Any]]
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
+
import typing
|
|
3
4
|
import urllib.parse
|
|
4
5
|
from json.decoder import JSONDecodeError
|
|
5
6
|
|
|
6
7
|
from .....core.api_error import ApiError
|
|
7
8
|
from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
9
|
+
from .....core.jsonable_encoder import jsonable_encoder
|
|
10
|
+
from .....core.remove_none_from_dict import remove_none_from_dict
|
|
11
|
+
from .....core.request_options import RequestOptions
|
|
8
12
|
from ...types.account_details import AccountDetails
|
|
9
13
|
|
|
10
14
|
try:
|
|
@@ -17,10 +21,12 @@ class AccountDetailsClient:
|
|
|
17
21
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
18
22
|
self._client_wrapper = client_wrapper
|
|
19
23
|
|
|
20
|
-
def retrieve(self) -> AccountDetails:
|
|
24
|
+
def retrieve(self, *, request_options: typing.Optional[RequestOptions] = None) -> AccountDetails:
|
|
21
25
|
"""
|
|
22
26
|
Get details for a linked account.
|
|
23
27
|
|
|
28
|
+
Parameters:
|
|
29
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
|
24
30
|
---
|
|
25
31
|
from merge.client import Merge
|
|
26
32
|
|
|
@@ -33,8 +39,20 @@ class AccountDetailsClient:
|
|
|
33
39
|
_response = self._client_wrapper.httpx_client.request(
|
|
34
40
|
"GET",
|
|
35
41
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/accounting/v1/account-details"),
|
|
36
|
-
|
|
37
|
-
|
|
42
|
+
params=jsonable_encoder(
|
|
43
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
|
44
|
+
),
|
|
45
|
+
headers=jsonable_encoder(
|
|
46
|
+
remove_none_from_dict(
|
|
47
|
+
{
|
|
48
|
+
**self._client_wrapper.get_headers(),
|
|
49
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
),
|
|
53
|
+
timeout=request_options.get("timeout_in_seconds")
|
|
54
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
|
55
|
+
else 60,
|
|
38
56
|
)
|
|
39
57
|
if 200 <= _response.status_code < 300:
|
|
40
58
|
return pydantic.parse_obj_as(AccountDetails, _response.json()) # type: ignore
|
|
@@ -49,10 +67,12 @@ class AsyncAccountDetailsClient:
|
|
|
49
67
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
50
68
|
self._client_wrapper = client_wrapper
|
|
51
69
|
|
|
52
|
-
async def retrieve(self) -> AccountDetails:
|
|
70
|
+
async def retrieve(self, *, request_options: typing.Optional[RequestOptions] = None) -> AccountDetails:
|
|
53
71
|
"""
|
|
54
72
|
Get details for a linked account.
|
|
55
73
|
|
|
74
|
+
Parameters:
|
|
75
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
|
56
76
|
---
|
|
57
77
|
from merge.client import AsyncMerge
|
|
58
78
|
|
|
@@ -65,8 +85,20 @@ class AsyncAccountDetailsClient:
|
|
|
65
85
|
_response = await self._client_wrapper.httpx_client.request(
|
|
66
86
|
"GET",
|
|
67
87
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/accounting/v1/account-details"),
|
|
68
|
-
|
|
69
|
-
|
|
88
|
+
params=jsonable_encoder(
|
|
89
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
|
90
|
+
),
|
|
91
|
+
headers=jsonable_encoder(
|
|
92
|
+
remove_none_from_dict(
|
|
93
|
+
{
|
|
94
|
+
**self._client_wrapper.get_headers(),
|
|
95
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
),
|
|
99
|
+
timeout=request_options.get("timeout_in_seconds")
|
|
100
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
|
101
|
+
else 60,
|
|
70
102
|
)
|
|
71
103
|
if 200 <= _response.status_code < 300:
|
|
72
104
|
return pydantic.parse_obj_as(AccountDetails, _response.json()) # type: ignore
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
+
import typing
|
|
3
4
|
import urllib.parse
|
|
4
5
|
from json.decoder import JSONDecodeError
|
|
5
6
|
|
|
6
7
|
from .....core.api_error import ApiError
|
|
7
8
|
from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
9
|
+
from .....core.jsonable_encoder import jsonable_encoder
|
|
10
|
+
from .....core.remove_none_from_dict import remove_none_from_dict
|
|
11
|
+
from .....core.request_options import RequestOptions
|
|
8
12
|
from ...types.account_token import AccountToken
|
|
9
13
|
|
|
10
14
|
try:
|
|
@@ -17,20 +21,44 @@ class AccountTokenClient:
|
|
|
17
21
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
18
22
|
self._client_wrapper = client_wrapper
|
|
19
23
|
|
|
20
|
-
def retrieve(self, public_token: str) -> AccountToken:
|
|
24
|
+
def retrieve(self, public_token: str, *, request_options: typing.Optional[RequestOptions] = None) -> AccountToken:
|
|
21
25
|
"""
|
|
22
26
|
Returns the account token for the end user with the provided public token.
|
|
23
27
|
|
|
24
28
|
Parameters:
|
|
25
29
|
- public_token: str.
|
|
30
|
+
|
|
31
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
|
32
|
+
---
|
|
33
|
+
from merge.client import Merge
|
|
34
|
+
|
|
35
|
+
client = Merge(
|
|
36
|
+
account_token="YOUR_ACCOUNT_TOKEN",
|
|
37
|
+
api_key="YOUR_API_KEY",
|
|
38
|
+
)
|
|
39
|
+
client.accounting.account_token.retrieve(
|
|
40
|
+
public_token="string",
|
|
41
|
+
)
|
|
26
42
|
"""
|
|
27
43
|
_response = self._client_wrapper.httpx_client.request(
|
|
28
44
|
"GET",
|
|
29
45
|
urllib.parse.urljoin(
|
|
30
46
|
f"{self._client_wrapper.get_base_url()}/", f"api/accounting/v1/account-token/{public_token}"
|
|
31
47
|
),
|
|
32
|
-
|
|
33
|
-
|
|
48
|
+
params=jsonable_encoder(
|
|
49
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
|
50
|
+
),
|
|
51
|
+
headers=jsonable_encoder(
|
|
52
|
+
remove_none_from_dict(
|
|
53
|
+
{
|
|
54
|
+
**self._client_wrapper.get_headers(),
|
|
55
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
),
|
|
59
|
+
timeout=request_options.get("timeout_in_seconds")
|
|
60
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
|
61
|
+
else 60,
|
|
34
62
|
)
|
|
35
63
|
if 200 <= _response.status_code < 300:
|
|
36
64
|
return pydantic.parse_obj_as(AccountToken, _response.json()) # type: ignore
|
|
@@ -45,20 +73,46 @@ class AsyncAccountTokenClient:
|
|
|
45
73
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
46
74
|
self._client_wrapper = client_wrapper
|
|
47
75
|
|
|
48
|
-
async def retrieve(
|
|
76
|
+
async def retrieve(
|
|
77
|
+
self, public_token: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
78
|
+
) -> AccountToken:
|
|
49
79
|
"""
|
|
50
80
|
Returns the account token for the end user with the provided public token.
|
|
51
81
|
|
|
52
82
|
Parameters:
|
|
53
83
|
- public_token: str.
|
|
84
|
+
|
|
85
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
|
86
|
+
---
|
|
87
|
+
from merge.client import AsyncMerge
|
|
88
|
+
|
|
89
|
+
client = AsyncMerge(
|
|
90
|
+
account_token="YOUR_ACCOUNT_TOKEN",
|
|
91
|
+
api_key="YOUR_API_KEY",
|
|
92
|
+
)
|
|
93
|
+
await client.accounting.account_token.retrieve(
|
|
94
|
+
public_token="string",
|
|
95
|
+
)
|
|
54
96
|
"""
|
|
55
97
|
_response = await self._client_wrapper.httpx_client.request(
|
|
56
98
|
"GET",
|
|
57
99
|
urllib.parse.urljoin(
|
|
58
100
|
f"{self._client_wrapper.get_base_url()}/", f"api/accounting/v1/account-token/{public_token}"
|
|
59
101
|
),
|
|
60
|
-
|
|
61
|
-
|
|
102
|
+
params=jsonable_encoder(
|
|
103
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
|
104
|
+
),
|
|
105
|
+
headers=jsonable_encoder(
|
|
106
|
+
remove_none_from_dict(
|
|
107
|
+
{
|
|
108
|
+
**self._client_wrapper.get_headers(),
|
|
109
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
),
|
|
113
|
+
timeout=request_options.get("timeout_in_seconds")
|
|
114
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
|
115
|
+
else 60,
|
|
62
116
|
)
|
|
63
117
|
if 200 <= _response.status_code < 300:
|
|
64
118
|
return pydantic.parse_obj_as(AccountToken, _response.json()) # type: ignore
|
|
@@ -6,7 +6,9 @@ from json.decoder import JSONDecodeError
|
|
|
6
6
|
|
|
7
7
|
from .....core.api_error import ApiError
|
|
8
8
|
from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
9
|
+
from .....core.jsonable_encoder import jsonable_encoder
|
|
9
10
|
from .....core.remove_none_from_dict import remove_none_from_dict
|
|
11
|
+
from .....core.request_options import RequestOptions
|
|
10
12
|
from ...types.accounting_period import AccountingPeriod
|
|
11
13
|
from ...types.paginated_accounting_period_list import PaginatedAccountingPeriodList
|
|
12
14
|
|
|
@@ -27,6 +29,7 @@ class AccountingPeriodsClient:
|
|
|
27
29
|
include_deleted_data: typing.Optional[bool] = None,
|
|
28
30
|
include_remote_data: typing.Optional[bool] = None,
|
|
29
31
|
page_size: typing.Optional[int] = None,
|
|
32
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
30
33
|
) -> PaginatedAccountingPeriodList:
|
|
31
34
|
"""
|
|
32
35
|
Returns a list of `AccountingPeriod` objects.
|
|
@@ -39,6 +42,8 @@ class AccountingPeriodsClient:
|
|
|
39
42
|
- include_remote_data: typing.Optional[bool]. Whether to include the original data Merge fetched from the third-party to produce these models.
|
|
40
43
|
|
|
41
44
|
- page_size: typing.Optional[int]. Number of results to return per page.
|
|
45
|
+
|
|
46
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
|
42
47
|
---
|
|
43
48
|
from merge.client import Merge
|
|
44
49
|
|
|
@@ -51,16 +56,32 @@ class AccountingPeriodsClient:
|
|
|
51
56
|
_response = self._client_wrapper.httpx_client.request(
|
|
52
57
|
"GET",
|
|
53
58
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/accounting/v1/accounting-periods"),
|
|
54
|
-
params=
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
params=jsonable_encoder(
|
|
60
|
+
remove_none_from_dict(
|
|
61
|
+
{
|
|
62
|
+
"cursor": cursor,
|
|
63
|
+
"include_deleted_data": include_deleted_data,
|
|
64
|
+
"include_remote_data": include_remote_data,
|
|
65
|
+
"page_size": page_size,
|
|
66
|
+
**(
|
|
67
|
+
request_options.get("additional_query_parameters", {})
|
|
68
|
+
if request_options is not None
|
|
69
|
+
else {}
|
|
70
|
+
),
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
),
|
|
74
|
+
headers=jsonable_encoder(
|
|
75
|
+
remove_none_from_dict(
|
|
76
|
+
{
|
|
77
|
+
**self._client_wrapper.get_headers(),
|
|
78
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
|
79
|
+
}
|
|
80
|
+
)
|
|
61
81
|
),
|
|
62
|
-
|
|
63
|
-
|
|
82
|
+
timeout=request_options.get("timeout_in_seconds")
|
|
83
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
|
84
|
+
else 60,
|
|
64
85
|
)
|
|
65
86
|
if 200 <= _response.status_code < 300:
|
|
66
87
|
return pydantic.parse_obj_as(PaginatedAccountingPeriodList, _response.json()) # type: ignore
|
|
@@ -70,7 +91,13 @@ class AccountingPeriodsClient:
|
|
|
70
91
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
71
92
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
72
93
|
|
|
73
|
-
def retrieve(
|
|
94
|
+
def retrieve(
|
|
95
|
+
self,
|
|
96
|
+
id: str,
|
|
97
|
+
*,
|
|
98
|
+
include_remote_data: typing.Optional[bool] = None,
|
|
99
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
100
|
+
) -> AccountingPeriod:
|
|
74
101
|
"""
|
|
75
102
|
Returns an `AccountingPeriod` object with the given `id`.
|
|
76
103
|
|
|
@@ -78,6 +105,8 @@ class AccountingPeriodsClient:
|
|
|
78
105
|
- id: str.
|
|
79
106
|
|
|
80
107
|
- include_remote_data: typing.Optional[bool]. Whether to include the original data Merge fetched from the third-party to produce these models.
|
|
108
|
+
|
|
109
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
|
81
110
|
---
|
|
82
111
|
from merge.client import Merge
|
|
83
112
|
|
|
@@ -86,7 +115,7 @@ class AccountingPeriodsClient:
|
|
|
86
115
|
api_key="YOUR_API_KEY",
|
|
87
116
|
)
|
|
88
117
|
client.accounting.accounting_periods.retrieve(
|
|
89
|
-
id="
|
|
118
|
+
id="string",
|
|
90
119
|
)
|
|
91
120
|
"""
|
|
92
121
|
_response = self._client_wrapper.httpx_client.request(
|
|
@@ -94,9 +123,29 @@ class AccountingPeriodsClient:
|
|
|
94
123
|
urllib.parse.urljoin(
|
|
95
124
|
f"{self._client_wrapper.get_base_url()}/", f"api/accounting/v1/accounting-periods/{id}"
|
|
96
125
|
),
|
|
97
|
-
params=
|
|
98
|
-
|
|
99
|
-
|
|
126
|
+
params=jsonable_encoder(
|
|
127
|
+
remove_none_from_dict(
|
|
128
|
+
{
|
|
129
|
+
"include_remote_data": include_remote_data,
|
|
130
|
+
**(
|
|
131
|
+
request_options.get("additional_query_parameters", {})
|
|
132
|
+
if request_options is not None
|
|
133
|
+
else {}
|
|
134
|
+
),
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
),
|
|
138
|
+
headers=jsonable_encoder(
|
|
139
|
+
remove_none_from_dict(
|
|
140
|
+
{
|
|
141
|
+
**self._client_wrapper.get_headers(),
|
|
142
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
),
|
|
146
|
+
timeout=request_options.get("timeout_in_seconds")
|
|
147
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
|
148
|
+
else 60,
|
|
100
149
|
)
|
|
101
150
|
if 200 <= _response.status_code < 300:
|
|
102
151
|
return pydantic.parse_obj_as(AccountingPeriod, _response.json()) # type: ignore
|
|
@@ -118,6 +167,7 @@ class AsyncAccountingPeriodsClient:
|
|
|
118
167
|
include_deleted_data: typing.Optional[bool] = None,
|
|
119
168
|
include_remote_data: typing.Optional[bool] = None,
|
|
120
169
|
page_size: typing.Optional[int] = None,
|
|
170
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
121
171
|
) -> PaginatedAccountingPeriodList:
|
|
122
172
|
"""
|
|
123
173
|
Returns a list of `AccountingPeriod` objects.
|
|
@@ -130,6 +180,8 @@ class AsyncAccountingPeriodsClient:
|
|
|
130
180
|
- include_remote_data: typing.Optional[bool]. Whether to include the original data Merge fetched from the third-party to produce these models.
|
|
131
181
|
|
|
132
182
|
- page_size: typing.Optional[int]. Number of results to return per page.
|
|
183
|
+
|
|
184
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
|
133
185
|
---
|
|
134
186
|
from merge.client import AsyncMerge
|
|
135
187
|
|
|
@@ -142,16 +194,32 @@ class AsyncAccountingPeriodsClient:
|
|
|
142
194
|
_response = await self._client_wrapper.httpx_client.request(
|
|
143
195
|
"GET",
|
|
144
196
|
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/accounting/v1/accounting-periods"),
|
|
145
|
-
params=
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
197
|
+
params=jsonable_encoder(
|
|
198
|
+
remove_none_from_dict(
|
|
199
|
+
{
|
|
200
|
+
"cursor": cursor,
|
|
201
|
+
"include_deleted_data": include_deleted_data,
|
|
202
|
+
"include_remote_data": include_remote_data,
|
|
203
|
+
"page_size": page_size,
|
|
204
|
+
**(
|
|
205
|
+
request_options.get("additional_query_parameters", {})
|
|
206
|
+
if request_options is not None
|
|
207
|
+
else {}
|
|
208
|
+
),
|
|
209
|
+
}
|
|
210
|
+
)
|
|
211
|
+
),
|
|
212
|
+
headers=jsonable_encoder(
|
|
213
|
+
remove_none_from_dict(
|
|
214
|
+
{
|
|
215
|
+
**self._client_wrapper.get_headers(),
|
|
216
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
|
217
|
+
}
|
|
218
|
+
)
|
|
152
219
|
),
|
|
153
|
-
|
|
154
|
-
|
|
220
|
+
timeout=request_options.get("timeout_in_seconds")
|
|
221
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
|
222
|
+
else 60,
|
|
155
223
|
)
|
|
156
224
|
if 200 <= _response.status_code < 300:
|
|
157
225
|
return pydantic.parse_obj_as(PaginatedAccountingPeriodList, _response.json()) # type: ignore
|
|
@@ -161,7 +229,13 @@ class AsyncAccountingPeriodsClient:
|
|
|
161
229
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
162
230
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
163
231
|
|
|
164
|
-
async def retrieve(
|
|
232
|
+
async def retrieve(
|
|
233
|
+
self,
|
|
234
|
+
id: str,
|
|
235
|
+
*,
|
|
236
|
+
include_remote_data: typing.Optional[bool] = None,
|
|
237
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
238
|
+
) -> AccountingPeriod:
|
|
165
239
|
"""
|
|
166
240
|
Returns an `AccountingPeriod` object with the given `id`.
|
|
167
241
|
|
|
@@ -169,6 +243,8 @@ class AsyncAccountingPeriodsClient:
|
|
|
169
243
|
- id: str.
|
|
170
244
|
|
|
171
245
|
- include_remote_data: typing.Optional[bool]. Whether to include the original data Merge fetched from the third-party to produce these models.
|
|
246
|
+
|
|
247
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
|
172
248
|
---
|
|
173
249
|
from merge.client import AsyncMerge
|
|
174
250
|
|
|
@@ -177,7 +253,7 @@ class AsyncAccountingPeriodsClient:
|
|
|
177
253
|
api_key="YOUR_API_KEY",
|
|
178
254
|
)
|
|
179
255
|
await client.accounting.accounting_periods.retrieve(
|
|
180
|
-
id="
|
|
256
|
+
id="string",
|
|
181
257
|
)
|
|
182
258
|
"""
|
|
183
259
|
_response = await self._client_wrapper.httpx_client.request(
|
|
@@ -185,9 +261,29 @@ class AsyncAccountingPeriodsClient:
|
|
|
185
261
|
urllib.parse.urljoin(
|
|
186
262
|
f"{self._client_wrapper.get_base_url()}/", f"api/accounting/v1/accounting-periods/{id}"
|
|
187
263
|
),
|
|
188
|
-
params=
|
|
189
|
-
|
|
190
|
-
|
|
264
|
+
params=jsonable_encoder(
|
|
265
|
+
remove_none_from_dict(
|
|
266
|
+
{
|
|
267
|
+
"include_remote_data": include_remote_data,
|
|
268
|
+
**(
|
|
269
|
+
request_options.get("additional_query_parameters", {})
|
|
270
|
+
if request_options is not None
|
|
271
|
+
else {}
|
|
272
|
+
),
|
|
273
|
+
}
|
|
274
|
+
)
|
|
275
|
+
),
|
|
276
|
+
headers=jsonable_encoder(
|
|
277
|
+
remove_none_from_dict(
|
|
278
|
+
{
|
|
279
|
+
**self._client_wrapper.get_headers(),
|
|
280
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
|
281
|
+
}
|
|
282
|
+
)
|
|
283
|
+
),
|
|
284
|
+
timeout=request_options.get("timeout_in_seconds")
|
|
285
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
|
286
|
+
else 60,
|
|
191
287
|
)
|
|
192
288
|
if 200 <= _response.status_code < 300:
|
|
193
289
|
return pydantic.parse_obj_as(AccountingPeriod, _response.json()) # type: ignore
|