mergepythonclient 2.1.0__py3-none-any.whl → 2.1.1__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/unchecked_base_model.py +38 -0
- merge/resources/accounting/__init__.py +60 -0
- merge/resources/accounting/client.py +5 -0
- merge/resources/accounting/resources/__init__.py +10 -0
- merge/resources/accounting/resources/employees/client.py +61 -0
- 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 +1001 -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/projects/client.py +61 -0
- merge/resources/accounting/resources/projects/raw_client.py +62 -0
- merge/resources/accounting/types/__init__.py +52 -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
- {mergepythonclient-2.1.0.dist-info → mergepythonclient-2.1.1.dist-info}/METADATA +2 -1
- {mergepythonclient-2.1.0.dist-info → mergepythonclient-2.1.1.dist-info}/RECORD +50 -17
- {mergepythonclient-2.1.0.dist-info → mergepythonclient-2.1.1.dist-info}/LICENSE.md +0 -0
- {mergepythonclient-2.1.0.dist-info → mergepythonclient-2.1.1.dist-info}/WHEEL +0 -0
merge/core/client_wrapper.py
CHANGED
|
@@ -24,10 +24,10 @@ class BaseClientWrapper:
|
|
|
24
24
|
|
|
25
25
|
def get_headers(self) -> typing.Dict[str, str]:
|
|
26
26
|
headers: typing.Dict[str, str] = {
|
|
27
|
-
"User-Agent": "MergePythonClient/2.1.
|
|
27
|
+
"User-Agent": "MergePythonClient/2.1.1",
|
|
28
28
|
"X-Fern-Language": "Python",
|
|
29
29
|
"X-Fern-SDK-Name": "MergePythonClient",
|
|
30
|
-
"X-Fern-SDK-Version": "2.1.
|
|
30
|
+
"X-Fern-SDK-Version": "2.1.1",
|
|
31
31
|
**(self.get_custom_headers() or {}),
|
|
32
32
|
}
|
|
33
33
|
if self._account_token is not None:
|
|
@@ -124,12 +124,50 @@ class UncheckedBaseModel(UniversalBaseModel):
|
|
|
124
124
|
return m
|
|
125
125
|
|
|
126
126
|
|
|
127
|
+
def _validate_collection_items_compatible(collection: typing.Any, target_type: typing.Type[typing.Any]) -> bool:
|
|
128
|
+
"""
|
|
129
|
+
Validate that all items in a collection are compatible with the target type.
|
|
130
|
+
|
|
131
|
+
Args:
|
|
132
|
+
collection: The collection to validate (list, set, or dict values)
|
|
133
|
+
target_type: The target type to validate against
|
|
134
|
+
|
|
135
|
+
Returns:
|
|
136
|
+
True if all items are compatible, False otherwise
|
|
137
|
+
"""
|
|
138
|
+
if inspect.isclass(target_type) and issubclass(target_type, pydantic.BaseModel):
|
|
139
|
+
for item in collection:
|
|
140
|
+
try:
|
|
141
|
+
# Try to validate the item against the target type
|
|
142
|
+
if isinstance(item, dict):
|
|
143
|
+
parse_obj_as(target_type, item)
|
|
144
|
+
else:
|
|
145
|
+
# If it's not a dict, it might already be the right type
|
|
146
|
+
if not isinstance(item, target_type):
|
|
147
|
+
return False
|
|
148
|
+
except Exception:
|
|
149
|
+
return False
|
|
150
|
+
return True
|
|
151
|
+
|
|
152
|
+
|
|
127
153
|
def _convert_undiscriminated_union_type(union_type: typing.Type[typing.Any], object_: typing.Any) -> typing.Any:
|
|
128
154
|
inner_types = get_args(union_type)
|
|
129
155
|
if typing.Any in inner_types:
|
|
130
156
|
return object_
|
|
131
157
|
|
|
132
158
|
for inner_type in inner_types:
|
|
159
|
+
# Handle lists of objects that need parsing
|
|
160
|
+
if get_origin(inner_type) is list and isinstance(object_, list):
|
|
161
|
+
list_inner_type = get_args(inner_type)[0]
|
|
162
|
+
try:
|
|
163
|
+
if inspect.isclass(list_inner_type) and issubclass(list_inner_type, pydantic.BaseModel):
|
|
164
|
+
# Validate that all items in the list are compatible with the target type
|
|
165
|
+
if _validate_collection_items_compatible(object_, list_inner_type):
|
|
166
|
+
parsed_list = [parse_obj_as(object_=item, type_=list_inner_type) for item in object_]
|
|
167
|
+
return parsed_list
|
|
168
|
+
except Exception:
|
|
169
|
+
pass
|
|
170
|
+
|
|
133
171
|
try:
|
|
134
172
|
if inspect.isclass(inner_type) and issubclass(inner_type, pydantic.BaseModel):
|
|
135
173
|
# Attempt a validated parse until one works
|
|
@@ -163,6 +163,29 @@ from .types import (
|
|
|
163
163
|
ExpenseLineRequestTrackingCategory,
|
|
164
164
|
ExpenseLineTrackingCategoriesItem,
|
|
165
165
|
ExpenseLineTrackingCategory,
|
|
166
|
+
ExpenseReport,
|
|
167
|
+
ExpenseReportCompany,
|
|
168
|
+
ExpenseReportLine,
|
|
169
|
+
ExpenseReportLineAccount,
|
|
170
|
+
ExpenseReportLineCompany,
|
|
171
|
+
ExpenseReportLineContact,
|
|
172
|
+
ExpenseReportLineEmployee,
|
|
173
|
+
ExpenseReportLineProject,
|
|
174
|
+
ExpenseReportLineRequest,
|
|
175
|
+
ExpenseReportLineRequestAccount,
|
|
176
|
+
ExpenseReportLineRequestCompany,
|
|
177
|
+
ExpenseReportLineRequestContact,
|
|
178
|
+
ExpenseReportLineRequestEmployee,
|
|
179
|
+
ExpenseReportLineRequestProject,
|
|
180
|
+
ExpenseReportLineRequestTaxRate,
|
|
181
|
+
ExpenseReportLineTaxRate,
|
|
182
|
+
ExpenseReportRequest,
|
|
183
|
+
ExpenseReportRequestAccountingPeriod,
|
|
184
|
+
ExpenseReportRequestCompany,
|
|
185
|
+
ExpenseReportRequestEmployee,
|
|
186
|
+
ExpenseReportResponse,
|
|
187
|
+
ExpenseReportStatus,
|
|
188
|
+
ExpenseReportStatusEnum,
|
|
166
189
|
ExpenseRequest,
|
|
167
190
|
ExpenseRequestAccount,
|
|
168
191
|
ExpenseRequestAccountingPeriod,
|
|
@@ -275,6 +298,7 @@ from .types import (
|
|
|
275
298
|
ItemSalesTaxRate,
|
|
276
299
|
ItemSchema,
|
|
277
300
|
ItemStatus,
|
|
301
|
+
ItemType,
|
|
278
302
|
ItemTypeEnum,
|
|
279
303
|
JournalEntry,
|
|
280
304
|
JournalEntryAccountingPeriod,
|
|
@@ -329,6 +353,8 @@ from .types import (
|
|
|
329
353
|
PaginatedCreditNoteList,
|
|
330
354
|
PaginatedEmployeeList,
|
|
331
355
|
PaginatedExpenseList,
|
|
356
|
+
PaginatedExpenseReportLineList,
|
|
357
|
+
PaginatedExpenseReportList,
|
|
332
358
|
PaginatedGeneralLedgerTransactionList,
|
|
333
359
|
PaginatedIncomeStatementList,
|
|
334
360
|
PaginatedInvoiceList,
|
|
@@ -508,6 +534,9 @@ from .resources import (
|
|
|
508
534
|
CreditNotesRetrieveRequestRemoteFields,
|
|
509
535
|
CreditNotesRetrieveRequestShowEnumOrigins,
|
|
510
536
|
EndUserDetailsRequestLanguage,
|
|
537
|
+
ExpenseReportsLinesListRequestExpand,
|
|
538
|
+
ExpenseReportsListRequestExpand,
|
|
539
|
+
ExpenseReportsRetrieveRequestExpand,
|
|
511
540
|
ExpensesListRequestExpand,
|
|
512
541
|
ExpensesRetrieveRequestExpand,
|
|
513
542
|
GeneralLedgerTransactionsListRequestExpand,
|
|
@@ -551,6 +580,7 @@ from .resources import (
|
|
|
551
580
|
credit_notes,
|
|
552
581
|
delete_account,
|
|
553
582
|
employees,
|
|
583
|
+
expense_reports,
|
|
554
584
|
expenses,
|
|
555
585
|
field_mapping,
|
|
556
586
|
force_resync,
|
|
@@ -757,6 +787,32 @@ __all__ = [
|
|
|
757
787
|
"ExpenseLineRequestTrackingCategory",
|
|
758
788
|
"ExpenseLineTrackingCategoriesItem",
|
|
759
789
|
"ExpenseLineTrackingCategory",
|
|
790
|
+
"ExpenseReport",
|
|
791
|
+
"ExpenseReportCompany",
|
|
792
|
+
"ExpenseReportLine",
|
|
793
|
+
"ExpenseReportLineAccount",
|
|
794
|
+
"ExpenseReportLineCompany",
|
|
795
|
+
"ExpenseReportLineContact",
|
|
796
|
+
"ExpenseReportLineEmployee",
|
|
797
|
+
"ExpenseReportLineProject",
|
|
798
|
+
"ExpenseReportLineRequest",
|
|
799
|
+
"ExpenseReportLineRequestAccount",
|
|
800
|
+
"ExpenseReportLineRequestCompany",
|
|
801
|
+
"ExpenseReportLineRequestContact",
|
|
802
|
+
"ExpenseReportLineRequestEmployee",
|
|
803
|
+
"ExpenseReportLineRequestProject",
|
|
804
|
+
"ExpenseReportLineRequestTaxRate",
|
|
805
|
+
"ExpenseReportLineTaxRate",
|
|
806
|
+
"ExpenseReportRequest",
|
|
807
|
+
"ExpenseReportRequestAccountingPeriod",
|
|
808
|
+
"ExpenseReportRequestCompany",
|
|
809
|
+
"ExpenseReportRequestEmployee",
|
|
810
|
+
"ExpenseReportResponse",
|
|
811
|
+
"ExpenseReportStatus",
|
|
812
|
+
"ExpenseReportStatusEnum",
|
|
813
|
+
"ExpenseReportsLinesListRequestExpand",
|
|
814
|
+
"ExpenseReportsListRequestExpand",
|
|
815
|
+
"ExpenseReportsRetrieveRequestExpand",
|
|
760
816
|
"ExpenseRequest",
|
|
761
817
|
"ExpenseRequestAccount",
|
|
762
818
|
"ExpenseRequestAccountingPeriod",
|
|
@@ -878,6 +934,7 @@ __all__ = [
|
|
|
878
934
|
"ItemSalesTaxRate",
|
|
879
935
|
"ItemSchema",
|
|
880
936
|
"ItemStatus",
|
|
937
|
+
"ItemType",
|
|
881
938
|
"ItemTypeEnum",
|
|
882
939
|
"ItemsListRequestExpand",
|
|
883
940
|
"ItemsRetrieveRequestExpand",
|
|
@@ -937,6 +994,8 @@ __all__ = [
|
|
|
937
994
|
"PaginatedCreditNoteList",
|
|
938
995
|
"PaginatedEmployeeList",
|
|
939
996
|
"PaginatedExpenseList",
|
|
997
|
+
"PaginatedExpenseReportLineList",
|
|
998
|
+
"PaginatedExpenseReportList",
|
|
940
999
|
"PaginatedGeneralLedgerTransactionList",
|
|
941
1000
|
"PaginatedIncomeStatementList",
|
|
942
1001
|
"PaginatedInvoiceList",
|
|
@@ -1127,6 +1186,7 @@ __all__ = [
|
|
|
1127
1186
|
"credit_notes",
|
|
1128
1187
|
"delete_account",
|
|
1129
1188
|
"employees",
|
|
1189
|
+
"expense_reports",
|
|
1130
1190
|
"expenses",
|
|
1131
1191
|
"field_mapping",
|
|
1132
1192
|
"force_resync",
|
|
@@ -24,6 +24,7 @@ from .resources.contacts.client import AsyncContactsClient, ContactsClient
|
|
|
24
24
|
from .resources.credit_notes.client import AsyncCreditNotesClient, CreditNotesClient
|
|
25
25
|
from .resources.delete_account.client import AsyncDeleteAccountClient, DeleteAccountClient
|
|
26
26
|
from .resources.employees.client import AsyncEmployeesClient, EmployeesClient
|
|
27
|
+
from .resources.expense_reports.client import AsyncExpenseReportsClient, ExpenseReportsClient
|
|
27
28
|
from .resources.expenses.client import AsyncExpensesClient, ExpensesClient
|
|
28
29
|
from .resources.field_mapping.client import AsyncFieldMappingClient, FieldMappingClient
|
|
29
30
|
from .resources.force_resync.client import AsyncForceResyncClient, ForceResyncClient
|
|
@@ -104,6 +105,8 @@ class AccountingClient:
|
|
|
104
105
|
|
|
105
106
|
self.employees = EmployeesClient(client_wrapper=client_wrapper)
|
|
106
107
|
|
|
108
|
+
self.expense_reports = ExpenseReportsClient(client_wrapper=client_wrapper)
|
|
109
|
+
|
|
107
110
|
self.expenses = ExpensesClient(client_wrapper=client_wrapper)
|
|
108
111
|
|
|
109
112
|
self.field_mapping = FieldMappingClient(client_wrapper=client_wrapper)
|
|
@@ -211,6 +214,8 @@ class AsyncAccountingClient:
|
|
|
211
214
|
|
|
212
215
|
self.employees = AsyncEmployeesClient(client_wrapper=client_wrapper)
|
|
213
216
|
|
|
217
|
+
self.expense_reports = AsyncExpenseReportsClient(client_wrapper=client_wrapper)
|
|
218
|
+
|
|
214
219
|
self.expenses = AsyncExpensesClient(client_wrapper=client_wrapper)
|
|
215
220
|
|
|
216
221
|
self.field_mapping = AsyncFieldMappingClient(client_wrapper=client_wrapper)
|
|
@@ -22,6 +22,7 @@ from . import (
|
|
|
22
22
|
credit_notes,
|
|
23
23
|
delete_account,
|
|
24
24
|
employees,
|
|
25
|
+
expense_reports,
|
|
25
26
|
expenses,
|
|
26
27
|
field_mapping,
|
|
27
28
|
force_resync,
|
|
@@ -67,6 +68,11 @@ from .credit_notes import (
|
|
|
67
68
|
CreditNotesRetrieveRequestRemoteFields,
|
|
68
69
|
CreditNotesRetrieveRequestShowEnumOrigins,
|
|
69
70
|
)
|
|
71
|
+
from .expense_reports import (
|
|
72
|
+
ExpenseReportsLinesListRequestExpand,
|
|
73
|
+
ExpenseReportsListRequestExpand,
|
|
74
|
+
ExpenseReportsRetrieveRequestExpand,
|
|
75
|
+
)
|
|
70
76
|
from .expenses import ExpensesListRequestExpand, ExpensesRetrieveRequestExpand
|
|
71
77
|
from .general_ledger_transactions import (
|
|
72
78
|
GeneralLedgerTransactionsListRequestExpand,
|
|
@@ -106,6 +112,9 @@ __all__ = [
|
|
|
106
112
|
"CreditNotesRetrieveRequestRemoteFields",
|
|
107
113
|
"CreditNotesRetrieveRequestShowEnumOrigins",
|
|
108
114
|
"EndUserDetailsRequestLanguage",
|
|
115
|
+
"ExpenseReportsLinesListRequestExpand",
|
|
116
|
+
"ExpenseReportsListRequestExpand",
|
|
117
|
+
"ExpenseReportsRetrieveRequestExpand",
|
|
109
118
|
"ExpensesListRequestExpand",
|
|
110
119
|
"ExpensesRetrieveRequestExpand",
|
|
111
120
|
"GeneralLedgerTransactionsListRequestExpand",
|
|
@@ -149,6 +158,7 @@ __all__ = [
|
|
|
149
158
|
"credit_notes",
|
|
150
159
|
"delete_account",
|
|
151
160
|
"employees",
|
|
161
|
+
"expense_reports",
|
|
152
162
|
"expenses",
|
|
153
163
|
"field_mapping",
|
|
154
164
|
"force_resync",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
+
import datetime as dt
|
|
3
4
|
import typing
|
|
4
5
|
|
|
5
6
|
from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
@@ -27,12 +28,18 @@ class EmployeesClient:
|
|
|
27
28
|
def list(
|
|
28
29
|
self,
|
|
29
30
|
*,
|
|
31
|
+
company_id: typing.Optional[str] = None,
|
|
32
|
+
created_after: typing.Optional[dt.datetime] = None,
|
|
33
|
+
created_before: typing.Optional[dt.datetime] = None,
|
|
30
34
|
cursor: typing.Optional[str] = None,
|
|
31
35
|
expand: typing.Optional[typing.Literal["company"]] = None,
|
|
32
36
|
include_deleted_data: typing.Optional[bool] = None,
|
|
33
37
|
include_remote_data: typing.Optional[bool] = None,
|
|
34
38
|
include_shell_data: typing.Optional[bool] = None,
|
|
39
|
+
modified_after: typing.Optional[dt.datetime] = None,
|
|
40
|
+
modified_before: typing.Optional[dt.datetime] = None,
|
|
35
41
|
page_size: typing.Optional[int] = None,
|
|
42
|
+
remote_id: typing.Optional[str] = None,
|
|
36
43
|
request_options: typing.Optional[RequestOptions] = None,
|
|
37
44
|
) -> PaginatedEmployeeList:
|
|
38
45
|
"""
|
|
@@ -40,6 +47,15 @@ class EmployeesClient:
|
|
|
40
47
|
|
|
41
48
|
Parameters
|
|
42
49
|
----------
|
|
50
|
+
company_id : typing.Optional[str]
|
|
51
|
+
If provided, will only return employees for this company.
|
|
52
|
+
|
|
53
|
+
created_after : typing.Optional[dt.datetime]
|
|
54
|
+
If provided, will only return objects created after this datetime.
|
|
55
|
+
|
|
56
|
+
created_before : typing.Optional[dt.datetime]
|
|
57
|
+
If provided, will only return objects created before this datetime.
|
|
58
|
+
|
|
43
59
|
cursor : typing.Optional[str]
|
|
44
60
|
The pagination cursor value.
|
|
45
61
|
|
|
@@ -55,9 +71,18 @@ class EmployeesClient:
|
|
|
55
71
|
include_shell_data : typing.Optional[bool]
|
|
56
72
|
Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).
|
|
57
73
|
|
|
74
|
+
modified_after : typing.Optional[dt.datetime]
|
|
75
|
+
If provided, only objects synced by Merge after this date time will be returned.
|
|
76
|
+
|
|
77
|
+
modified_before : typing.Optional[dt.datetime]
|
|
78
|
+
If provided, only objects synced by Merge before this date time will be returned.
|
|
79
|
+
|
|
58
80
|
page_size : typing.Optional[int]
|
|
59
81
|
Number of results to return per page.
|
|
60
82
|
|
|
83
|
+
remote_id : typing.Optional[str]
|
|
84
|
+
The API provider's ID for the given object.
|
|
85
|
+
|
|
61
86
|
request_options : typing.Optional[RequestOptions]
|
|
62
87
|
Request-specific configuration.
|
|
63
88
|
|
|
@@ -77,12 +102,18 @@ class EmployeesClient:
|
|
|
77
102
|
client.accounting.employees.list()
|
|
78
103
|
"""
|
|
79
104
|
_response = self._raw_client.list(
|
|
105
|
+
company_id=company_id,
|
|
106
|
+
created_after=created_after,
|
|
107
|
+
created_before=created_before,
|
|
80
108
|
cursor=cursor,
|
|
81
109
|
expand=expand,
|
|
82
110
|
include_deleted_data=include_deleted_data,
|
|
83
111
|
include_remote_data=include_remote_data,
|
|
84
112
|
include_shell_data=include_shell_data,
|
|
113
|
+
modified_after=modified_after,
|
|
114
|
+
modified_before=modified_before,
|
|
85
115
|
page_size=page_size,
|
|
116
|
+
remote_id=remote_id,
|
|
86
117
|
request_options=request_options,
|
|
87
118
|
)
|
|
88
119
|
return _response.data
|
|
@@ -160,12 +191,18 @@ class AsyncEmployeesClient:
|
|
|
160
191
|
async def list(
|
|
161
192
|
self,
|
|
162
193
|
*,
|
|
194
|
+
company_id: typing.Optional[str] = None,
|
|
195
|
+
created_after: typing.Optional[dt.datetime] = None,
|
|
196
|
+
created_before: typing.Optional[dt.datetime] = None,
|
|
163
197
|
cursor: typing.Optional[str] = None,
|
|
164
198
|
expand: typing.Optional[typing.Literal["company"]] = None,
|
|
165
199
|
include_deleted_data: typing.Optional[bool] = None,
|
|
166
200
|
include_remote_data: typing.Optional[bool] = None,
|
|
167
201
|
include_shell_data: typing.Optional[bool] = None,
|
|
202
|
+
modified_after: typing.Optional[dt.datetime] = None,
|
|
203
|
+
modified_before: typing.Optional[dt.datetime] = None,
|
|
168
204
|
page_size: typing.Optional[int] = None,
|
|
205
|
+
remote_id: typing.Optional[str] = None,
|
|
169
206
|
request_options: typing.Optional[RequestOptions] = None,
|
|
170
207
|
) -> PaginatedEmployeeList:
|
|
171
208
|
"""
|
|
@@ -173,6 +210,15 @@ class AsyncEmployeesClient:
|
|
|
173
210
|
|
|
174
211
|
Parameters
|
|
175
212
|
----------
|
|
213
|
+
company_id : typing.Optional[str]
|
|
214
|
+
If provided, will only return employees for this company.
|
|
215
|
+
|
|
216
|
+
created_after : typing.Optional[dt.datetime]
|
|
217
|
+
If provided, will only return objects created after this datetime.
|
|
218
|
+
|
|
219
|
+
created_before : typing.Optional[dt.datetime]
|
|
220
|
+
If provided, will only return objects created before this datetime.
|
|
221
|
+
|
|
176
222
|
cursor : typing.Optional[str]
|
|
177
223
|
The pagination cursor value.
|
|
178
224
|
|
|
@@ -188,9 +234,18 @@ class AsyncEmployeesClient:
|
|
|
188
234
|
include_shell_data : typing.Optional[bool]
|
|
189
235
|
Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).
|
|
190
236
|
|
|
237
|
+
modified_after : typing.Optional[dt.datetime]
|
|
238
|
+
If provided, only objects synced by Merge after this date time will be returned.
|
|
239
|
+
|
|
240
|
+
modified_before : typing.Optional[dt.datetime]
|
|
241
|
+
If provided, only objects synced by Merge before this date time will be returned.
|
|
242
|
+
|
|
191
243
|
page_size : typing.Optional[int]
|
|
192
244
|
Number of results to return per page.
|
|
193
245
|
|
|
246
|
+
remote_id : typing.Optional[str]
|
|
247
|
+
The API provider's ID for the given object.
|
|
248
|
+
|
|
194
249
|
request_options : typing.Optional[RequestOptions]
|
|
195
250
|
Request-specific configuration.
|
|
196
251
|
|
|
@@ -218,12 +273,18 @@ class AsyncEmployeesClient:
|
|
|
218
273
|
asyncio.run(main())
|
|
219
274
|
"""
|
|
220
275
|
_response = await self._raw_client.list(
|
|
276
|
+
company_id=company_id,
|
|
277
|
+
created_after=created_after,
|
|
278
|
+
created_before=created_before,
|
|
221
279
|
cursor=cursor,
|
|
222
280
|
expand=expand,
|
|
223
281
|
include_deleted_data=include_deleted_data,
|
|
224
282
|
include_remote_data=include_remote_data,
|
|
225
283
|
include_shell_data=include_shell_data,
|
|
284
|
+
modified_after=modified_after,
|
|
285
|
+
modified_before=modified_before,
|
|
226
286
|
page_size=page_size,
|
|
287
|
+
remote_id=remote_id,
|
|
227
288
|
request_options=request_options,
|
|
228
289
|
)
|
|
229
290
|
return _response.data
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
+
import datetime as dt
|
|
3
4
|
import typing
|
|
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.datetime_utils import serialize_datetime
|
|
8
10
|
from .....core.http_response import AsyncHttpResponse, HttpResponse
|
|
9
11
|
from .....core.jsonable_encoder import jsonable_encoder
|
|
10
12
|
from .....core.request_options import RequestOptions
|
|
@@ -20,12 +22,18 @@ class RawEmployeesClient:
|
|
|
20
22
|
def list(
|
|
21
23
|
self,
|
|
22
24
|
*,
|
|
25
|
+
company_id: typing.Optional[str] = None,
|
|
26
|
+
created_after: typing.Optional[dt.datetime] = None,
|
|
27
|
+
created_before: typing.Optional[dt.datetime] = None,
|
|
23
28
|
cursor: typing.Optional[str] = None,
|
|
24
29
|
expand: typing.Optional[typing.Literal["company"]] = None,
|
|
25
30
|
include_deleted_data: typing.Optional[bool] = None,
|
|
26
31
|
include_remote_data: typing.Optional[bool] = None,
|
|
27
32
|
include_shell_data: typing.Optional[bool] = None,
|
|
33
|
+
modified_after: typing.Optional[dt.datetime] = None,
|
|
34
|
+
modified_before: typing.Optional[dt.datetime] = None,
|
|
28
35
|
page_size: typing.Optional[int] = None,
|
|
36
|
+
remote_id: typing.Optional[str] = None,
|
|
29
37
|
request_options: typing.Optional[RequestOptions] = None,
|
|
30
38
|
) -> HttpResponse[PaginatedEmployeeList]:
|
|
31
39
|
"""
|
|
@@ -33,6 +41,15 @@ class RawEmployeesClient:
|
|
|
33
41
|
|
|
34
42
|
Parameters
|
|
35
43
|
----------
|
|
44
|
+
company_id : typing.Optional[str]
|
|
45
|
+
If provided, will only return employees for this company.
|
|
46
|
+
|
|
47
|
+
created_after : typing.Optional[dt.datetime]
|
|
48
|
+
If provided, will only return objects created after this datetime.
|
|
49
|
+
|
|
50
|
+
created_before : typing.Optional[dt.datetime]
|
|
51
|
+
If provided, will only return objects created before this datetime.
|
|
52
|
+
|
|
36
53
|
cursor : typing.Optional[str]
|
|
37
54
|
The pagination cursor value.
|
|
38
55
|
|
|
@@ -48,9 +65,18 @@ class RawEmployeesClient:
|
|
|
48
65
|
include_shell_data : typing.Optional[bool]
|
|
49
66
|
Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).
|
|
50
67
|
|
|
68
|
+
modified_after : typing.Optional[dt.datetime]
|
|
69
|
+
If provided, only objects synced by Merge after this date time will be returned.
|
|
70
|
+
|
|
71
|
+
modified_before : typing.Optional[dt.datetime]
|
|
72
|
+
If provided, only objects synced by Merge before this date time will be returned.
|
|
73
|
+
|
|
51
74
|
page_size : typing.Optional[int]
|
|
52
75
|
Number of results to return per page.
|
|
53
76
|
|
|
77
|
+
remote_id : typing.Optional[str]
|
|
78
|
+
The API provider's ID for the given object.
|
|
79
|
+
|
|
54
80
|
request_options : typing.Optional[RequestOptions]
|
|
55
81
|
Request-specific configuration.
|
|
56
82
|
|
|
@@ -63,12 +89,18 @@ class RawEmployeesClient:
|
|
|
63
89
|
"accounting/v1/employees",
|
|
64
90
|
method="GET",
|
|
65
91
|
params={
|
|
92
|
+
"company_id": company_id,
|
|
93
|
+
"created_after": serialize_datetime(created_after) if created_after is not None else None,
|
|
94
|
+
"created_before": serialize_datetime(created_before) if created_before is not None else None,
|
|
66
95
|
"cursor": cursor,
|
|
67
96
|
"expand": expand,
|
|
68
97
|
"include_deleted_data": include_deleted_data,
|
|
69
98
|
"include_remote_data": include_remote_data,
|
|
70
99
|
"include_shell_data": include_shell_data,
|
|
100
|
+
"modified_after": serialize_datetime(modified_after) if modified_after is not None else None,
|
|
101
|
+
"modified_before": serialize_datetime(modified_before) if modified_before is not None else None,
|
|
71
102
|
"page_size": page_size,
|
|
103
|
+
"remote_id": remote_id,
|
|
72
104
|
},
|
|
73
105
|
request_options=request_options,
|
|
74
106
|
)
|
|
@@ -153,12 +185,18 @@ class AsyncRawEmployeesClient:
|
|
|
153
185
|
async def list(
|
|
154
186
|
self,
|
|
155
187
|
*,
|
|
188
|
+
company_id: typing.Optional[str] = None,
|
|
189
|
+
created_after: typing.Optional[dt.datetime] = None,
|
|
190
|
+
created_before: typing.Optional[dt.datetime] = None,
|
|
156
191
|
cursor: typing.Optional[str] = None,
|
|
157
192
|
expand: typing.Optional[typing.Literal["company"]] = None,
|
|
158
193
|
include_deleted_data: typing.Optional[bool] = None,
|
|
159
194
|
include_remote_data: typing.Optional[bool] = None,
|
|
160
195
|
include_shell_data: typing.Optional[bool] = None,
|
|
196
|
+
modified_after: typing.Optional[dt.datetime] = None,
|
|
197
|
+
modified_before: typing.Optional[dt.datetime] = None,
|
|
161
198
|
page_size: typing.Optional[int] = None,
|
|
199
|
+
remote_id: typing.Optional[str] = None,
|
|
162
200
|
request_options: typing.Optional[RequestOptions] = None,
|
|
163
201
|
) -> AsyncHttpResponse[PaginatedEmployeeList]:
|
|
164
202
|
"""
|
|
@@ -166,6 +204,15 @@ class AsyncRawEmployeesClient:
|
|
|
166
204
|
|
|
167
205
|
Parameters
|
|
168
206
|
----------
|
|
207
|
+
company_id : typing.Optional[str]
|
|
208
|
+
If provided, will only return employees for this company.
|
|
209
|
+
|
|
210
|
+
created_after : typing.Optional[dt.datetime]
|
|
211
|
+
If provided, will only return objects created after this datetime.
|
|
212
|
+
|
|
213
|
+
created_before : typing.Optional[dt.datetime]
|
|
214
|
+
If provided, will only return objects created before this datetime.
|
|
215
|
+
|
|
169
216
|
cursor : typing.Optional[str]
|
|
170
217
|
The pagination cursor value.
|
|
171
218
|
|
|
@@ -181,9 +228,18 @@ class AsyncRawEmployeesClient:
|
|
|
181
228
|
include_shell_data : typing.Optional[bool]
|
|
182
229
|
Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).
|
|
183
230
|
|
|
231
|
+
modified_after : typing.Optional[dt.datetime]
|
|
232
|
+
If provided, only objects synced by Merge after this date time will be returned.
|
|
233
|
+
|
|
234
|
+
modified_before : typing.Optional[dt.datetime]
|
|
235
|
+
If provided, only objects synced by Merge before this date time will be returned.
|
|
236
|
+
|
|
184
237
|
page_size : typing.Optional[int]
|
|
185
238
|
Number of results to return per page.
|
|
186
239
|
|
|
240
|
+
remote_id : typing.Optional[str]
|
|
241
|
+
The API provider's ID for the given object.
|
|
242
|
+
|
|
187
243
|
request_options : typing.Optional[RequestOptions]
|
|
188
244
|
Request-specific configuration.
|
|
189
245
|
|
|
@@ -196,12 +252,18 @@ class AsyncRawEmployeesClient:
|
|
|
196
252
|
"accounting/v1/employees",
|
|
197
253
|
method="GET",
|
|
198
254
|
params={
|
|
255
|
+
"company_id": company_id,
|
|
256
|
+
"created_after": serialize_datetime(created_after) if created_after is not None else None,
|
|
257
|
+
"created_before": serialize_datetime(created_before) if created_before is not None else None,
|
|
199
258
|
"cursor": cursor,
|
|
200
259
|
"expand": expand,
|
|
201
260
|
"include_deleted_data": include_deleted_data,
|
|
202
261
|
"include_remote_data": include_remote_data,
|
|
203
262
|
"include_shell_data": include_shell_data,
|
|
263
|
+
"modified_after": serialize_datetime(modified_after) if modified_after is not None else None,
|
|
264
|
+
"modified_before": serialize_datetime(modified_before) if modified_before is not None else None,
|
|
204
265
|
"page_size": page_size,
|
|
266
|
+
"remote_id": remote_id,
|
|
205
267
|
},
|
|
206
268
|
request_options=request_options,
|
|
207
269
|
)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
from .types import (
|
|
6
|
+
ExpenseReportsLinesListRequestExpand,
|
|
7
|
+
ExpenseReportsListRequestExpand,
|
|
8
|
+
ExpenseReportsRetrieveRequestExpand,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
__all__ = [
|
|
12
|
+
"ExpenseReportsLinesListRequestExpand",
|
|
13
|
+
"ExpenseReportsListRequestExpand",
|
|
14
|
+
"ExpenseReportsRetrieveRequestExpand",
|
|
15
|
+
]
|