mergepythonclient 2.1.0__py3-none-any.whl → 2.2.0__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/client_wrapper.py +2 -2
- merge/core/force_multipart.py +4 -2
- merge/core/http_response.py +1 -1
- merge/core/unchecked_base_model.py +41 -3
- merge/resources/accounting/__init__.py +64 -0
- merge/resources/accounting/client.py +5 -0
- merge/resources/accounting/resources/__init__.py +10 -0
- merge/resources/accounting/resources/accounting_periods/client.py +6 -2
- merge/resources/accounting/resources/accounts/client.py +6 -2
- merge/resources/accounting/resources/attachments/client.py +6 -2
- merge/resources/accounting/resources/audit_trail/client.py +6 -2
- merge/resources/accounting/resources/balance_sheets/client.py +6 -2
- merge/resources/accounting/resources/bank_feed_accounts/client.py +6 -2
- merge/resources/accounting/resources/bank_feed_transactions/client.py +6 -2
- merge/resources/accounting/resources/cash_flow_statements/client.py +6 -2
- merge/resources/accounting/resources/company_info/client.py +6 -2
- merge/resources/accounting/resources/contacts/client.py +195 -4
- merge/resources/accounting/resources/contacts/raw_client.py +203 -0
- merge/resources/accounting/resources/credit_notes/client.py +6 -2
- merge/resources/accounting/resources/employees/client.py +67 -2
- merge/resources/accounting/resources/employees/raw_client.py +62 -0
- merge/resources/accounting/resources/expense_reports/__init__.py +15 -0
- merge/resources/accounting/resources/expense_reports/client.py +1015 -0
- merge/resources/accounting/resources/expense_reports/raw_client.py +1020 -0
- merge/resources/accounting/resources/expense_reports/types/__init__.py +13 -0
- merge/resources/accounting/resources/expense_reports/types/expense_reports_lines_list_request_expand.py +265 -0
- merge/resources/accounting/resources/expense_reports/types/expense_reports_list_request_expand.py +73 -0
- merge/resources/accounting/resources/expense_reports/types/expense_reports_retrieve_request_expand.py +73 -0
- merge/resources/accounting/resources/expenses/client.py +18 -6
- merge/resources/accounting/resources/general_ledger_transactions/client.py +6 -2
- merge/resources/accounting/resources/income_statements/client.py +6 -2
- merge/resources/accounting/resources/invoices/client.py +18 -6
- merge/resources/accounting/resources/issues/client.py +6 -2
- merge/resources/accounting/resources/items/client.py +6 -2
- merge/resources/accounting/resources/journal_entries/client.py +18 -6
- merge/resources/accounting/resources/linked_accounts/client.py +6 -2
- merge/resources/accounting/resources/payment_methods/client.py +6 -2
- merge/resources/accounting/resources/payment_terms/client.py +6 -2
- merge/resources/accounting/resources/payments/client.py +18 -6
- merge/resources/accounting/resources/projects/client.py +67 -2
- merge/resources/accounting/resources/projects/raw_client.py +62 -0
- merge/resources/accounting/resources/purchase_orders/client.py +18 -6
- merge/resources/accounting/resources/sync_status/client.py +6 -2
- merge/resources/accounting/resources/tax_rates/client.py +6 -2
- merge/resources/accounting/resources/tracking_categories/client.py +6 -2
- merge/resources/accounting/resources/transactions/client.py +6 -2
- merge/resources/accounting/resources/transactions/types/transactions_list_request_expand.py +141 -0
- merge/resources/accounting/resources/transactions/types/transactions_retrieve_request_expand.py +141 -0
- merge/resources/accounting/resources/vendor_credits/client.py +6 -2
- merge/resources/accounting/types/__init__.py +56 -0
- merge/resources/accounting/types/expense_report.py +423 -0
- merge/resources/accounting/types/expense_report_company.py +7 -0
- merge/resources/accounting/types/expense_report_line.py +441 -0
- merge/resources/accounting/types/expense_report_line_account.py +7 -0
- merge/resources/accounting/types/expense_report_line_company.py +7 -0
- merge/resources/accounting/types/expense_report_line_contact.py +7 -0
- merge/resources/accounting/types/expense_report_line_employee.py +7 -0
- merge/resources/accounting/types/expense_report_line_project.py +7 -0
- merge/resources/accounting/types/expense_report_line_request.py +427 -0
- merge/resources/accounting/types/expense_report_line_request_account.py +7 -0
- merge/resources/accounting/types/expense_report_line_request_company.py +7 -0
- merge/resources/accounting/types/expense_report_line_request_contact.py +7 -0
- merge/resources/accounting/types/expense_report_line_request_employee.py +7 -0
- merge/resources/accounting/types/expense_report_line_request_project.py +7 -0
- merge/resources/accounting/types/expense_report_line_request_tax_rate.py +7 -0
- merge/resources/accounting/types/expense_report_line_tax_rate.py +7 -0
- merge/resources/accounting/types/expense_report_request.py +401 -0
- merge/resources/accounting/types/expense_report_request_accounting_period.py +7 -0
- merge/resources/accounting/types/expense_report_request_company.py +7 -0
- merge/resources/accounting/types/expense_report_request_employee.py +7 -0
- merge/resources/accounting/types/expense_report_response.py +27 -0
- merge/resources/accounting/types/expense_report_status.py +7 -0
- merge/resources/accounting/types/expense_report_status_enum.py +36 -0
- merge/resources/accounting/types/external_target_field_api_response.py +3 -0
- merge/resources/accounting/types/field_mapping_api_instance_response.py +3 -0
- merge/resources/accounting/types/item.py +11 -0
- merge/resources/accounting/types/item_type.py +7 -0
- merge/resources/accounting/types/paginated_expense_report_line_list.py +23 -0
- merge/resources/accounting/types/paginated_expense_report_list.py +23 -0
- merge/resources/accounting/types/patched_contact_request.py +91 -0
- merge/resources/accounting/types/patched_contact_request_addresses_item.py +7 -0
- merge/resources/accounting/types/remote_field_class.py +1 -0
- merge/resources/ats/resources/activities/client.py +6 -2
- merge/resources/ats/resources/applications/client.py +6 -2
- merge/resources/ats/resources/attachments/client.py +6 -2
- merge/resources/ats/resources/audit_trail/client.py +6 -2
- merge/resources/ats/resources/candidates/client.py +6 -2
- merge/resources/ats/resources/departments/client.py +6 -2
- merge/resources/ats/resources/eeocs/client.py +6 -2
- merge/resources/ats/resources/interviews/client.py +6 -2
- merge/resources/ats/resources/issues/client.py +6 -2
- merge/resources/ats/resources/job_interview_stages/client.py +6 -2
- merge/resources/ats/resources/job_postings/client.py +6 -2
- merge/resources/ats/resources/jobs/client.py +8 -2
- merge/resources/ats/resources/linked_accounts/client.py +6 -2
- merge/resources/ats/resources/offers/client.py +6 -2
- merge/resources/ats/resources/offices/client.py +6 -2
- merge/resources/ats/resources/reject_reasons/client.py +6 -2
- merge/resources/ats/resources/scorecards/client.py +6 -2
- merge/resources/ats/resources/sync_status/client.py +6 -2
- merge/resources/ats/resources/tags/client.py +6 -2
- merge/resources/ats/resources/users/client.py +6 -2
- merge/resources/ats/types/event_type_enum.py +4 -0
- merge/resources/crm/resources/accounts/client.py +12 -4
- merge/resources/crm/resources/association_types/client.py +2 -0
- merge/resources/crm/resources/associations/client.py +2 -0
- merge/resources/crm/resources/audit_trail/client.py +6 -2
- merge/resources/crm/resources/contacts/client.py +12 -4
- merge/resources/crm/resources/custom_object_classes/client.py +6 -2
- merge/resources/crm/resources/custom_objects/client.py +8 -2
- merge/resources/crm/resources/engagement_types/client.py +12 -4
- merge/resources/crm/resources/engagements/client.py +12 -4
- merge/resources/crm/resources/issues/client.py +6 -2
- merge/resources/crm/resources/leads/client.py +12 -4
- merge/resources/crm/resources/linked_accounts/client.py +6 -2
- merge/resources/crm/resources/notes/client.py +12 -4
- merge/resources/crm/resources/opportunities/client.py +12 -4
- merge/resources/crm/resources/stages/client.py +12 -4
- merge/resources/crm/resources/sync_status/client.py +6 -2
- merge/resources/crm/resources/tasks/client.py +12 -4
- merge/resources/crm/resources/users/client.py +12 -4
- merge/resources/crm/types/remote_field_class.py +1 -0
- merge/resources/filestorage/resources/audit_trail/client.py +6 -2
- merge/resources/filestorage/resources/drives/client.py +6 -2
- merge/resources/filestorage/resources/files/client.py +42 -4
- merge/resources/filestorage/resources/files/raw_client.py +38 -0
- merge/resources/filestorage/resources/folders/client.py +6 -2
- merge/resources/filestorage/resources/groups/client.py +6 -2
- merge/resources/filestorage/resources/issues/client.py +6 -2
- merge/resources/filestorage/resources/linked_accounts/client.py +6 -2
- merge/resources/filestorage/resources/sync_status/client.py +6 -2
- merge/resources/filestorage/resources/users/client.py +6 -2
- merge/resources/hris/resources/audit_trail/client.py +6 -2
- merge/resources/hris/resources/bank_info/client.py +6 -2
- merge/resources/hris/resources/benefits/client.py +6 -2
- merge/resources/hris/resources/companies/client.py +6 -2
- merge/resources/hris/resources/dependents/client.py +6 -2
- merge/resources/hris/resources/employee_payroll_runs/client.py +6 -2
- merge/resources/hris/resources/employees/client.py +6 -2
- merge/resources/hris/resources/employer_benefits/client.py +6 -2
- merge/resources/hris/resources/employments/client.py +6 -2
- merge/resources/hris/resources/groups/client.py +6 -2
- merge/resources/hris/resources/issues/client.py +6 -2
- merge/resources/hris/resources/linked_accounts/client.py +6 -2
- merge/resources/hris/resources/locations/client.py +6 -2
- merge/resources/hris/resources/pay_groups/client.py +6 -2
- merge/resources/hris/resources/payroll_runs/client.py +6 -2
- merge/resources/hris/resources/sync_status/client.py +6 -2
- merge/resources/hris/resources/teams/client.py +6 -2
- merge/resources/hris/resources/time_off/client.py +6 -2
- merge/resources/hris/resources/time_off_balances/client.py +6 -2
- merge/resources/hris/resources/timesheet_entries/client.py +6 -2
- merge/resources/hris/types/benefit.py +4 -4
- merge/resources/ticketing/resources/accounts/client.py +6 -2
- merge/resources/ticketing/resources/attachments/client.py +6 -2
- merge/resources/ticketing/resources/audit_trail/client.py +6 -2
- merge/resources/ticketing/resources/collections/client.py +8 -2
- merge/resources/ticketing/resources/comments/client.py +6 -2
- merge/resources/ticketing/resources/contacts/client.py +6 -2
- merge/resources/ticketing/resources/issues/client.py +6 -2
- merge/resources/ticketing/resources/linked_accounts/client.py +6 -2
- merge/resources/ticketing/resources/projects/client.py +8 -2
- merge/resources/ticketing/resources/roles/client.py +6 -2
- merge/resources/ticketing/resources/sync_status/client.py +6 -2
- merge/resources/ticketing/resources/tags/client.py +6 -2
- merge/resources/ticketing/resources/teams/client.py +6 -2
- merge/resources/ticketing/resources/tickets/client.py +24 -4
- merge/resources/ticketing/resources/tickets/raw_client.py +10 -0
- merge/resources/ticketing/resources/users/client.py +6 -2
- merge/resources/ticketing/types/patched_ticket_request.py +5 -5
- merge/resources/ticketing/types/remote_field_class.py +1 -0
- {mergepythonclient-2.1.0.dist-info → mergepythonclient-2.2.0.dist-info}/METADATA +5 -2
- {mergepythonclient-2.1.0.dist-info → mergepythonclient-2.2.0.dist-info}/RECORD +175 -140
- {mergepythonclient-2.1.0.dist-info → mergepythonclient-2.2.0.dist-info}/LICENSE.md +0 -0
- {mergepythonclient-2.1.0.dist-info → mergepythonclient-2.2.0.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,1020 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
from json.decoder import JSONDecodeError
|
|
6
|
+
|
|
7
|
+
from .....core.api_error import ApiError
|
|
8
|
+
from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
9
|
+
from .....core.datetime_utils import serialize_datetime
|
|
10
|
+
from .....core.http_response import AsyncHttpResponse, HttpResponse
|
|
11
|
+
from .....core.jsonable_encoder import jsonable_encoder
|
|
12
|
+
from .....core.request_options import RequestOptions
|
|
13
|
+
from .....core.unchecked_base_model import construct_type
|
|
14
|
+
from ...types.expense_report import ExpenseReport
|
|
15
|
+
from ...types.expense_report_request import ExpenseReportRequest
|
|
16
|
+
from ...types.expense_report_response import ExpenseReportResponse
|
|
17
|
+
from ...types.meta_response import MetaResponse
|
|
18
|
+
from ...types.paginated_expense_report_line_list import PaginatedExpenseReportLineList
|
|
19
|
+
from ...types.paginated_expense_report_list import PaginatedExpenseReportList
|
|
20
|
+
from ...types.paginated_remote_field_class_list import PaginatedRemoteFieldClassList
|
|
21
|
+
from .types.expense_reports_lines_list_request_expand import ExpenseReportsLinesListRequestExpand
|
|
22
|
+
from .types.expense_reports_list_request_expand import ExpenseReportsListRequestExpand
|
|
23
|
+
from .types.expense_reports_retrieve_request_expand import ExpenseReportsRetrieveRequestExpand
|
|
24
|
+
|
|
25
|
+
# this is used as the default value for optional parameters
|
|
26
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class RawExpenseReportsClient:
|
|
30
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
31
|
+
self._client_wrapper = client_wrapper
|
|
32
|
+
|
|
33
|
+
def list(
|
|
34
|
+
self,
|
|
35
|
+
*,
|
|
36
|
+
company_id: typing.Optional[str] = None,
|
|
37
|
+
created_after: typing.Optional[dt.datetime] = None,
|
|
38
|
+
created_before: typing.Optional[dt.datetime] = None,
|
|
39
|
+
cursor: typing.Optional[str] = None,
|
|
40
|
+
expand: typing.Optional[ExpenseReportsListRequestExpand] = None,
|
|
41
|
+
include_deleted_data: typing.Optional[bool] = None,
|
|
42
|
+
include_remote_data: typing.Optional[bool] = None,
|
|
43
|
+
include_remote_fields: typing.Optional[bool] = None,
|
|
44
|
+
include_shell_data: typing.Optional[bool] = None,
|
|
45
|
+
modified_after: typing.Optional[dt.datetime] = None,
|
|
46
|
+
modified_before: typing.Optional[dt.datetime] = None,
|
|
47
|
+
page_size: typing.Optional[int] = None,
|
|
48
|
+
remote_id: typing.Optional[str] = None,
|
|
49
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
50
|
+
) -> HttpResponse[PaginatedExpenseReportList]:
|
|
51
|
+
"""
|
|
52
|
+
Returns a list of `ExpenseReport` objects.
|
|
53
|
+
|
|
54
|
+
Parameters
|
|
55
|
+
----------
|
|
56
|
+
company_id : typing.Optional[str]
|
|
57
|
+
If provided, will only return expense reports for this company.
|
|
58
|
+
|
|
59
|
+
created_after : typing.Optional[dt.datetime]
|
|
60
|
+
If provided, will only return objects created after this datetime.
|
|
61
|
+
|
|
62
|
+
created_before : typing.Optional[dt.datetime]
|
|
63
|
+
If provided, will only return objects created before this datetime.
|
|
64
|
+
|
|
65
|
+
cursor : typing.Optional[str]
|
|
66
|
+
The pagination cursor value.
|
|
67
|
+
|
|
68
|
+
expand : typing.Optional[ExpenseReportsListRequestExpand]
|
|
69
|
+
Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
|
|
70
|
+
|
|
71
|
+
include_deleted_data : typing.Optional[bool]
|
|
72
|
+
Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/).
|
|
73
|
+
|
|
74
|
+
include_remote_data : typing.Optional[bool]
|
|
75
|
+
Whether to include the original data Merge fetched from the third-party to produce these models.
|
|
76
|
+
|
|
77
|
+
include_remote_fields : typing.Optional[bool]
|
|
78
|
+
Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format.
|
|
79
|
+
|
|
80
|
+
include_shell_data : typing.Optional[bool]
|
|
81
|
+
Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).
|
|
82
|
+
|
|
83
|
+
modified_after : typing.Optional[dt.datetime]
|
|
84
|
+
If provided, only objects synced by Merge after this date time will be returned.
|
|
85
|
+
|
|
86
|
+
modified_before : typing.Optional[dt.datetime]
|
|
87
|
+
If provided, only objects synced by Merge before this date time will be returned.
|
|
88
|
+
|
|
89
|
+
page_size : typing.Optional[int]
|
|
90
|
+
Number of results to return per page.
|
|
91
|
+
|
|
92
|
+
remote_id : typing.Optional[str]
|
|
93
|
+
The API provider's ID for the given object.
|
|
94
|
+
|
|
95
|
+
request_options : typing.Optional[RequestOptions]
|
|
96
|
+
Request-specific configuration.
|
|
97
|
+
|
|
98
|
+
Returns
|
|
99
|
+
-------
|
|
100
|
+
HttpResponse[PaginatedExpenseReportList]
|
|
101
|
+
|
|
102
|
+
"""
|
|
103
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
104
|
+
"accounting/v1/expense-reports",
|
|
105
|
+
method="GET",
|
|
106
|
+
params={
|
|
107
|
+
"company_id": company_id,
|
|
108
|
+
"created_after": serialize_datetime(created_after) if created_after is not None else None,
|
|
109
|
+
"created_before": serialize_datetime(created_before) if created_before is not None else None,
|
|
110
|
+
"cursor": cursor,
|
|
111
|
+
"expand": expand,
|
|
112
|
+
"include_deleted_data": include_deleted_data,
|
|
113
|
+
"include_remote_data": include_remote_data,
|
|
114
|
+
"include_remote_fields": include_remote_fields,
|
|
115
|
+
"include_shell_data": include_shell_data,
|
|
116
|
+
"modified_after": serialize_datetime(modified_after) if modified_after is not None else None,
|
|
117
|
+
"modified_before": serialize_datetime(modified_before) if modified_before is not None else None,
|
|
118
|
+
"page_size": page_size,
|
|
119
|
+
"remote_id": remote_id,
|
|
120
|
+
},
|
|
121
|
+
request_options=request_options,
|
|
122
|
+
)
|
|
123
|
+
try:
|
|
124
|
+
if 200 <= _response.status_code < 300:
|
|
125
|
+
_data = typing.cast(
|
|
126
|
+
PaginatedExpenseReportList,
|
|
127
|
+
construct_type(
|
|
128
|
+
type_=PaginatedExpenseReportList, # type: ignore
|
|
129
|
+
object_=_response.json(),
|
|
130
|
+
),
|
|
131
|
+
)
|
|
132
|
+
return HttpResponse(response=_response, data=_data)
|
|
133
|
+
_response_json = _response.json()
|
|
134
|
+
except JSONDecodeError:
|
|
135
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
136
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
137
|
+
|
|
138
|
+
def create(
|
|
139
|
+
self,
|
|
140
|
+
*,
|
|
141
|
+
model: ExpenseReportRequest,
|
|
142
|
+
is_debug_mode: typing.Optional[bool] = None,
|
|
143
|
+
run_async: typing.Optional[bool] = None,
|
|
144
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
145
|
+
) -> HttpResponse[ExpenseReportResponse]:
|
|
146
|
+
"""
|
|
147
|
+
Creates an `ExpenseReport` object with the given values.
|
|
148
|
+
|
|
149
|
+
Parameters
|
|
150
|
+
----------
|
|
151
|
+
model : ExpenseReportRequest
|
|
152
|
+
|
|
153
|
+
is_debug_mode : typing.Optional[bool]
|
|
154
|
+
Whether to include debug fields (such as log file links) in the response.
|
|
155
|
+
|
|
156
|
+
run_async : typing.Optional[bool]
|
|
157
|
+
Whether or not third-party updates should be run asynchronously.
|
|
158
|
+
|
|
159
|
+
request_options : typing.Optional[RequestOptions]
|
|
160
|
+
Request-specific configuration.
|
|
161
|
+
|
|
162
|
+
Returns
|
|
163
|
+
-------
|
|
164
|
+
HttpResponse[ExpenseReportResponse]
|
|
165
|
+
|
|
166
|
+
"""
|
|
167
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
168
|
+
"accounting/v1/expense-reports",
|
|
169
|
+
method="POST",
|
|
170
|
+
params={
|
|
171
|
+
"is_debug_mode": is_debug_mode,
|
|
172
|
+
"run_async": run_async,
|
|
173
|
+
},
|
|
174
|
+
json={
|
|
175
|
+
"model": model,
|
|
176
|
+
},
|
|
177
|
+
headers={
|
|
178
|
+
"content-type": "application/json",
|
|
179
|
+
},
|
|
180
|
+
request_options=request_options,
|
|
181
|
+
omit=OMIT,
|
|
182
|
+
)
|
|
183
|
+
try:
|
|
184
|
+
if 200 <= _response.status_code < 300:
|
|
185
|
+
_data = typing.cast(
|
|
186
|
+
ExpenseReportResponse,
|
|
187
|
+
construct_type(
|
|
188
|
+
type_=ExpenseReportResponse, # type: ignore
|
|
189
|
+
object_=_response.json(),
|
|
190
|
+
),
|
|
191
|
+
)
|
|
192
|
+
return HttpResponse(response=_response, data=_data)
|
|
193
|
+
_response_json = _response.json()
|
|
194
|
+
except JSONDecodeError:
|
|
195
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
196
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
197
|
+
|
|
198
|
+
def lines_list(
|
|
199
|
+
self,
|
|
200
|
+
expense_report_id: str,
|
|
201
|
+
*,
|
|
202
|
+
cursor: typing.Optional[str] = None,
|
|
203
|
+
expand: typing.Optional[ExpenseReportsLinesListRequestExpand] = None,
|
|
204
|
+
include_deleted_data: typing.Optional[bool] = None,
|
|
205
|
+
include_remote_data: typing.Optional[bool] = None,
|
|
206
|
+
include_remote_fields: typing.Optional[bool] = None,
|
|
207
|
+
include_shell_data: typing.Optional[bool] = None,
|
|
208
|
+
page_size: typing.Optional[int] = None,
|
|
209
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
210
|
+
) -> HttpResponse[PaginatedExpenseReportLineList]:
|
|
211
|
+
"""
|
|
212
|
+
Returns a list of `ExpenseReportLine` objects that point to a `ExpenseReport` with the given id.
|
|
213
|
+
|
|
214
|
+
Parameters
|
|
215
|
+
----------
|
|
216
|
+
expense_report_id : str
|
|
217
|
+
|
|
218
|
+
cursor : typing.Optional[str]
|
|
219
|
+
The pagination cursor value.
|
|
220
|
+
|
|
221
|
+
expand : typing.Optional[ExpenseReportsLinesListRequestExpand]
|
|
222
|
+
Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
|
|
223
|
+
|
|
224
|
+
include_deleted_data : typing.Optional[bool]
|
|
225
|
+
Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/).
|
|
226
|
+
|
|
227
|
+
include_remote_data : typing.Optional[bool]
|
|
228
|
+
Whether to include the original data Merge fetched from the third-party to produce these models.
|
|
229
|
+
|
|
230
|
+
include_remote_fields : typing.Optional[bool]
|
|
231
|
+
Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format.
|
|
232
|
+
|
|
233
|
+
include_shell_data : typing.Optional[bool]
|
|
234
|
+
Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).
|
|
235
|
+
|
|
236
|
+
page_size : typing.Optional[int]
|
|
237
|
+
Number of results to return per page.
|
|
238
|
+
|
|
239
|
+
request_options : typing.Optional[RequestOptions]
|
|
240
|
+
Request-specific configuration.
|
|
241
|
+
|
|
242
|
+
Returns
|
|
243
|
+
-------
|
|
244
|
+
HttpResponse[PaginatedExpenseReportLineList]
|
|
245
|
+
|
|
246
|
+
"""
|
|
247
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
248
|
+
f"accounting/v1/expense-reports/{jsonable_encoder(expense_report_id)}/lines",
|
|
249
|
+
method="GET",
|
|
250
|
+
params={
|
|
251
|
+
"cursor": cursor,
|
|
252
|
+
"expand": expand,
|
|
253
|
+
"include_deleted_data": include_deleted_data,
|
|
254
|
+
"include_remote_data": include_remote_data,
|
|
255
|
+
"include_remote_fields": include_remote_fields,
|
|
256
|
+
"include_shell_data": include_shell_data,
|
|
257
|
+
"page_size": page_size,
|
|
258
|
+
},
|
|
259
|
+
request_options=request_options,
|
|
260
|
+
)
|
|
261
|
+
try:
|
|
262
|
+
if 200 <= _response.status_code < 300:
|
|
263
|
+
_data = typing.cast(
|
|
264
|
+
PaginatedExpenseReportLineList,
|
|
265
|
+
construct_type(
|
|
266
|
+
type_=PaginatedExpenseReportLineList, # type: ignore
|
|
267
|
+
object_=_response.json(),
|
|
268
|
+
),
|
|
269
|
+
)
|
|
270
|
+
return HttpResponse(response=_response, data=_data)
|
|
271
|
+
_response_json = _response.json()
|
|
272
|
+
except JSONDecodeError:
|
|
273
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
274
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
275
|
+
|
|
276
|
+
def retrieve(
|
|
277
|
+
self,
|
|
278
|
+
id: str,
|
|
279
|
+
*,
|
|
280
|
+
expand: typing.Optional[ExpenseReportsRetrieveRequestExpand] = None,
|
|
281
|
+
include_remote_data: typing.Optional[bool] = None,
|
|
282
|
+
include_remote_fields: typing.Optional[bool] = None,
|
|
283
|
+
include_shell_data: typing.Optional[bool] = None,
|
|
284
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
285
|
+
) -> HttpResponse[ExpenseReport]:
|
|
286
|
+
"""
|
|
287
|
+
Returns an `ExpenseReport` object with the given `id`.
|
|
288
|
+
|
|
289
|
+
Parameters
|
|
290
|
+
----------
|
|
291
|
+
id : str
|
|
292
|
+
|
|
293
|
+
expand : typing.Optional[ExpenseReportsRetrieveRequestExpand]
|
|
294
|
+
Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
|
|
295
|
+
|
|
296
|
+
include_remote_data : typing.Optional[bool]
|
|
297
|
+
Whether to include the original data Merge fetched from the third-party to produce these models.
|
|
298
|
+
|
|
299
|
+
include_remote_fields : typing.Optional[bool]
|
|
300
|
+
Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format.
|
|
301
|
+
|
|
302
|
+
include_shell_data : typing.Optional[bool]
|
|
303
|
+
Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).
|
|
304
|
+
|
|
305
|
+
request_options : typing.Optional[RequestOptions]
|
|
306
|
+
Request-specific configuration.
|
|
307
|
+
|
|
308
|
+
Returns
|
|
309
|
+
-------
|
|
310
|
+
HttpResponse[ExpenseReport]
|
|
311
|
+
|
|
312
|
+
"""
|
|
313
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
314
|
+
f"accounting/v1/expense-reports/{jsonable_encoder(id)}",
|
|
315
|
+
method="GET",
|
|
316
|
+
params={
|
|
317
|
+
"expand": expand,
|
|
318
|
+
"include_remote_data": include_remote_data,
|
|
319
|
+
"include_remote_fields": include_remote_fields,
|
|
320
|
+
"include_shell_data": include_shell_data,
|
|
321
|
+
},
|
|
322
|
+
request_options=request_options,
|
|
323
|
+
)
|
|
324
|
+
try:
|
|
325
|
+
if 200 <= _response.status_code < 300:
|
|
326
|
+
_data = typing.cast(
|
|
327
|
+
ExpenseReport,
|
|
328
|
+
construct_type(
|
|
329
|
+
type_=ExpenseReport, # type: ignore
|
|
330
|
+
object_=_response.json(),
|
|
331
|
+
),
|
|
332
|
+
)
|
|
333
|
+
return HttpResponse(response=_response, data=_data)
|
|
334
|
+
_response_json = _response.json()
|
|
335
|
+
except JSONDecodeError:
|
|
336
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
337
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
338
|
+
|
|
339
|
+
def lines_remote_field_classes_list(
|
|
340
|
+
self,
|
|
341
|
+
*,
|
|
342
|
+
cursor: typing.Optional[str] = None,
|
|
343
|
+
include_deleted_data: typing.Optional[bool] = None,
|
|
344
|
+
include_remote_data: typing.Optional[bool] = None,
|
|
345
|
+
include_shell_data: typing.Optional[bool] = None,
|
|
346
|
+
is_common_model_field: typing.Optional[bool] = None,
|
|
347
|
+
is_custom: typing.Optional[bool] = None,
|
|
348
|
+
page_size: typing.Optional[int] = None,
|
|
349
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
350
|
+
) -> HttpResponse[PaginatedRemoteFieldClassList]:
|
|
351
|
+
"""
|
|
352
|
+
Returns a list of `RemoteFieldClass` objects.
|
|
353
|
+
|
|
354
|
+
Parameters
|
|
355
|
+
----------
|
|
356
|
+
cursor : typing.Optional[str]
|
|
357
|
+
The pagination cursor value.
|
|
358
|
+
|
|
359
|
+
include_deleted_data : typing.Optional[bool]
|
|
360
|
+
Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/).
|
|
361
|
+
|
|
362
|
+
include_remote_data : typing.Optional[bool]
|
|
363
|
+
Whether to include the original data Merge fetched from the third-party to produce these models.
|
|
364
|
+
|
|
365
|
+
include_shell_data : typing.Optional[bool]
|
|
366
|
+
Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).
|
|
367
|
+
|
|
368
|
+
is_common_model_field : typing.Optional[bool]
|
|
369
|
+
If provided, will only return remote field classes with this is_common_model_field value
|
|
370
|
+
|
|
371
|
+
is_custom : typing.Optional[bool]
|
|
372
|
+
If provided, will only return remote fields classes with this is_custom value
|
|
373
|
+
|
|
374
|
+
page_size : typing.Optional[int]
|
|
375
|
+
Number of results to return per page.
|
|
376
|
+
|
|
377
|
+
request_options : typing.Optional[RequestOptions]
|
|
378
|
+
Request-specific configuration.
|
|
379
|
+
|
|
380
|
+
Returns
|
|
381
|
+
-------
|
|
382
|
+
HttpResponse[PaginatedRemoteFieldClassList]
|
|
383
|
+
|
|
384
|
+
"""
|
|
385
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
386
|
+
"accounting/v1/expense-reports/lines/remote-field-classes",
|
|
387
|
+
method="GET",
|
|
388
|
+
params={
|
|
389
|
+
"cursor": cursor,
|
|
390
|
+
"include_deleted_data": include_deleted_data,
|
|
391
|
+
"include_remote_data": include_remote_data,
|
|
392
|
+
"include_shell_data": include_shell_data,
|
|
393
|
+
"is_common_model_field": is_common_model_field,
|
|
394
|
+
"is_custom": is_custom,
|
|
395
|
+
"page_size": page_size,
|
|
396
|
+
},
|
|
397
|
+
request_options=request_options,
|
|
398
|
+
)
|
|
399
|
+
try:
|
|
400
|
+
if 200 <= _response.status_code < 300:
|
|
401
|
+
_data = typing.cast(
|
|
402
|
+
PaginatedRemoteFieldClassList,
|
|
403
|
+
construct_type(
|
|
404
|
+
type_=PaginatedRemoteFieldClassList, # type: ignore
|
|
405
|
+
object_=_response.json(),
|
|
406
|
+
),
|
|
407
|
+
)
|
|
408
|
+
return HttpResponse(response=_response, data=_data)
|
|
409
|
+
_response_json = _response.json()
|
|
410
|
+
except JSONDecodeError:
|
|
411
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
412
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
413
|
+
|
|
414
|
+
def meta_post_retrieve(
|
|
415
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
416
|
+
) -> HttpResponse[MetaResponse]:
|
|
417
|
+
"""
|
|
418
|
+
Returns metadata for `ExpenseReport` POSTs.
|
|
419
|
+
|
|
420
|
+
Parameters
|
|
421
|
+
----------
|
|
422
|
+
request_options : typing.Optional[RequestOptions]
|
|
423
|
+
Request-specific configuration.
|
|
424
|
+
|
|
425
|
+
Returns
|
|
426
|
+
-------
|
|
427
|
+
HttpResponse[MetaResponse]
|
|
428
|
+
|
|
429
|
+
"""
|
|
430
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
431
|
+
"accounting/v1/expense-reports/meta/post",
|
|
432
|
+
method="GET",
|
|
433
|
+
request_options=request_options,
|
|
434
|
+
)
|
|
435
|
+
try:
|
|
436
|
+
if 200 <= _response.status_code < 300:
|
|
437
|
+
_data = typing.cast(
|
|
438
|
+
MetaResponse,
|
|
439
|
+
construct_type(
|
|
440
|
+
type_=MetaResponse, # type: ignore
|
|
441
|
+
object_=_response.json(),
|
|
442
|
+
),
|
|
443
|
+
)
|
|
444
|
+
return HttpResponse(response=_response, data=_data)
|
|
445
|
+
_response_json = _response.json()
|
|
446
|
+
except JSONDecodeError:
|
|
447
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
448
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
449
|
+
|
|
450
|
+
def remote_field_classes_list(
|
|
451
|
+
self,
|
|
452
|
+
*,
|
|
453
|
+
cursor: typing.Optional[str] = None,
|
|
454
|
+
include_deleted_data: typing.Optional[bool] = None,
|
|
455
|
+
include_remote_data: typing.Optional[bool] = None,
|
|
456
|
+
include_shell_data: typing.Optional[bool] = None,
|
|
457
|
+
is_common_model_field: typing.Optional[bool] = None,
|
|
458
|
+
is_custom: typing.Optional[bool] = None,
|
|
459
|
+
page_size: typing.Optional[int] = None,
|
|
460
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
461
|
+
) -> HttpResponse[PaginatedRemoteFieldClassList]:
|
|
462
|
+
"""
|
|
463
|
+
Returns a list of `RemoteFieldClass` objects.
|
|
464
|
+
|
|
465
|
+
Parameters
|
|
466
|
+
----------
|
|
467
|
+
cursor : typing.Optional[str]
|
|
468
|
+
The pagination cursor value.
|
|
469
|
+
|
|
470
|
+
include_deleted_data : typing.Optional[bool]
|
|
471
|
+
Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/).
|
|
472
|
+
|
|
473
|
+
include_remote_data : typing.Optional[bool]
|
|
474
|
+
Whether to include the original data Merge fetched from the third-party to produce these models.
|
|
475
|
+
|
|
476
|
+
include_shell_data : typing.Optional[bool]
|
|
477
|
+
Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).
|
|
478
|
+
|
|
479
|
+
is_common_model_field : typing.Optional[bool]
|
|
480
|
+
If provided, will only return remote field classes with this is_common_model_field value
|
|
481
|
+
|
|
482
|
+
is_custom : typing.Optional[bool]
|
|
483
|
+
If provided, will only return remote fields classes with this is_custom value
|
|
484
|
+
|
|
485
|
+
page_size : typing.Optional[int]
|
|
486
|
+
Number of results to return per page.
|
|
487
|
+
|
|
488
|
+
request_options : typing.Optional[RequestOptions]
|
|
489
|
+
Request-specific configuration.
|
|
490
|
+
|
|
491
|
+
Returns
|
|
492
|
+
-------
|
|
493
|
+
HttpResponse[PaginatedRemoteFieldClassList]
|
|
494
|
+
|
|
495
|
+
"""
|
|
496
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
497
|
+
"accounting/v1/expense-reports/remote-field-classes",
|
|
498
|
+
method="GET",
|
|
499
|
+
params={
|
|
500
|
+
"cursor": cursor,
|
|
501
|
+
"include_deleted_data": include_deleted_data,
|
|
502
|
+
"include_remote_data": include_remote_data,
|
|
503
|
+
"include_shell_data": include_shell_data,
|
|
504
|
+
"is_common_model_field": is_common_model_field,
|
|
505
|
+
"is_custom": is_custom,
|
|
506
|
+
"page_size": page_size,
|
|
507
|
+
},
|
|
508
|
+
request_options=request_options,
|
|
509
|
+
)
|
|
510
|
+
try:
|
|
511
|
+
if 200 <= _response.status_code < 300:
|
|
512
|
+
_data = typing.cast(
|
|
513
|
+
PaginatedRemoteFieldClassList,
|
|
514
|
+
construct_type(
|
|
515
|
+
type_=PaginatedRemoteFieldClassList, # type: ignore
|
|
516
|
+
object_=_response.json(),
|
|
517
|
+
),
|
|
518
|
+
)
|
|
519
|
+
return HttpResponse(response=_response, data=_data)
|
|
520
|
+
_response_json = _response.json()
|
|
521
|
+
except JSONDecodeError:
|
|
522
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
523
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
class AsyncRawExpenseReportsClient:
|
|
527
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
528
|
+
self._client_wrapper = client_wrapper
|
|
529
|
+
|
|
530
|
+
async def list(
|
|
531
|
+
self,
|
|
532
|
+
*,
|
|
533
|
+
company_id: typing.Optional[str] = None,
|
|
534
|
+
created_after: typing.Optional[dt.datetime] = None,
|
|
535
|
+
created_before: typing.Optional[dt.datetime] = None,
|
|
536
|
+
cursor: typing.Optional[str] = None,
|
|
537
|
+
expand: typing.Optional[ExpenseReportsListRequestExpand] = None,
|
|
538
|
+
include_deleted_data: typing.Optional[bool] = None,
|
|
539
|
+
include_remote_data: typing.Optional[bool] = None,
|
|
540
|
+
include_remote_fields: typing.Optional[bool] = None,
|
|
541
|
+
include_shell_data: typing.Optional[bool] = None,
|
|
542
|
+
modified_after: typing.Optional[dt.datetime] = None,
|
|
543
|
+
modified_before: typing.Optional[dt.datetime] = None,
|
|
544
|
+
page_size: typing.Optional[int] = None,
|
|
545
|
+
remote_id: typing.Optional[str] = None,
|
|
546
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
547
|
+
) -> AsyncHttpResponse[PaginatedExpenseReportList]:
|
|
548
|
+
"""
|
|
549
|
+
Returns a list of `ExpenseReport` objects.
|
|
550
|
+
|
|
551
|
+
Parameters
|
|
552
|
+
----------
|
|
553
|
+
company_id : typing.Optional[str]
|
|
554
|
+
If provided, will only return expense reports for this company.
|
|
555
|
+
|
|
556
|
+
created_after : typing.Optional[dt.datetime]
|
|
557
|
+
If provided, will only return objects created after this datetime.
|
|
558
|
+
|
|
559
|
+
created_before : typing.Optional[dt.datetime]
|
|
560
|
+
If provided, will only return objects created before this datetime.
|
|
561
|
+
|
|
562
|
+
cursor : typing.Optional[str]
|
|
563
|
+
The pagination cursor value.
|
|
564
|
+
|
|
565
|
+
expand : typing.Optional[ExpenseReportsListRequestExpand]
|
|
566
|
+
Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
|
|
567
|
+
|
|
568
|
+
include_deleted_data : typing.Optional[bool]
|
|
569
|
+
Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/).
|
|
570
|
+
|
|
571
|
+
include_remote_data : typing.Optional[bool]
|
|
572
|
+
Whether to include the original data Merge fetched from the third-party to produce these models.
|
|
573
|
+
|
|
574
|
+
include_remote_fields : typing.Optional[bool]
|
|
575
|
+
Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format.
|
|
576
|
+
|
|
577
|
+
include_shell_data : typing.Optional[bool]
|
|
578
|
+
Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).
|
|
579
|
+
|
|
580
|
+
modified_after : typing.Optional[dt.datetime]
|
|
581
|
+
If provided, only objects synced by Merge after this date time will be returned.
|
|
582
|
+
|
|
583
|
+
modified_before : typing.Optional[dt.datetime]
|
|
584
|
+
If provided, only objects synced by Merge before this date time will be returned.
|
|
585
|
+
|
|
586
|
+
page_size : typing.Optional[int]
|
|
587
|
+
Number of results to return per page.
|
|
588
|
+
|
|
589
|
+
remote_id : typing.Optional[str]
|
|
590
|
+
The API provider's ID for the given object.
|
|
591
|
+
|
|
592
|
+
request_options : typing.Optional[RequestOptions]
|
|
593
|
+
Request-specific configuration.
|
|
594
|
+
|
|
595
|
+
Returns
|
|
596
|
+
-------
|
|
597
|
+
AsyncHttpResponse[PaginatedExpenseReportList]
|
|
598
|
+
|
|
599
|
+
"""
|
|
600
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
601
|
+
"accounting/v1/expense-reports",
|
|
602
|
+
method="GET",
|
|
603
|
+
params={
|
|
604
|
+
"company_id": company_id,
|
|
605
|
+
"created_after": serialize_datetime(created_after) if created_after is not None else None,
|
|
606
|
+
"created_before": serialize_datetime(created_before) if created_before is not None else None,
|
|
607
|
+
"cursor": cursor,
|
|
608
|
+
"expand": expand,
|
|
609
|
+
"include_deleted_data": include_deleted_data,
|
|
610
|
+
"include_remote_data": include_remote_data,
|
|
611
|
+
"include_remote_fields": include_remote_fields,
|
|
612
|
+
"include_shell_data": include_shell_data,
|
|
613
|
+
"modified_after": serialize_datetime(modified_after) if modified_after is not None else None,
|
|
614
|
+
"modified_before": serialize_datetime(modified_before) if modified_before is not None else None,
|
|
615
|
+
"page_size": page_size,
|
|
616
|
+
"remote_id": remote_id,
|
|
617
|
+
},
|
|
618
|
+
request_options=request_options,
|
|
619
|
+
)
|
|
620
|
+
try:
|
|
621
|
+
if 200 <= _response.status_code < 300:
|
|
622
|
+
_data = typing.cast(
|
|
623
|
+
PaginatedExpenseReportList,
|
|
624
|
+
construct_type(
|
|
625
|
+
type_=PaginatedExpenseReportList, # type: ignore
|
|
626
|
+
object_=_response.json(),
|
|
627
|
+
),
|
|
628
|
+
)
|
|
629
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
630
|
+
_response_json = _response.json()
|
|
631
|
+
except JSONDecodeError:
|
|
632
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
633
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
634
|
+
|
|
635
|
+
async def create(
|
|
636
|
+
self,
|
|
637
|
+
*,
|
|
638
|
+
model: ExpenseReportRequest,
|
|
639
|
+
is_debug_mode: typing.Optional[bool] = None,
|
|
640
|
+
run_async: typing.Optional[bool] = None,
|
|
641
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
642
|
+
) -> AsyncHttpResponse[ExpenseReportResponse]:
|
|
643
|
+
"""
|
|
644
|
+
Creates an `ExpenseReport` object with the given values.
|
|
645
|
+
|
|
646
|
+
Parameters
|
|
647
|
+
----------
|
|
648
|
+
model : ExpenseReportRequest
|
|
649
|
+
|
|
650
|
+
is_debug_mode : typing.Optional[bool]
|
|
651
|
+
Whether to include debug fields (such as log file links) in the response.
|
|
652
|
+
|
|
653
|
+
run_async : typing.Optional[bool]
|
|
654
|
+
Whether or not third-party updates should be run asynchronously.
|
|
655
|
+
|
|
656
|
+
request_options : typing.Optional[RequestOptions]
|
|
657
|
+
Request-specific configuration.
|
|
658
|
+
|
|
659
|
+
Returns
|
|
660
|
+
-------
|
|
661
|
+
AsyncHttpResponse[ExpenseReportResponse]
|
|
662
|
+
|
|
663
|
+
"""
|
|
664
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
665
|
+
"accounting/v1/expense-reports",
|
|
666
|
+
method="POST",
|
|
667
|
+
params={
|
|
668
|
+
"is_debug_mode": is_debug_mode,
|
|
669
|
+
"run_async": run_async,
|
|
670
|
+
},
|
|
671
|
+
json={
|
|
672
|
+
"model": model,
|
|
673
|
+
},
|
|
674
|
+
headers={
|
|
675
|
+
"content-type": "application/json",
|
|
676
|
+
},
|
|
677
|
+
request_options=request_options,
|
|
678
|
+
omit=OMIT,
|
|
679
|
+
)
|
|
680
|
+
try:
|
|
681
|
+
if 200 <= _response.status_code < 300:
|
|
682
|
+
_data = typing.cast(
|
|
683
|
+
ExpenseReportResponse,
|
|
684
|
+
construct_type(
|
|
685
|
+
type_=ExpenseReportResponse, # type: ignore
|
|
686
|
+
object_=_response.json(),
|
|
687
|
+
),
|
|
688
|
+
)
|
|
689
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
690
|
+
_response_json = _response.json()
|
|
691
|
+
except JSONDecodeError:
|
|
692
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
693
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
694
|
+
|
|
695
|
+
async def lines_list(
|
|
696
|
+
self,
|
|
697
|
+
expense_report_id: str,
|
|
698
|
+
*,
|
|
699
|
+
cursor: typing.Optional[str] = None,
|
|
700
|
+
expand: typing.Optional[ExpenseReportsLinesListRequestExpand] = None,
|
|
701
|
+
include_deleted_data: typing.Optional[bool] = None,
|
|
702
|
+
include_remote_data: typing.Optional[bool] = None,
|
|
703
|
+
include_remote_fields: typing.Optional[bool] = None,
|
|
704
|
+
include_shell_data: typing.Optional[bool] = None,
|
|
705
|
+
page_size: typing.Optional[int] = None,
|
|
706
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
707
|
+
) -> AsyncHttpResponse[PaginatedExpenseReportLineList]:
|
|
708
|
+
"""
|
|
709
|
+
Returns a list of `ExpenseReportLine` objects that point to a `ExpenseReport` with the given id.
|
|
710
|
+
|
|
711
|
+
Parameters
|
|
712
|
+
----------
|
|
713
|
+
expense_report_id : str
|
|
714
|
+
|
|
715
|
+
cursor : typing.Optional[str]
|
|
716
|
+
The pagination cursor value.
|
|
717
|
+
|
|
718
|
+
expand : typing.Optional[ExpenseReportsLinesListRequestExpand]
|
|
719
|
+
Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
|
|
720
|
+
|
|
721
|
+
include_deleted_data : typing.Optional[bool]
|
|
722
|
+
Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/).
|
|
723
|
+
|
|
724
|
+
include_remote_data : typing.Optional[bool]
|
|
725
|
+
Whether to include the original data Merge fetched from the third-party to produce these models.
|
|
726
|
+
|
|
727
|
+
include_remote_fields : typing.Optional[bool]
|
|
728
|
+
Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format.
|
|
729
|
+
|
|
730
|
+
include_shell_data : typing.Optional[bool]
|
|
731
|
+
Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).
|
|
732
|
+
|
|
733
|
+
page_size : typing.Optional[int]
|
|
734
|
+
Number of results to return per page.
|
|
735
|
+
|
|
736
|
+
request_options : typing.Optional[RequestOptions]
|
|
737
|
+
Request-specific configuration.
|
|
738
|
+
|
|
739
|
+
Returns
|
|
740
|
+
-------
|
|
741
|
+
AsyncHttpResponse[PaginatedExpenseReportLineList]
|
|
742
|
+
|
|
743
|
+
"""
|
|
744
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
745
|
+
f"accounting/v1/expense-reports/{jsonable_encoder(expense_report_id)}/lines",
|
|
746
|
+
method="GET",
|
|
747
|
+
params={
|
|
748
|
+
"cursor": cursor,
|
|
749
|
+
"expand": expand,
|
|
750
|
+
"include_deleted_data": include_deleted_data,
|
|
751
|
+
"include_remote_data": include_remote_data,
|
|
752
|
+
"include_remote_fields": include_remote_fields,
|
|
753
|
+
"include_shell_data": include_shell_data,
|
|
754
|
+
"page_size": page_size,
|
|
755
|
+
},
|
|
756
|
+
request_options=request_options,
|
|
757
|
+
)
|
|
758
|
+
try:
|
|
759
|
+
if 200 <= _response.status_code < 300:
|
|
760
|
+
_data = typing.cast(
|
|
761
|
+
PaginatedExpenseReportLineList,
|
|
762
|
+
construct_type(
|
|
763
|
+
type_=PaginatedExpenseReportLineList, # type: ignore
|
|
764
|
+
object_=_response.json(),
|
|
765
|
+
),
|
|
766
|
+
)
|
|
767
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
768
|
+
_response_json = _response.json()
|
|
769
|
+
except JSONDecodeError:
|
|
770
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
771
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
772
|
+
|
|
773
|
+
async def retrieve(
|
|
774
|
+
self,
|
|
775
|
+
id: str,
|
|
776
|
+
*,
|
|
777
|
+
expand: typing.Optional[ExpenseReportsRetrieveRequestExpand] = None,
|
|
778
|
+
include_remote_data: typing.Optional[bool] = None,
|
|
779
|
+
include_remote_fields: typing.Optional[bool] = None,
|
|
780
|
+
include_shell_data: typing.Optional[bool] = None,
|
|
781
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
782
|
+
) -> AsyncHttpResponse[ExpenseReport]:
|
|
783
|
+
"""
|
|
784
|
+
Returns an `ExpenseReport` object with the given `id`.
|
|
785
|
+
|
|
786
|
+
Parameters
|
|
787
|
+
----------
|
|
788
|
+
id : str
|
|
789
|
+
|
|
790
|
+
expand : typing.Optional[ExpenseReportsRetrieveRequestExpand]
|
|
791
|
+
Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
|
|
792
|
+
|
|
793
|
+
include_remote_data : typing.Optional[bool]
|
|
794
|
+
Whether to include the original data Merge fetched from the third-party to produce these models.
|
|
795
|
+
|
|
796
|
+
include_remote_fields : typing.Optional[bool]
|
|
797
|
+
Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format.
|
|
798
|
+
|
|
799
|
+
include_shell_data : typing.Optional[bool]
|
|
800
|
+
Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).
|
|
801
|
+
|
|
802
|
+
request_options : typing.Optional[RequestOptions]
|
|
803
|
+
Request-specific configuration.
|
|
804
|
+
|
|
805
|
+
Returns
|
|
806
|
+
-------
|
|
807
|
+
AsyncHttpResponse[ExpenseReport]
|
|
808
|
+
|
|
809
|
+
"""
|
|
810
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
811
|
+
f"accounting/v1/expense-reports/{jsonable_encoder(id)}",
|
|
812
|
+
method="GET",
|
|
813
|
+
params={
|
|
814
|
+
"expand": expand,
|
|
815
|
+
"include_remote_data": include_remote_data,
|
|
816
|
+
"include_remote_fields": include_remote_fields,
|
|
817
|
+
"include_shell_data": include_shell_data,
|
|
818
|
+
},
|
|
819
|
+
request_options=request_options,
|
|
820
|
+
)
|
|
821
|
+
try:
|
|
822
|
+
if 200 <= _response.status_code < 300:
|
|
823
|
+
_data = typing.cast(
|
|
824
|
+
ExpenseReport,
|
|
825
|
+
construct_type(
|
|
826
|
+
type_=ExpenseReport, # type: ignore
|
|
827
|
+
object_=_response.json(),
|
|
828
|
+
),
|
|
829
|
+
)
|
|
830
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
831
|
+
_response_json = _response.json()
|
|
832
|
+
except JSONDecodeError:
|
|
833
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
834
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
835
|
+
|
|
836
|
+
async def lines_remote_field_classes_list(
|
|
837
|
+
self,
|
|
838
|
+
*,
|
|
839
|
+
cursor: typing.Optional[str] = None,
|
|
840
|
+
include_deleted_data: typing.Optional[bool] = None,
|
|
841
|
+
include_remote_data: typing.Optional[bool] = None,
|
|
842
|
+
include_shell_data: typing.Optional[bool] = None,
|
|
843
|
+
is_common_model_field: typing.Optional[bool] = None,
|
|
844
|
+
is_custom: typing.Optional[bool] = None,
|
|
845
|
+
page_size: typing.Optional[int] = None,
|
|
846
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
847
|
+
) -> AsyncHttpResponse[PaginatedRemoteFieldClassList]:
|
|
848
|
+
"""
|
|
849
|
+
Returns a list of `RemoteFieldClass` objects.
|
|
850
|
+
|
|
851
|
+
Parameters
|
|
852
|
+
----------
|
|
853
|
+
cursor : typing.Optional[str]
|
|
854
|
+
The pagination cursor value.
|
|
855
|
+
|
|
856
|
+
include_deleted_data : typing.Optional[bool]
|
|
857
|
+
Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/).
|
|
858
|
+
|
|
859
|
+
include_remote_data : typing.Optional[bool]
|
|
860
|
+
Whether to include the original data Merge fetched from the third-party to produce these models.
|
|
861
|
+
|
|
862
|
+
include_shell_data : typing.Optional[bool]
|
|
863
|
+
Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).
|
|
864
|
+
|
|
865
|
+
is_common_model_field : typing.Optional[bool]
|
|
866
|
+
If provided, will only return remote field classes with this is_common_model_field value
|
|
867
|
+
|
|
868
|
+
is_custom : typing.Optional[bool]
|
|
869
|
+
If provided, will only return remote fields classes with this is_custom value
|
|
870
|
+
|
|
871
|
+
page_size : typing.Optional[int]
|
|
872
|
+
Number of results to return per page.
|
|
873
|
+
|
|
874
|
+
request_options : typing.Optional[RequestOptions]
|
|
875
|
+
Request-specific configuration.
|
|
876
|
+
|
|
877
|
+
Returns
|
|
878
|
+
-------
|
|
879
|
+
AsyncHttpResponse[PaginatedRemoteFieldClassList]
|
|
880
|
+
|
|
881
|
+
"""
|
|
882
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
883
|
+
"accounting/v1/expense-reports/lines/remote-field-classes",
|
|
884
|
+
method="GET",
|
|
885
|
+
params={
|
|
886
|
+
"cursor": cursor,
|
|
887
|
+
"include_deleted_data": include_deleted_data,
|
|
888
|
+
"include_remote_data": include_remote_data,
|
|
889
|
+
"include_shell_data": include_shell_data,
|
|
890
|
+
"is_common_model_field": is_common_model_field,
|
|
891
|
+
"is_custom": is_custom,
|
|
892
|
+
"page_size": page_size,
|
|
893
|
+
},
|
|
894
|
+
request_options=request_options,
|
|
895
|
+
)
|
|
896
|
+
try:
|
|
897
|
+
if 200 <= _response.status_code < 300:
|
|
898
|
+
_data = typing.cast(
|
|
899
|
+
PaginatedRemoteFieldClassList,
|
|
900
|
+
construct_type(
|
|
901
|
+
type_=PaginatedRemoteFieldClassList, # type: ignore
|
|
902
|
+
object_=_response.json(),
|
|
903
|
+
),
|
|
904
|
+
)
|
|
905
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
906
|
+
_response_json = _response.json()
|
|
907
|
+
except JSONDecodeError:
|
|
908
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
909
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
910
|
+
|
|
911
|
+
async def meta_post_retrieve(
|
|
912
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
913
|
+
) -> AsyncHttpResponse[MetaResponse]:
|
|
914
|
+
"""
|
|
915
|
+
Returns metadata for `ExpenseReport` POSTs.
|
|
916
|
+
|
|
917
|
+
Parameters
|
|
918
|
+
----------
|
|
919
|
+
request_options : typing.Optional[RequestOptions]
|
|
920
|
+
Request-specific configuration.
|
|
921
|
+
|
|
922
|
+
Returns
|
|
923
|
+
-------
|
|
924
|
+
AsyncHttpResponse[MetaResponse]
|
|
925
|
+
|
|
926
|
+
"""
|
|
927
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
928
|
+
"accounting/v1/expense-reports/meta/post",
|
|
929
|
+
method="GET",
|
|
930
|
+
request_options=request_options,
|
|
931
|
+
)
|
|
932
|
+
try:
|
|
933
|
+
if 200 <= _response.status_code < 300:
|
|
934
|
+
_data = typing.cast(
|
|
935
|
+
MetaResponse,
|
|
936
|
+
construct_type(
|
|
937
|
+
type_=MetaResponse, # type: ignore
|
|
938
|
+
object_=_response.json(),
|
|
939
|
+
),
|
|
940
|
+
)
|
|
941
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
942
|
+
_response_json = _response.json()
|
|
943
|
+
except JSONDecodeError:
|
|
944
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
945
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
946
|
+
|
|
947
|
+
async def remote_field_classes_list(
|
|
948
|
+
self,
|
|
949
|
+
*,
|
|
950
|
+
cursor: typing.Optional[str] = None,
|
|
951
|
+
include_deleted_data: typing.Optional[bool] = None,
|
|
952
|
+
include_remote_data: typing.Optional[bool] = None,
|
|
953
|
+
include_shell_data: typing.Optional[bool] = None,
|
|
954
|
+
is_common_model_field: typing.Optional[bool] = None,
|
|
955
|
+
is_custom: typing.Optional[bool] = None,
|
|
956
|
+
page_size: typing.Optional[int] = None,
|
|
957
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
958
|
+
) -> AsyncHttpResponse[PaginatedRemoteFieldClassList]:
|
|
959
|
+
"""
|
|
960
|
+
Returns a list of `RemoteFieldClass` objects.
|
|
961
|
+
|
|
962
|
+
Parameters
|
|
963
|
+
----------
|
|
964
|
+
cursor : typing.Optional[str]
|
|
965
|
+
The pagination cursor value.
|
|
966
|
+
|
|
967
|
+
include_deleted_data : typing.Optional[bool]
|
|
968
|
+
Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/).
|
|
969
|
+
|
|
970
|
+
include_remote_data : typing.Optional[bool]
|
|
971
|
+
Whether to include the original data Merge fetched from the third-party to produce these models.
|
|
972
|
+
|
|
973
|
+
include_shell_data : typing.Optional[bool]
|
|
974
|
+
Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).
|
|
975
|
+
|
|
976
|
+
is_common_model_field : typing.Optional[bool]
|
|
977
|
+
If provided, will only return remote field classes with this is_common_model_field value
|
|
978
|
+
|
|
979
|
+
is_custom : typing.Optional[bool]
|
|
980
|
+
If provided, will only return remote fields classes with this is_custom value
|
|
981
|
+
|
|
982
|
+
page_size : typing.Optional[int]
|
|
983
|
+
Number of results to return per page.
|
|
984
|
+
|
|
985
|
+
request_options : typing.Optional[RequestOptions]
|
|
986
|
+
Request-specific configuration.
|
|
987
|
+
|
|
988
|
+
Returns
|
|
989
|
+
-------
|
|
990
|
+
AsyncHttpResponse[PaginatedRemoteFieldClassList]
|
|
991
|
+
|
|
992
|
+
"""
|
|
993
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
994
|
+
"accounting/v1/expense-reports/remote-field-classes",
|
|
995
|
+
method="GET",
|
|
996
|
+
params={
|
|
997
|
+
"cursor": cursor,
|
|
998
|
+
"include_deleted_data": include_deleted_data,
|
|
999
|
+
"include_remote_data": include_remote_data,
|
|
1000
|
+
"include_shell_data": include_shell_data,
|
|
1001
|
+
"is_common_model_field": is_common_model_field,
|
|
1002
|
+
"is_custom": is_custom,
|
|
1003
|
+
"page_size": page_size,
|
|
1004
|
+
},
|
|
1005
|
+
request_options=request_options,
|
|
1006
|
+
)
|
|
1007
|
+
try:
|
|
1008
|
+
if 200 <= _response.status_code < 300:
|
|
1009
|
+
_data = typing.cast(
|
|
1010
|
+
PaginatedRemoteFieldClassList,
|
|
1011
|
+
construct_type(
|
|
1012
|
+
type_=PaginatedRemoteFieldClassList, # type: ignore
|
|
1013
|
+
object_=_response.json(),
|
|
1014
|
+
),
|
|
1015
|
+
)
|
|
1016
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
1017
|
+
_response_json = _response.json()
|
|
1018
|
+
except JSONDecodeError:
|
|
1019
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1020
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|