From 70591ccbee6e1746927223bdfece2067174fc0db Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 15:18:43 +0000 Subject: [PATCH] SDK regeneration --- .mock/definition/accounting/__package__.yml | 3089 +++++++++++++++++ .mock/definition/accounting/employees.yml | 24 + .../definition/accounting/expenseReports.yml | 938 +++++ .mock/definition/accounting/fieldMapping.yml | 20 + .mock/definition/accounting/items.yml | 4 + .mock/definition/accounting/payments.yml | 16 +- .mock/definition/accounting/projects.yml | 24 + README.md | 1 + poetry.lock | 6 +- pyproject.toml | 2 +- reference.md | 894 ++++- src/merge/core/client_wrapper.py | 4 +- src/merge/core/unchecked_base_model.py | 38 + src/merge/resources/accounting/__init__.py | 60 + src/merge/resources/accounting/client.py | 5 + .../accounting/resources/__init__.py | 10 + .../accounting/resources/employees/client.py | 61 + .../resources/employees/raw_client.py | 62 + .../resources/expense_reports/__init__.py | 15 + .../resources/expense_reports/client.py | 1001 ++++++ .../resources/expense_reports/raw_client.py | 1020 ++++++ .../expense_reports/types/__init__.py | 13 + ...pense_reports_lines_list_request_expand.py | 265 ++ .../expense_reports_list_request_expand.py | 73 + ...expense_reports_retrieve_request_expand.py | 73 + .../accounting/resources/projects/client.py | 61 + .../resources/projects/raw_client.py | 62 + .../resources/accounting/types/__init__.py | 52 + .../accounting/types/expense_report.py | 423 +++ .../types/expense_report_company.py | 7 + .../accounting/types/expense_report_line.py | 441 +++ .../types/expense_report_line_account.py | 7 + .../types/expense_report_line_company.py | 7 + .../types/expense_report_line_contact.py | 7 + .../types/expense_report_line_employee.py | 7 + .../types/expense_report_line_project.py | 7 + .../types/expense_report_line_request.py | 427 +++ .../expense_report_line_request_account.py | 7 + .../expense_report_line_request_company.py | 7 + .../expense_report_line_request_contact.py | 7 + .../expense_report_line_request_employee.py | 7 + .../expense_report_line_request_project.py | 7 + .../expense_report_line_request_tax_rate.py | 7 + .../types/expense_report_line_tax_rate.py | 7 + .../types/expense_report_request.py | 401 +++ ...xpense_report_request_accounting_period.py | 7 + .../types/expense_report_request_company.py | 7 + .../types/expense_report_request_employee.py | 7 + .../types/expense_report_response.py | 27 + .../accounting/types/expense_report_status.py | 7 + .../types/expense_report_status_enum.py | 36 + .../external_target_field_api_response.py | 3 + .../field_mapping_api_instance_response.py | 3 + src/merge/resources/accounting/types/item.py | 11 + .../resources/accounting/types/item_type.py | 7 + .../paginated_expense_report_line_list.py | 23 + .../types/paginated_expense_report_list.py | 23 + 57 files changed, 9816 insertions(+), 21 deletions(-) create mode 100644 .mock/definition/accounting/expenseReports.yml create mode 100644 src/merge/resources/accounting/resources/expense_reports/__init__.py create mode 100644 src/merge/resources/accounting/resources/expense_reports/client.py create mode 100644 src/merge/resources/accounting/resources/expense_reports/raw_client.py create mode 100644 src/merge/resources/accounting/resources/expense_reports/types/__init__.py create mode 100644 src/merge/resources/accounting/resources/expense_reports/types/expense_reports_lines_list_request_expand.py create mode 100644 src/merge/resources/accounting/resources/expense_reports/types/expense_reports_list_request_expand.py create mode 100644 src/merge/resources/accounting/resources/expense_reports/types/expense_reports_retrieve_request_expand.py create mode 100644 src/merge/resources/accounting/types/expense_report.py create mode 100644 src/merge/resources/accounting/types/expense_report_company.py create mode 100644 src/merge/resources/accounting/types/expense_report_line.py create mode 100644 src/merge/resources/accounting/types/expense_report_line_account.py create mode 100644 src/merge/resources/accounting/types/expense_report_line_company.py create mode 100644 src/merge/resources/accounting/types/expense_report_line_contact.py create mode 100644 src/merge/resources/accounting/types/expense_report_line_employee.py create mode 100644 src/merge/resources/accounting/types/expense_report_line_project.py create mode 100644 src/merge/resources/accounting/types/expense_report_line_request.py create mode 100644 src/merge/resources/accounting/types/expense_report_line_request_account.py create mode 100644 src/merge/resources/accounting/types/expense_report_line_request_company.py create mode 100644 src/merge/resources/accounting/types/expense_report_line_request_contact.py create mode 100644 src/merge/resources/accounting/types/expense_report_line_request_employee.py create mode 100644 src/merge/resources/accounting/types/expense_report_line_request_project.py create mode 100644 src/merge/resources/accounting/types/expense_report_line_request_tax_rate.py create mode 100644 src/merge/resources/accounting/types/expense_report_line_tax_rate.py create mode 100644 src/merge/resources/accounting/types/expense_report_request.py create mode 100644 src/merge/resources/accounting/types/expense_report_request_accounting_period.py create mode 100644 src/merge/resources/accounting/types/expense_report_request_company.py create mode 100644 src/merge/resources/accounting/types/expense_report_request_employee.py create mode 100644 src/merge/resources/accounting/types/expense_report_response.py create mode 100644 src/merge/resources/accounting/types/expense_report_status.py create mode 100644 src/merge/resources/accounting/types/expense_report_status_enum.py create mode 100644 src/merge/resources/accounting/types/item_type.py create mode 100644 src/merge/resources/accounting/types/paginated_expense_report_line_list.py create mode 100644 src/merge/resources/accounting/types/paginated_expense_report_list.py diff --git a/.mock/definition/accounting/__package__.yml b/.mock/definition/accounting/__package__.yml index 8b5d4d04..3a198d77 100644 --- a/.mock/definition/accounting/__package__.yml +++ b/.mock/definition/accounting/__package__.yml @@ -20423,6 +20423,3055 @@ types: access: write-only source: openapi: openapi/openapi.yml + ExpenseReportStatus: + discriminated: false + docs: >- + Overall status of the expense report. One of DRAFT, SUBMITTED, APPROVED, + REJECTED + + + * `DRAFT` - DRAFT + + * `SUBMITTED` - SUBMITTED + + * `APPROVED` - APPROVED + + * `REJECTED` - REJECTED + union: + - ExpenseReportStatusEnum + - string + source: + openapi: openapi/openapi.yml + inline: true + ExpenseReportCompany: + discriminated: false + docs: The subsidiary that the expense report is created in + union: + - type: string + validation: + format: uuid + - CompanyInfo + source: + openapi: openapi/openapi.yml + inline: true + ExpenseReport: + docs: >- + # The ExpenseReport Object + + ### Description + + The `ExpenseReport` object represents a collection of expenses submitted + for review and reimbursement. + + It includes details about the submitter, status, amounts, and associated + metadata. + + + ### Usage Example + + Fetch from the `GET ExpenseReport` endpoint to view details of expense + reports and their line items. + properties: + id: + type: optional + validation: + format: uuid + access: read-only + remote_id: + type: optional + docs: The third-party API ID of the matching object. + created_at: + type: optional + docs: The datetime that this object was created by Merge. + access: read-only + modified_at: + type: optional + docs: The datetime that this object was modified by Merge. + access: read-only + report_date: + type: optional + docs: The date of the expense report. + report_identifier: + type: optional + docs: Human-readable expense report identifier. + validation: + maxLength: 1024 + employee: + type: optional + docs: >- + Identifier for the employee who submitted or is associated with the + expense report + validation: + format: uuid + status: + type: optional + docs: >- + Overall status of the expense report. One of DRAFT, SUBMITTED, + APPROVED, REJECTED + + + * `DRAFT` - DRAFT + + * `SUBMITTED` - SUBMITTED + + * `APPROVED` - APPROVED + + * `REJECTED` - REJECTED + total_amount: + type: optional + docs: Total amount of the expense report + lines: + type: optional> + access: read-only + currency: + type: optional + docs: >- + Currency code for the expense report + + + * `XUA` - ADB Unit of Account + + * `AFN` - Afghan Afghani + + * `AFA` - Afghan Afghani (1927–2002) + + * `ALL` - Albanian Lek + + * `ALK` - Albanian Lek (1946–1965) + + * `DZD` - Algerian Dinar + + * `ADP` - Andorran Peseta + + * `AOA` - Angolan Kwanza + + * `AOK` - Angolan Kwanza (1977–1991) + + * `AON` - Angolan New Kwanza (1990–2000) + + * `AOR` - Angolan Readjusted Kwanza (1995–1999) + + * `ARA` - Argentine Austral + + * `ARS` - Argentine Peso + + * `ARM` - Argentine Peso (1881–1970) + + * `ARP` - Argentine Peso (1983–1985) + + * `ARL` - Argentine Peso Ley (1970–1983) + + * `AMD` - Armenian Dram + + * `AWG` - Aruban Florin + + * `AUD` - Australian Dollar + + * `ATS` - Austrian Schilling + + * `AZN` - Azerbaijani Manat + + * `AZM` - Azerbaijani Manat (1993–2006) + + * `BSD` - Bahamian Dollar + + * `BHD` - Bahraini Dinar + + * `BDT` - Bangladeshi Taka + + * `BBD` - Barbadian Dollar + + * `BYN` - Belarusian Ruble + + * `BYB` - Belarusian Ruble (1994–1999) + + * `BYR` - Belarusian Ruble (2000–2016) + + * `BEF` - Belgian Franc + + * `BEC` - Belgian Franc (convertible) + + * `BEL` - Belgian Franc (financial) + + * `BZD` - Belize Dollar + + * `BMD` - Bermudan Dollar + + * `BTN` - Bhutanese Ngultrum + + * `BOB` - Bolivian Boliviano + + * `BOL` - Bolivian Boliviano (1863–1963) + + * `BOV` - Bolivian Mvdol + + * `BOP` - Bolivian Peso + + * `BAM` - Bosnia-Herzegovina Convertible Mark + + * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) + + * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) + + * `BWP` - Botswanan Pula + + * `BRC` - Brazilian Cruzado (1986–1989) + + * `BRZ` - Brazilian Cruzeiro (1942–1967) + + * `BRE` - Brazilian Cruzeiro (1990–1993) + + * `BRR` - Brazilian Cruzeiro (1993–1994) + + * `BRN` - Brazilian New Cruzado (1989–1990) + + * `BRB` - Brazilian New Cruzeiro (1967–1986) + + * `BRL` - Brazilian Real + + * `GBP` - British Pound + + * `BND` - Brunei Dollar + + * `BGL` - Bulgarian Hard Lev + + * `BGN` - Bulgarian Lev + + * `BGO` - Bulgarian Lev (1879–1952) + + * `BGM` - Bulgarian Socialist Lev + + * `BUK` - Burmese Kyat + + * `BIF` - Burundian Franc + + * `XPF` - CFP Franc + + * `KHR` - Cambodian Riel + + * `CAD` - Canadian Dollar + + * `CVE` - Cape Verdean Escudo + + * `KYD` - Cayman Islands Dollar + + * `XAF` - Central African CFA Franc + + * `CLE` - Chilean Escudo + + * `CLP` - Chilean Peso + + * `CLF` - Chilean Unit of Account (UF) + + * `CNX` - Chinese People’s Bank Dollar + + * `CNY` - Chinese Yuan + + * `CNH` - Chinese Yuan (offshore) + + * `COP` - Colombian Peso + + * `COU` - Colombian Real Value Unit + + * `KMF` - Comorian Franc + + * `CDF` - Congolese Franc + + * `CRC` - Costa Rican Colón + + * `HRD` - Croatian Dinar + + * `HRK` - Croatian Kuna + + * `CUC` - Cuban Convertible Peso + + * `CUP` - Cuban Peso + + * `CYP` - Cypriot Pound + + * `CZK` - Czech Koruna + + * `CSK` - Czechoslovak Hard Koruna + + * `DKK` - Danish Krone + + * `DJF` - Djiboutian Franc + + * `DOP` - Dominican Peso + + * `NLG` - Dutch Guilder + + * `XCD` - East Caribbean Dollar + + * `DDM` - East German Mark + + * `ECS` - Ecuadorian Sucre + + * `ECV` - Ecuadorian Unit of Constant Value + + * `EGP` - Egyptian Pound + + * `GQE` - Equatorial Guinean Ekwele + + * `ERN` - Eritrean Nakfa + + * `EEK` - Estonian Kroon + + * `ETB` - Ethiopian Birr + + * `EUR` - Euro + + * `XBA` - European Composite Unit + + * `XEU` - European Currency Unit + + * `XBB` - European Monetary Unit + + * `XBC` - European Unit of Account (XBC) + + * `XBD` - European Unit of Account (XBD) + + * `FKP` - Falkland Islands Pound + + * `FJD` - Fijian Dollar + + * `FIM` - Finnish Markka + + * `FRF` - French Franc + + * `XFO` - French Gold Franc + + * `XFU` - French UIC-Franc + + * `GMD` - Gambian Dalasi + + * `GEK` - Georgian Kupon Larit + + * `GEL` - Georgian Lari + + * `DEM` - German Mark + + * `GHS` - Ghanaian Cedi + + * `GHC` - Ghanaian Cedi (1979–2007) + + * `GIP` - Gibraltar Pound + + * `XAU` - Gold + + * `GRD` - Greek Drachma + + * `GTQ` - Guatemalan Quetzal + + * `GWP` - Guinea-Bissau Peso + + * `GNF` - Guinean Franc + + * `GNS` - Guinean Syli + + * `GYD` - Guyanaese Dollar + + * `HTG` - Haitian Gourde + + * `HNL` - Honduran Lempira + + * `HKD` - Hong Kong Dollar + + * `HUF` - Hungarian Forint + + * `IMP` - IMP + + * `ISK` - Icelandic Króna + + * `ISJ` - Icelandic Króna (1918–1981) + + * `INR` - Indian Rupee + + * `IDR` - Indonesian Rupiah + + * `IRR` - Iranian Rial + + * `IQD` - Iraqi Dinar + + * `IEP` - Irish Pound + + * `ILS` - Israeli New Shekel + + * `ILP` - Israeli Pound + + * `ILR` - Israeli Shekel (1980–1985) + + * `ITL` - Italian Lira + + * `JMD` - Jamaican Dollar + + * `JPY` - Japanese Yen + + * `JOD` - Jordanian Dinar + + * `KZT` - Kazakhstani Tenge + + * `KES` - Kenyan Shilling + + * `KWD` - Kuwaiti Dinar + + * `KGS` - Kyrgystani Som + + * `LAK` - Laotian Kip + + * `LVL` - Latvian Lats + + * `LVR` - Latvian Ruble + + * `LBP` - Lebanese Pound + + * `LSL` - Lesotho Loti + + * `LRD` - Liberian Dollar + + * `LYD` - Libyan Dinar + + * `LTL` - Lithuanian Litas + + * `LTT` - Lithuanian Talonas + + * `LUL` - Luxembourg Financial Franc + + * `LUC` - Luxembourgian Convertible Franc + + * `LUF` - Luxembourgian Franc + + * `MOP` - Macanese Pataca + + * `MKD` - Macedonian Denar + + * `MKN` - Macedonian Denar (1992–1993) + + * `MGA` - Malagasy Ariary + + * `MGF` - Malagasy Franc + + * `MWK` - Malawian Kwacha + + * `MYR` - Malaysian Ringgit + + * `MVR` - Maldivian Rufiyaa + + * `MVP` - Maldivian Rupee (1947–1981) + + * `MLF` - Malian Franc + + * `MTL` - Maltese Lira + + * `MTP` - Maltese Pound + + * `MRU` - Mauritanian Ouguiya + + * `MRO` - Mauritanian Ouguiya (1973–2017) + + * `MUR` - Mauritian Rupee + + * `MXV` - Mexican Investment Unit + + * `MXN` - Mexican Peso + + * `MXP` - Mexican Silver Peso (1861–1992) + + * `MDC` - Moldovan Cupon + + * `MDL` - Moldovan Leu + + * `MCF` - Monegasque Franc + + * `MNT` - Mongolian Tugrik + + * `MAD` - Moroccan Dirham + + * `MAF` - Moroccan Franc + + * `MZE` - Mozambican Escudo + + * `MZN` - Mozambican Metical + + * `MZM` - Mozambican Metical (1980–2006) + + * `MMK` - Myanmar Kyat + + * `NAD` - Namibian Dollar + + * `NPR` - Nepalese Rupee + + * `ANG` - Netherlands Antillean Guilder + + * `TWD` - New Taiwan Dollar + + * `NZD` - New Zealand Dollar + + * `NIO` - Nicaraguan Córdoba + + * `NIC` - Nicaraguan Córdoba (1988–1991) + + * `NGN` - Nigerian Naira + + * `KPW` - North Korean Won + + * `NOK` - Norwegian Krone + + * `OMR` - Omani Rial + + * `PKR` - Pakistani Rupee + + * `XPD` - Palladium + + * `PAB` - Panamanian Balboa + + * `PGK` - Papua New Guinean Kina + + * `PYG` - Paraguayan Guarani + + * `PEI` - Peruvian Inti + + * `PEN` - Peruvian Sol + + * `PES` - Peruvian Sol (1863–1965) + + * `PHP` - Philippine Peso + + * `XPT` - Platinum + + * `PLN` - Polish Zloty + + * `PLZ` - Polish Zloty (1950–1995) + + * `PTE` - Portuguese Escudo + + * `GWE` - Portuguese Guinea Escudo + + * `QAR` - Qatari Rial + + * `XRE` - RINET Funds + + * `RHD` - Rhodesian Dollar + + * `RON` - Romanian Leu + + * `ROL` - Romanian Leu (1952–2006) + + * `RUB` - Russian Ruble + + * `RUR` - Russian Ruble (1991–1998) + + * `RWF` - Rwandan Franc + + * `SVC` - Salvadoran Colón + + * `WST` - Samoan Tala + + * `SAR` - Saudi Riyal + + * `RSD` - Serbian Dinar + + * `CSD` - Serbian Dinar (2002–2006) + + * `SCR` - Seychellois Rupee + + * `SLL` - Sierra Leonean Leone + + * `XAG` - Silver + + * `SGD` - Singapore Dollar + + * `SKK` - Slovak Koruna + + * `SIT` - Slovenian Tolar + + * `SBD` - Solomon Islands Dollar + + * `SOS` - Somali Shilling + + * `ZAR` - South African Rand + + * `ZAL` - South African Rand (financial) + + * `KRH` - South Korean Hwan (1953–1962) + + * `KRW` - South Korean Won + + * `KRO` - South Korean Won (1945–1953) + + * `SSP` - South Sudanese Pound + + * `SUR` - Soviet Rouble + + * `ESP` - Spanish Peseta + + * `ESA` - Spanish Peseta (A account) + + * `ESB` - Spanish Peseta (convertible account) + + * `XDR` - Special Drawing Rights + + * `LKR` - Sri Lankan Rupee + + * `SHP` - St. Helena Pound + + * `XSU` - Sucre + + * `SDD` - Sudanese Dinar (1992–2007) + + * `SDG` - Sudanese Pound + + * `SDP` - Sudanese Pound (1957–1998) + + * `SRD` - Surinamese Dollar + + * `SRG` - Surinamese Guilder + + * `SZL` - Swazi Lilangeni + + * `SEK` - Swedish Krona + + * `CHF` - Swiss Franc + + * `SYP` - Syrian Pound + + * `STN` - São Tomé & Príncipe Dobra + + * `STD` - São Tomé & Príncipe Dobra (1977–2017) + + * `TVD` - TVD + + * `TJR` - Tajikistani Ruble + + * `TJS` - Tajikistani Somoni + + * `TZS` - Tanzanian Shilling + + * `XTS` - Testing Currency Code + + * `THB` - Thai Baht + + * `XXX` - The codes assigned for transactions where no currency is + involved + + * `TPE` - Timorese Escudo + + * `TOP` - Tongan Paʻanga + + * `TTD` - Trinidad & Tobago Dollar + + * `TND` - Tunisian Dinar + + * `TRY` - Turkish Lira + + * `TRL` - Turkish Lira (1922–2005) + + * `TMT` - Turkmenistani Manat + + * `TMM` - Turkmenistani Manat (1993–2009) + + * `USD` - US Dollar + + * `USN` - US Dollar (Next day) + + * `USS` - US Dollar (Same day) + + * `UGX` - Ugandan Shilling + + * `UGS` - Ugandan Shilling (1966–1987) + + * `UAH` - Ukrainian Hryvnia + + * `UAK` - Ukrainian Karbovanets + + * `AED` - United Arab Emirates Dirham + + * `UYW` - Uruguayan Nominal Wage Index Unit + + * `UYU` - Uruguayan Peso + + * `UYP` - Uruguayan Peso (1975–1993) + + * `UYI` - Uruguayan Peso (Indexed Units) + + * `UZS` - Uzbekistani Som + + * `VUV` - Vanuatu Vatu + + * `VES` - Venezuelan Bolívar + + * `VEB` - Venezuelan Bolívar (1871–2008) + + * `VEF` - Venezuelan Bolívar (2008–2018) + + * `VND` - Vietnamese Dong + + * `VNN` - Vietnamese Dong (1978–1985) + + * `CHE` - WIR Euro + + * `CHW` - WIR Franc + + * `XOF` - West African CFA Franc + + * `YDD` - Yemeni Dinar + + * `YER` - Yemeni Rial + + * `YUN` - Yugoslavian Convertible Dinar (1990–1992) + + * `YUD` - Yugoslavian Hard Dinar (1966–1990) + + * `YUM` - Yugoslavian New Dinar (1994–2002) + + * `YUR` - Yugoslavian Reformed Dinar (1992–1993) + + * `ZWN` - ZWN + + * `ZRN` - Zairean New Zaire (1993–1998) + + * `ZRZ` - Zairean Zaire (1971–1993) + + * `ZMW` - Zambian Kwacha + + * `ZMK` - Zambian Kwacha (1968–2012) + + * `ZWD` - Zimbabwean Dollar (1980–2008) + + * `ZWR` - Zimbabwean Dollar (2008) + + * `ZWL` - Zimbabwean Dollar (2009) + description: + type: optional + docs: A brief description or purpose for the expense report + validation: + maxLength: 1024 + accounting_period: + type: optional + docs: The accounting period the report was posted in + validation: + format: uuid + company: + type: optional + docs: The subsidiary that the expense report is created in + tracking_categories: + docs: The related tracking categories associated with the expense report + type: list + remote_was_deleted: + type: optional + docs: >- + 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/). + access: read-only + field_mappings: + type: optional> + access: read-only + remote_data: + type: optional> + access: read-only + remote_fields: + type: optional> + access: read-only + source: + openapi: openapi/openapi.yml + ExpenseReportLineAccount: + discriminated: false + union: + - type: string + validation: + format: uuid + - Account + source: + openapi: openapi/openapi.yml + inline: true + ExpenseReportLineEmployee: + discriminated: false + docs: >- + Identifier for the employee who submitted or is associated with the + expense report + union: + - type: string + validation: + format: uuid + - Employee + source: + openapi: openapi/openapi.yml + inline: true + ExpenseReportLineProject: + discriminated: false + union: + - type: string + validation: + format: uuid + - Project + source: + openapi: openapi/openapi.yml + inline: true + ExpenseReportLineCompany: + discriminated: false + docs: The subsidiary that the expense report is created in + union: + - type: string + validation: + format: uuid + - CompanyInfo + source: + openapi: openapi/openapi.yml + inline: true + ExpenseReportLineContact: + discriminated: false + union: + - type: string + validation: + format: uuid + - Contact + source: + openapi: openapi/openapi.yml + inline: true + ExpenseReportLineTaxRate: + discriminated: false + union: + - type: string + validation: + format: uuid + - TaxRate + source: + openapi: openapi/openapi.yml + inline: true + ExpenseReportLine: + docs: >- + # The ExpenseReportLine Object + + ### Description + + The `ExpenseReportLine` object represents an individual line item within + an expense report, containing details about + + a specific expense such as amount, description, and associated metadata. + + + ### Usage Example + + Fetch from the `GET ExpenseReport` endpoint and expand the lines field to + view all line items in the expense report. + properties: + id: + type: optional + validation: + format: uuid + access: read-only + remote_id: + type: optional + docs: The third-party API ID of the matching object. + created_at: + type: optional + docs: The datetime that this object was created by Merge. + access: read-only + modified_at: + type: optional + docs: The datetime that this object was modified by Merge. + access: read-only + account: optional + description: + type: optional + docs: Description of the individual expense. + validation: + maxLength: 1024 + expense_date: + type: optional + docs: The date the individual expense was incurred. + amount: + type: optional + docs: The amount of the expense for the line item. + currency: + type: optional + docs: >- + Currency of the expense line (if different from the report currency). + + + * `XUA` - ADB Unit of Account + + * `AFN` - Afghan Afghani + + * `AFA` - Afghan Afghani (1927–2002) + + * `ALL` - Albanian Lek + + * `ALK` - Albanian Lek (1946–1965) + + * `DZD` - Algerian Dinar + + * `ADP` - Andorran Peseta + + * `AOA` - Angolan Kwanza + + * `AOK` - Angolan Kwanza (1977–1991) + + * `AON` - Angolan New Kwanza (1990–2000) + + * `AOR` - Angolan Readjusted Kwanza (1995–1999) + + * `ARA` - Argentine Austral + + * `ARS` - Argentine Peso + + * `ARM` - Argentine Peso (1881–1970) + + * `ARP` - Argentine Peso (1983–1985) + + * `ARL` - Argentine Peso Ley (1970–1983) + + * `AMD` - Armenian Dram + + * `AWG` - Aruban Florin + + * `AUD` - Australian Dollar + + * `ATS` - Austrian Schilling + + * `AZN` - Azerbaijani Manat + + * `AZM` - Azerbaijani Manat (1993–2006) + + * `BSD` - Bahamian Dollar + + * `BHD` - Bahraini Dinar + + * `BDT` - Bangladeshi Taka + + * `BBD` - Barbadian Dollar + + * `BYN` - Belarusian Ruble + + * `BYB` - Belarusian Ruble (1994–1999) + + * `BYR` - Belarusian Ruble (2000–2016) + + * `BEF` - Belgian Franc + + * `BEC` - Belgian Franc (convertible) + + * `BEL` - Belgian Franc (financial) + + * `BZD` - Belize Dollar + + * `BMD` - Bermudan Dollar + + * `BTN` - Bhutanese Ngultrum + + * `BOB` - Bolivian Boliviano + + * `BOL` - Bolivian Boliviano (1863–1963) + + * `BOV` - Bolivian Mvdol + + * `BOP` - Bolivian Peso + + * `BAM` - Bosnia-Herzegovina Convertible Mark + + * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) + + * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) + + * `BWP` - Botswanan Pula + + * `BRC` - Brazilian Cruzado (1986–1989) + + * `BRZ` - Brazilian Cruzeiro (1942–1967) + + * `BRE` - Brazilian Cruzeiro (1990–1993) + + * `BRR` - Brazilian Cruzeiro (1993–1994) + + * `BRN` - Brazilian New Cruzado (1989–1990) + + * `BRB` - Brazilian New Cruzeiro (1967–1986) + + * `BRL` - Brazilian Real + + * `GBP` - British Pound + + * `BND` - Brunei Dollar + + * `BGL` - Bulgarian Hard Lev + + * `BGN` - Bulgarian Lev + + * `BGO` - Bulgarian Lev (1879–1952) + + * `BGM` - Bulgarian Socialist Lev + + * `BUK` - Burmese Kyat + + * `BIF` - Burundian Franc + + * `XPF` - CFP Franc + + * `KHR` - Cambodian Riel + + * `CAD` - Canadian Dollar + + * `CVE` - Cape Verdean Escudo + + * `KYD` - Cayman Islands Dollar + + * `XAF` - Central African CFA Franc + + * `CLE` - Chilean Escudo + + * `CLP` - Chilean Peso + + * `CLF` - Chilean Unit of Account (UF) + + * `CNX` - Chinese People’s Bank Dollar + + * `CNY` - Chinese Yuan + + * `CNH` - Chinese Yuan (offshore) + + * `COP` - Colombian Peso + + * `COU` - Colombian Real Value Unit + + * `KMF` - Comorian Franc + + * `CDF` - Congolese Franc + + * `CRC` - Costa Rican Colón + + * `HRD` - Croatian Dinar + + * `HRK` - Croatian Kuna + + * `CUC` - Cuban Convertible Peso + + * `CUP` - Cuban Peso + + * `CYP` - Cypriot Pound + + * `CZK` - Czech Koruna + + * `CSK` - Czechoslovak Hard Koruna + + * `DKK` - Danish Krone + + * `DJF` - Djiboutian Franc + + * `DOP` - Dominican Peso + + * `NLG` - Dutch Guilder + + * `XCD` - East Caribbean Dollar + + * `DDM` - East German Mark + + * `ECS` - Ecuadorian Sucre + + * `ECV` - Ecuadorian Unit of Constant Value + + * `EGP` - Egyptian Pound + + * `GQE` - Equatorial Guinean Ekwele + + * `ERN` - Eritrean Nakfa + + * `EEK` - Estonian Kroon + + * `ETB` - Ethiopian Birr + + * `EUR` - Euro + + * `XBA` - European Composite Unit + + * `XEU` - European Currency Unit + + * `XBB` - European Monetary Unit + + * `XBC` - European Unit of Account (XBC) + + * `XBD` - European Unit of Account (XBD) + + * `FKP` - Falkland Islands Pound + + * `FJD` - Fijian Dollar + + * `FIM` - Finnish Markka + + * `FRF` - French Franc + + * `XFO` - French Gold Franc + + * `XFU` - French UIC-Franc + + * `GMD` - Gambian Dalasi + + * `GEK` - Georgian Kupon Larit + + * `GEL` - Georgian Lari + + * `DEM` - German Mark + + * `GHS` - Ghanaian Cedi + + * `GHC` - Ghanaian Cedi (1979–2007) + + * `GIP` - Gibraltar Pound + + * `XAU` - Gold + + * `GRD` - Greek Drachma + + * `GTQ` - Guatemalan Quetzal + + * `GWP` - Guinea-Bissau Peso + + * `GNF` - Guinean Franc + + * `GNS` - Guinean Syli + + * `GYD` - Guyanaese Dollar + + * `HTG` - Haitian Gourde + + * `HNL` - Honduran Lempira + + * `HKD` - Hong Kong Dollar + + * `HUF` - Hungarian Forint + + * `IMP` - IMP + + * `ISK` - Icelandic Króna + + * `ISJ` - Icelandic Króna (1918–1981) + + * `INR` - Indian Rupee + + * `IDR` - Indonesian Rupiah + + * `IRR` - Iranian Rial + + * `IQD` - Iraqi Dinar + + * `IEP` - Irish Pound + + * `ILS` - Israeli New Shekel + + * `ILP` - Israeli Pound + + * `ILR` - Israeli Shekel (1980–1985) + + * `ITL` - Italian Lira + + * `JMD` - Jamaican Dollar + + * `JPY` - Japanese Yen + + * `JOD` - Jordanian Dinar + + * `KZT` - Kazakhstani Tenge + + * `KES` - Kenyan Shilling + + * `KWD` - Kuwaiti Dinar + + * `KGS` - Kyrgystani Som + + * `LAK` - Laotian Kip + + * `LVL` - Latvian Lats + + * `LVR` - Latvian Ruble + + * `LBP` - Lebanese Pound + + * `LSL` - Lesotho Loti + + * `LRD` - Liberian Dollar + + * `LYD` - Libyan Dinar + + * `LTL` - Lithuanian Litas + + * `LTT` - Lithuanian Talonas + + * `LUL` - Luxembourg Financial Franc + + * `LUC` - Luxembourgian Convertible Franc + + * `LUF` - Luxembourgian Franc + + * `MOP` - Macanese Pataca + + * `MKD` - Macedonian Denar + + * `MKN` - Macedonian Denar (1992–1993) + + * `MGA` - Malagasy Ariary + + * `MGF` - Malagasy Franc + + * `MWK` - Malawian Kwacha + + * `MYR` - Malaysian Ringgit + + * `MVR` - Maldivian Rufiyaa + + * `MVP` - Maldivian Rupee (1947–1981) + + * `MLF` - Malian Franc + + * `MTL` - Maltese Lira + + * `MTP` - Maltese Pound + + * `MRU` - Mauritanian Ouguiya + + * `MRO` - Mauritanian Ouguiya (1973–2017) + + * `MUR` - Mauritian Rupee + + * `MXV` - Mexican Investment Unit + + * `MXN` - Mexican Peso + + * `MXP` - Mexican Silver Peso (1861–1992) + + * `MDC` - Moldovan Cupon + + * `MDL` - Moldovan Leu + + * `MCF` - Monegasque Franc + + * `MNT` - Mongolian Tugrik + + * `MAD` - Moroccan Dirham + + * `MAF` - Moroccan Franc + + * `MZE` - Mozambican Escudo + + * `MZN` - Mozambican Metical + + * `MZM` - Mozambican Metical (1980–2006) + + * `MMK` - Myanmar Kyat + + * `NAD` - Namibian Dollar + + * `NPR` - Nepalese Rupee + + * `ANG` - Netherlands Antillean Guilder + + * `TWD` - New Taiwan Dollar + + * `NZD` - New Zealand Dollar + + * `NIO` - Nicaraguan Córdoba + + * `NIC` - Nicaraguan Córdoba (1988–1991) + + * `NGN` - Nigerian Naira + + * `KPW` - North Korean Won + + * `NOK` - Norwegian Krone + + * `OMR` - Omani Rial + + * `PKR` - Pakistani Rupee + + * `XPD` - Palladium + + * `PAB` - Panamanian Balboa + + * `PGK` - Papua New Guinean Kina + + * `PYG` - Paraguayan Guarani + + * `PEI` - Peruvian Inti + + * `PEN` - Peruvian Sol + + * `PES` - Peruvian Sol (1863–1965) + + * `PHP` - Philippine Peso + + * `XPT` - Platinum + + * `PLN` - Polish Zloty + + * `PLZ` - Polish Zloty (1950–1995) + + * `PTE` - Portuguese Escudo + + * `GWE` - Portuguese Guinea Escudo + + * `QAR` - Qatari Rial + + * `XRE` - RINET Funds + + * `RHD` - Rhodesian Dollar + + * `RON` - Romanian Leu + + * `ROL` - Romanian Leu (1952–2006) + + * `RUB` - Russian Ruble + + * `RUR` - Russian Ruble (1991–1998) + + * `RWF` - Rwandan Franc + + * `SVC` - Salvadoran Colón + + * `WST` - Samoan Tala + + * `SAR` - Saudi Riyal + + * `RSD` - Serbian Dinar + + * `CSD` - Serbian Dinar (2002–2006) + + * `SCR` - Seychellois Rupee + + * `SLL` - Sierra Leonean Leone + + * `XAG` - Silver + + * `SGD` - Singapore Dollar + + * `SKK` - Slovak Koruna + + * `SIT` - Slovenian Tolar + + * `SBD` - Solomon Islands Dollar + + * `SOS` - Somali Shilling + + * `ZAR` - South African Rand + + * `ZAL` - South African Rand (financial) + + * `KRH` - South Korean Hwan (1953–1962) + + * `KRW` - South Korean Won + + * `KRO` - South Korean Won (1945–1953) + + * `SSP` - South Sudanese Pound + + * `SUR` - Soviet Rouble + + * `ESP` - Spanish Peseta + + * `ESA` - Spanish Peseta (A account) + + * `ESB` - Spanish Peseta (convertible account) + + * `XDR` - Special Drawing Rights + + * `LKR` - Sri Lankan Rupee + + * `SHP` - St. Helena Pound + + * `XSU` - Sucre + + * `SDD` - Sudanese Dinar (1992–2007) + + * `SDG` - Sudanese Pound + + * `SDP` - Sudanese Pound (1957–1998) + + * `SRD` - Surinamese Dollar + + * `SRG` - Surinamese Guilder + + * `SZL` - Swazi Lilangeni + + * `SEK` - Swedish Krona + + * `CHF` - Swiss Franc + + * `SYP` - Syrian Pound + + * `STN` - São Tomé & Príncipe Dobra + + * `STD` - São Tomé & Príncipe Dobra (1977–2017) + + * `TVD` - TVD + + * `TJR` - Tajikistani Ruble + + * `TJS` - Tajikistani Somoni + + * `TZS` - Tanzanian Shilling + + * `XTS` - Testing Currency Code + + * `THB` - Thai Baht + + * `XXX` - The codes assigned for transactions where no currency is + involved + + * `TPE` - Timorese Escudo + + * `TOP` - Tongan Paʻanga + + * `TTD` - Trinidad & Tobago Dollar + + * `TND` - Tunisian Dinar + + * `TRY` - Turkish Lira + + * `TRL` - Turkish Lira (1922–2005) + + * `TMT` - Turkmenistani Manat + + * `TMM` - Turkmenistani Manat (1993–2009) + + * `USD` - US Dollar + + * `USN` - US Dollar (Next day) + + * `USS` - US Dollar (Same day) + + * `UGX` - Ugandan Shilling + + * `UGS` - Ugandan Shilling (1966–1987) + + * `UAH` - Ukrainian Hryvnia + + * `UAK` - Ukrainian Karbovanets + + * `AED` - United Arab Emirates Dirham + + * `UYW` - Uruguayan Nominal Wage Index Unit + + * `UYU` - Uruguayan Peso + + * `UYP` - Uruguayan Peso (1975–1993) + + * `UYI` - Uruguayan Peso (Indexed Units) + + * `UZS` - Uzbekistani Som + + * `VUV` - Vanuatu Vatu + + * `VES` - Venezuelan Bolívar + + * `VEB` - Venezuelan Bolívar (1871–2008) + + * `VEF` - Venezuelan Bolívar (2008–2018) + + * `VND` - Vietnamese Dong + + * `VNN` - Vietnamese Dong (1978–1985) + + * `CHE` - WIR Euro + + * `CHW` - WIR Franc + + * `XOF` - West African CFA Franc + + * `YDD` - Yemeni Dinar + + * `YER` - Yemeni Rial + + * `YUN` - Yugoslavian Convertible Dinar (1990–1992) + + * `YUD` - Yugoslavian Hard Dinar (1966–1990) + + * `YUM` - Yugoslavian New Dinar (1994–2002) + + * `YUR` - Yugoslavian Reformed Dinar (1992–1993) + + * `ZWN` - ZWN + + * `ZRN` - Zairean New Zaire (1993–1998) + + * `ZRZ` - Zairean Zaire (1971–1993) + + * `ZMW` - Zambian Kwacha + + * `ZMK` - Zambian Kwacha (1968–2012) + + * `ZWD` - Zimbabwean Dollar (1980–2008) + + * `ZWR` - Zimbabwean Dollar (2008) + + * `ZWL` - Zimbabwean Dollar (2009) + exchange_rate: + type: optional + docs: Exchange rate used if the line item is in a foreign currency. + validation: + pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ + is_billable: + type: optional + docs: Whether the expense line is billable to a client or project. + tracking_categories: + docs: >- + The related tracking categories associated with the expense report + (Department, Location, Class, Expense Category) + type: list + employee: + type: optional + docs: >- + Identifier for the employee who submitted or is associated with the + expense report + project: optional + company: + type: optional + docs: The subsidiary that the expense report is created in + contact: optional + quantity: + type: optional + docs: Quantity for the expense line (e.g., miles driven, items purchased). + unit_price: + type: optional + docs: Price per unit for the expense line (if applicable). + non_reimbursable: + type: optional + docs: >- + Whether the expense line is non-reimbursable (e.g., paid via company + card). + tax_amount: + type: optional + docs: Tax amount applicable for the line item. + inclusive_of_tax: + type: optional + docs: Whether the amount is inclusive of tax. + tax_rate: optional + remote_was_deleted: + type: optional + docs: >- + 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/). + access: read-only + remote_fields: + type: optional> + access: read-only + source: + openapi: openapi/openapi.yml + ExpenseReportLineRequestAccount: + discriminated: false + union: + - type: string + validation: + format: uuid + - Account + source: + openapi: openapi/openapi.yml + inline: true + ExpenseReportLineRequestEmployee: + discriminated: false + docs: >- + Identifier for the employee who submitted or is associated with the + expense report + union: + - type: string + validation: + format: uuid + - Employee + source: + openapi: openapi/openapi.yml + inline: true + ExpenseReportLineRequestProject: + discriminated: false + union: + - type: string + validation: + format: uuid + - Project + source: + openapi: openapi/openapi.yml + inline: true + ExpenseReportLineRequestCompany: + discriminated: false + docs: The subsidiary that the expense report is created in + union: + - type: string + validation: + format: uuid + - CompanyInfo + source: + openapi: openapi/openapi.yml + inline: true + ExpenseReportLineRequestContact: + discriminated: false + union: + - type: string + validation: + format: uuid + - Contact + source: + openapi: openapi/openapi.yml + inline: true + ExpenseReportLineRequestTaxRate: + discriminated: false + union: + - type: string + validation: + format: uuid + - TaxRate + source: + openapi: openapi/openapi.yml + inline: true + ExpenseReportLineRequest: + docs: >- + # The ExpenseReportLine Object + + ### Description + + The `ExpenseReportLine` object represents an individual line item within + an expense report, containing details about + + a specific expense such as amount, description, and associated metadata. + + + ### Usage Example + + Fetch from the `GET ExpenseReport` endpoint and expand the lines field to + view all line items in the expense report. + properties: + remote_id: + type: optional + docs: The third-party API ID of the matching object. + account: optional + description: + type: optional + docs: Description of the individual expense. + validation: + maxLength: 1024 + expense_date: + type: optional + docs: The date the individual expense was incurred. + amount: + type: optional + docs: The amount of the expense for the line item. + currency: + type: optional + docs: >- + Currency of the expense line (if different from the report currency). + + + * `XUA` - ADB Unit of Account + + * `AFN` - Afghan Afghani + + * `AFA` - Afghan Afghani (1927–2002) + + * `ALL` - Albanian Lek + + * `ALK` - Albanian Lek (1946–1965) + + * `DZD` - Algerian Dinar + + * `ADP` - Andorran Peseta + + * `AOA` - Angolan Kwanza + + * `AOK` - Angolan Kwanza (1977–1991) + + * `AON` - Angolan New Kwanza (1990–2000) + + * `AOR` - Angolan Readjusted Kwanza (1995–1999) + + * `ARA` - Argentine Austral + + * `ARS` - Argentine Peso + + * `ARM` - Argentine Peso (1881–1970) + + * `ARP` - Argentine Peso (1983–1985) + + * `ARL` - Argentine Peso Ley (1970–1983) + + * `AMD` - Armenian Dram + + * `AWG` - Aruban Florin + + * `AUD` - Australian Dollar + + * `ATS` - Austrian Schilling + + * `AZN` - Azerbaijani Manat + + * `AZM` - Azerbaijani Manat (1993–2006) + + * `BSD` - Bahamian Dollar + + * `BHD` - Bahraini Dinar + + * `BDT` - Bangladeshi Taka + + * `BBD` - Barbadian Dollar + + * `BYN` - Belarusian Ruble + + * `BYB` - Belarusian Ruble (1994–1999) + + * `BYR` - Belarusian Ruble (2000–2016) + + * `BEF` - Belgian Franc + + * `BEC` - Belgian Franc (convertible) + + * `BEL` - Belgian Franc (financial) + + * `BZD` - Belize Dollar + + * `BMD` - Bermudan Dollar + + * `BTN` - Bhutanese Ngultrum + + * `BOB` - Bolivian Boliviano + + * `BOL` - Bolivian Boliviano (1863–1963) + + * `BOV` - Bolivian Mvdol + + * `BOP` - Bolivian Peso + + * `BAM` - Bosnia-Herzegovina Convertible Mark + + * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) + + * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) + + * `BWP` - Botswanan Pula + + * `BRC` - Brazilian Cruzado (1986–1989) + + * `BRZ` - Brazilian Cruzeiro (1942–1967) + + * `BRE` - Brazilian Cruzeiro (1990–1993) + + * `BRR` - Brazilian Cruzeiro (1993–1994) + + * `BRN` - Brazilian New Cruzado (1989–1990) + + * `BRB` - Brazilian New Cruzeiro (1967–1986) + + * `BRL` - Brazilian Real + + * `GBP` - British Pound + + * `BND` - Brunei Dollar + + * `BGL` - Bulgarian Hard Lev + + * `BGN` - Bulgarian Lev + + * `BGO` - Bulgarian Lev (1879–1952) + + * `BGM` - Bulgarian Socialist Lev + + * `BUK` - Burmese Kyat + + * `BIF` - Burundian Franc + + * `XPF` - CFP Franc + + * `KHR` - Cambodian Riel + + * `CAD` - Canadian Dollar + + * `CVE` - Cape Verdean Escudo + + * `KYD` - Cayman Islands Dollar + + * `XAF` - Central African CFA Franc + + * `CLE` - Chilean Escudo + + * `CLP` - Chilean Peso + + * `CLF` - Chilean Unit of Account (UF) + + * `CNX` - Chinese People’s Bank Dollar + + * `CNY` - Chinese Yuan + + * `CNH` - Chinese Yuan (offshore) + + * `COP` - Colombian Peso + + * `COU` - Colombian Real Value Unit + + * `KMF` - Comorian Franc + + * `CDF` - Congolese Franc + + * `CRC` - Costa Rican Colón + + * `HRD` - Croatian Dinar + + * `HRK` - Croatian Kuna + + * `CUC` - Cuban Convertible Peso + + * `CUP` - Cuban Peso + + * `CYP` - Cypriot Pound + + * `CZK` - Czech Koruna + + * `CSK` - Czechoslovak Hard Koruna + + * `DKK` - Danish Krone + + * `DJF` - Djiboutian Franc + + * `DOP` - Dominican Peso + + * `NLG` - Dutch Guilder + + * `XCD` - East Caribbean Dollar + + * `DDM` - East German Mark + + * `ECS` - Ecuadorian Sucre + + * `ECV` - Ecuadorian Unit of Constant Value + + * `EGP` - Egyptian Pound + + * `GQE` - Equatorial Guinean Ekwele + + * `ERN` - Eritrean Nakfa + + * `EEK` - Estonian Kroon + + * `ETB` - Ethiopian Birr + + * `EUR` - Euro + + * `XBA` - European Composite Unit + + * `XEU` - European Currency Unit + + * `XBB` - European Monetary Unit + + * `XBC` - European Unit of Account (XBC) + + * `XBD` - European Unit of Account (XBD) + + * `FKP` - Falkland Islands Pound + + * `FJD` - Fijian Dollar + + * `FIM` - Finnish Markka + + * `FRF` - French Franc + + * `XFO` - French Gold Franc + + * `XFU` - French UIC-Franc + + * `GMD` - Gambian Dalasi + + * `GEK` - Georgian Kupon Larit + + * `GEL` - Georgian Lari + + * `DEM` - German Mark + + * `GHS` - Ghanaian Cedi + + * `GHC` - Ghanaian Cedi (1979–2007) + + * `GIP` - Gibraltar Pound + + * `XAU` - Gold + + * `GRD` - Greek Drachma + + * `GTQ` - Guatemalan Quetzal + + * `GWP` - Guinea-Bissau Peso + + * `GNF` - Guinean Franc + + * `GNS` - Guinean Syli + + * `GYD` - Guyanaese Dollar + + * `HTG` - Haitian Gourde + + * `HNL` - Honduran Lempira + + * `HKD` - Hong Kong Dollar + + * `HUF` - Hungarian Forint + + * `IMP` - IMP + + * `ISK` - Icelandic Króna + + * `ISJ` - Icelandic Króna (1918–1981) + + * `INR` - Indian Rupee + + * `IDR` - Indonesian Rupiah + + * `IRR` - Iranian Rial + + * `IQD` - Iraqi Dinar + + * `IEP` - Irish Pound + + * `ILS` - Israeli New Shekel + + * `ILP` - Israeli Pound + + * `ILR` - Israeli Shekel (1980–1985) + + * `ITL` - Italian Lira + + * `JMD` - Jamaican Dollar + + * `JPY` - Japanese Yen + + * `JOD` - Jordanian Dinar + + * `KZT` - Kazakhstani Tenge + + * `KES` - Kenyan Shilling + + * `KWD` - Kuwaiti Dinar + + * `KGS` - Kyrgystani Som + + * `LAK` - Laotian Kip + + * `LVL` - Latvian Lats + + * `LVR` - Latvian Ruble + + * `LBP` - Lebanese Pound + + * `LSL` - Lesotho Loti + + * `LRD` - Liberian Dollar + + * `LYD` - Libyan Dinar + + * `LTL` - Lithuanian Litas + + * `LTT` - Lithuanian Talonas + + * `LUL` - Luxembourg Financial Franc + + * `LUC` - Luxembourgian Convertible Franc + + * `LUF` - Luxembourgian Franc + + * `MOP` - Macanese Pataca + + * `MKD` - Macedonian Denar + + * `MKN` - Macedonian Denar (1992–1993) + + * `MGA` - Malagasy Ariary + + * `MGF` - Malagasy Franc + + * `MWK` - Malawian Kwacha + + * `MYR` - Malaysian Ringgit + + * `MVR` - Maldivian Rufiyaa + + * `MVP` - Maldivian Rupee (1947–1981) + + * `MLF` - Malian Franc + + * `MTL` - Maltese Lira + + * `MTP` - Maltese Pound + + * `MRU` - Mauritanian Ouguiya + + * `MRO` - Mauritanian Ouguiya (1973–2017) + + * `MUR` - Mauritian Rupee + + * `MXV` - Mexican Investment Unit + + * `MXN` - Mexican Peso + + * `MXP` - Mexican Silver Peso (1861–1992) + + * `MDC` - Moldovan Cupon + + * `MDL` - Moldovan Leu + + * `MCF` - Monegasque Franc + + * `MNT` - Mongolian Tugrik + + * `MAD` - Moroccan Dirham + + * `MAF` - Moroccan Franc + + * `MZE` - Mozambican Escudo + + * `MZN` - Mozambican Metical + + * `MZM` - Mozambican Metical (1980–2006) + + * `MMK` - Myanmar Kyat + + * `NAD` - Namibian Dollar + + * `NPR` - Nepalese Rupee + + * `ANG` - Netherlands Antillean Guilder + + * `TWD` - New Taiwan Dollar + + * `NZD` - New Zealand Dollar + + * `NIO` - Nicaraguan Córdoba + + * `NIC` - Nicaraguan Córdoba (1988–1991) + + * `NGN` - Nigerian Naira + + * `KPW` - North Korean Won + + * `NOK` - Norwegian Krone + + * `OMR` - Omani Rial + + * `PKR` - Pakistani Rupee + + * `XPD` - Palladium + + * `PAB` - Panamanian Balboa + + * `PGK` - Papua New Guinean Kina + + * `PYG` - Paraguayan Guarani + + * `PEI` - Peruvian Inti + + * `PEN` - Peruvian Sol + + * `PES` - Peruvian Sol (1863–1965) + + * `PHP` - Philippine Peso + + * `XPT` - Platinum + + * `PLN` - Polish Zloty + + * `PLZ` - Polish Zloty (1950–1995) + + * `PTE` - Portuguese Escudo + + * `GWE` - Portuguese Guinea Escudo + + * `QAR` - Qatari Rial + + * `XRE` - RINET Funds + + * `RHD` - Rhodesian Dollar + + * `RON` - Romanian Leu + + * `ROL` - Romanian Leu (1952–2006) + + * `RUB` - Russian Ruble + + * `RUR` - Russian Ruble (1991–1998) + + * `RWF` - Rwandan Franc + + * `SVC` - Salvadoran Colón + + * `WST` - Samoan Tala + + * `SAR` - Saudi Riyal + + * `RSD` - Serbian Dinar + + * `CSD` - Serbian Dinar (2002–2006) + + * `SCR` - Seychellois Rupee + + * `SLL` - Sierra Leonean Leone + + * `XAG` - Silver + + * `SGD` - Singapore Dollar + + * `SKK` - Slovak Koruna + + * `SIT` - Slovenian Tolar + + * `SBD` - Solomon Islands Dollar + + * `SOS` - Somali Shilling + + * `ZAR` - South African Rand + + * `ZAL` - South African Rand (financial) + + * `KRH` - South Korean Hwan (1953–1962) + + * `KRW` - South Korean Won + + * `KRO` - South Korean Won (1945–1953) + + * `SSP` - South Sudanese Pound + + * `SUR` - Soviet Rouble + + * `ESP` - Spanish Peseta + + * `ESA` - Spanish Peseta (A account) + + * `ESB` - Spanish Peseta (convertible account) + + * `XDR` - Special Drawing Rights + + * `LKR` - Sri Lankan Rupee + + * `SHP` - St. Helena Pound + + * `XSU` - Sucre + + * `SDD` - Sudanese Dinar (1992–2007) + + * `SDG` - Sudanese Pound + + * `SDP` - Sudanese Pound (1957–1998) + + * `SRD` - Surinamese Dollar + + * `SRG` - Surinamese Guilder + + * `SZL` - Swazi Lilangeni + + * `SEK` - Swedish Krona + + * `CHF` - Swiss Franc + + * `SYP` - Syrian Pound + + * `STN` - São Tomé & Príncipe Dobra + + * `STD` - São Tomé & Príncipe Dobra (1977–2017) + + * `TVD` - TVD + + * `TJR` - Tajikistani Ruble + + * `TJS` - Tajikistani Somoni + + * `TZS` - Tanzanian Shilling + + * `XTS` - Testing Currency Code + + * `THB` - Thai Baht + + * `XXX` - The codes assigned for transactions where no currency is + involved + + * `TPE` - Timorese Escudo + + * `TOP` - Tongan Paʻanga + + * `TTD` - Trinidad & Tobago Dollar + + * `TND` - Tunisian Dinar + + * `TRY` - Turkish Lira + + * `TRL` - Turkish Lira (1922–2005) + + * `TMT` - Turkmenistani Manat + + * `TMM` - Turkmenistani Manat (1993–2009) + + * `USD` - US Dollar + + * `USN` - US Dollar (Next day) + + * `USS` - US Dollar (Same day) + + * `UGX` - Ugandan Shilling + + * `UGS` - Ugandan Shilling (1966–1987) + + * `UAH` - Ukrainian Hryvnia + + * `UAK` - Ukrainian Karbovanets + + * `AED` - United Arab Emirates Dirham + + * `UYW` - Uruguayan Nominal Wage Index Unit + + * `UYU` - Uruguayan Peso + + * `UYP` - Uruguayan Peso (1975–1993) + + * `UYI` - Uruguayan Peso (Indexed Units) + + * `UZS` - Uzbekistani Som + + * `VUV` - Vanuatu Vatu + + * `VES` - Venezuelan Bolívar + + * `VEB` - Venezuelan Bolívar (1871–2008) + + * `VEF` - Venezuelan Bolívar (2008–2018) + + * `VND` - Vietnamese Dong + + * `VNN` - Vietnamese Dong (1978–1985) + + * `CHE` - WIR Euro + + * `CHW` - WIR Franc + + * `XOF` - West African CFA Franc + + * `YDD` - Yemeni Dinar + + * `YER` - Yemeni Rial + + * `YUN` - Yugoslavian Convertible Dinar (1990–1992) + + * `YUD` - Yugoslavian Hard Dinar (1966–1990) + + * `YUM` - Yugoslavian New Dinar (1994–2002) + + * `YUR` - Yugoslavian Reformed Dinar (1992–1993) + + * `ZWN` - ZWN + + * `ZRN` - Zairean New Zaire (1993–1998) + + * `ZRZ` - Zairean Zaire (1971–1993) + + * `ZMW` - Zambian Kwacha + + * `ZMK` - Zambian Kwacha (1968–2012) + + * `ZWD` - Zimbabwean Dollar (1980–2008) + + * `ZWR` - Zimbabwean Dollar (2008) + + * `ZWL` - Zimbabwean Dollar (2009) + exchange_rate: + type: optional + docs: Exchange rate used if the line item is in a foreign currency. + validation: + pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ + is_billable: + type: optional + docs: Whether the expense line is billable to a client or project. + tracking_categories: + docs: >- + The related tracking categories associated with the expense report + (Department, Location, Class, Expense Category) + type: list + employee: + type: optional + docs: >- + Identifier for the employee who submitted or is associated with the + expense report + project: optional + company: + type: optional + docs: The subsidiary that the expense report is created in + contact: optional + quantity: + type: optional + docs: Quantity for the expense line (e.g., miles driven, items purchased). + unit_price: + type: optional + docs: Price per unit for the expense line (if applicable). + non_reimbursable: + type: optional + docs: >- + Whether the expense line is non-reimbursable (e.g., paid via company + card). + tax_amount: + type: optional + docs: Tax amount applicable for the line item. + inclusive_of_tax: + type: optional + docs: Whether the amount is inclusive of tax. + tax_rate: optional + integration_params: + type: optional> + access: write-only + linked_account_params: + type: optional> + access: write-only + remote_fields: + type: optional> + access: write-only + source: + openapi: openapi/openapi.yml + ExpenseReportRequestEmployee: + discriminated: false + docs: >- + Identifier for the employee who submitted or is associated with the + expense report + union: + - type: string + validation: + format: uuid + - Employee + source: + openapi: openapi/openapi.yml + inline: true + ExpenseReportRequestAccountingPeriod: + discriminated: false + docs: The accounting period the report was posted in + union: + - type: string + validation: + format: uuid + - AccountingPeriod + source: + openapi: openapi/openapi.yml + inline: true + ExpenseReportRequestCompany: + discriminated: false + docs: The subsidiary that the expense report is created in + union: + - type: string + validation: + format: uuid + - CompanyInfo + source: + openapi: openapi/openapi.yml + inline: true + ExpenseReportRequest: + docs: >- + # The ExpenseReport Object + + ### Description + + The `ExpenseReport` object represents a collection of expenses submitted + for review and reimbursement. + + It includes details about the submitter, status, amounts, and associated + metadata. + + + ### Usage Example + + Fetch from the `GET ExpenseReport` endpoint to view details of expense + reports and their line items. + properties: + report_date: + type: optional + docs: The date of the expense report. + report_identifier: + type: optional + docs: Human-readable expense report identifier. + validation: + maxLength: 1024 + employee: + type: optional + docs: >- + Identifier for the employee who submitted or is associated with the + expense report + status: + type: optional + docs: >- + Overall status of the expense report. One of DRAFT, SUBMITTED, + APPROVED, REJECTED + + + * `DRAFT` - DRAFT + + * `SUBMITTED` - SUBMITTED + + * `APPROVED` - APPROVED + + * `REJECTED` - REJECTED + total_amount: + type: optional + docs: Total amount of the expense report + currency: + type: optional + docs: >- + Currency code for the expense report + + + * `XUA` - ADB Unit of Account + + * `AFN` - Afghan Afghani + + * `AFA` - Afghan Afghani (1927–2002) + + * `ALL` - Albanian Lek + + * `ALK` - Albanian Lek (1946–1965) + + * `DZD` - Algerian Dinar + + * `ADP` - Andorran Peseta + + * `AOA` - Angolan Kwanza + + * `AOK` - Angolan Kwanza (1977–1991) + + * `AON` - Angolan New Kwanza (1990–2000) + + * `AOR` - Angolan Readjusted Kwanza (1995–1999) + + * `ARA` - Argentine Austral + + * `ARS` - Argentine Peso + + * `ARM` - Argentine Peso (1881–1970) + + * `ARP` - Argentine Peso (1983–1985) + + * `ARL` - Argentine Peso Ley (1970–1983) + + * `AMD` - Armenian Dram + + * `AWG` - Aruban Florin + + * `AUD` - Australian Dollar + + * `ATS` - Austrian Schilling + + * `AZN` - Azerbaijani Manat + + * `AZM` - Azerbaijani Manat (1993–2006) + + * `BSD` - Bahamian Dollar + + * `BHD` - Bahraini Dinar + + * `BDT` - Bangladeshi Taka + + * `BBD` - Barbadian Dollar + + * `BYN` - Belarusian Ruble + + * `BYB` - Belarusian Ruble (1994–1999) + + * `BYR` - Belarusian Ruble (2000–2016) + + * `BEF` - Belgian Franc + + * `BEC` - Belgian Franc (convertible) + + * `BEL` - Belgian Franc (financial) + + * `BZD` - Belize Dollar + + * `BMD` - Bermudan Dollar + + * `BTN` - Bhutanese Ngultrum + + * `BOB` - Bolivian Boliviano + + * `BOL` - Bolivian Boliviano (1863–1963) + + * `BOV` - Bolivian Mvdol + + * `BOP` - Bolivian Peso + + * `BAM` - Bosnia-Herzegovina Convertible Mark + + * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) + + * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) + + * `BWP` - Botswanan Pula + + * `BRC` - Brazilian Cruzado (1986–1989) + + * `BRZ` - Brazilian Cruzeiro (1942–1967) + + * `BRE` - Brazilian Cruzeiro (1990–1993) + + * `BRR` - Brazilian Cruzeiro (1993–1994) + + * `BRN` - Brazilian New Cruzado (1989–1990) + + * `BRB` - Brazilian New Cruzeiro (1967–1986) + + * `BRL` - Brazilian Real + + * `GBP` - British Pound + + * `BND` - Brunei Dollar + + * `BGL` - Bulgarian Hard Lev + + * `BGN` - Bulgarian Lev + + * `BGO` - Bulgarian Lev (1879–1952) + + * `BGM` - Bulgarian Socialist Lev + + * `BUK` - Burmese Kyat + + * `BIF` - Burundian Franc + + * `XPF` - CFP Franc + + * `KHR` - Cambodian Riel + + * `CAD` - Canadian Dollar + + * `CVE` - Cape Verdean Escudo + + * `KYD` - Cayman Islands Dollar + + * `XAF` - Central African CFA Franc + + * `CLE` - Chilean Escudo + + * `CLP` - Chilean Peso + + * `CLF` - Chilean Unit of Account (UF) + + * `CNX` - Chinese People’s Bank Dollar + + * `CNY` - Chinese Yuan + + * `CNH` - Chinese Yuan (offshore) + + * `COP` - Colombian Peso + + * `COU` - Colombian Real Value Unit + + * `KMF` - Comorian Franc + + * `CDF` - Congolese Franc + + * `CRC` - Costa Rican Colón + + * `HRD` - Croatian Dinar + + * `HRK` - Croatian Kuna + + * `CUC` - Cuban Convertible Peso + + * `CUP` - Cuban Peso + + * `CYP` - Cypriot Pound + + * `CZK` - Czech Koruna + + * `CSK` - Czechoslovak Hard Koruna + + * `DKK` - Danish Krone + + * `DJF` - Djiboutian Franc + + * `DOP` - Dominican Peso + + * `NLG` - Dutch Guilder + + * `XCD` - East Caribbean Dollar + + * `DDM` - East German Mark + + * `ECS` - Ecuadorian Sucre + + * `ECV` - Ecuadorian Unit of Constant Value + + * `EGP` - Egyptian Pound + + * `GQE` - Equatorial Guinean Ekwele + + * `ERN` - Eritrean Nakfa + + * `EEK` - Estonian Kroon + + * `ETB` - Ethiopian Birr + + * `EUR` - Euro + + * `XBA` - European Composite Unit + + * `XEU` - European Currency Unit + + * `XBB` - European Monetary Unit + + * `XBC` - European Unit of Account (XBC) + + * `XBD` - European Unit of Account (XBD) + + * `FKP` - Falkland Islands Pound + + * `FJD` - Fijian Dollar + + * `FIM` - Finnish Markka + + * `FRF` - French Franc + + * `XFO` - French Gold Franc + + * `XFU` - French UIC-Franc + + * `GMD` - Gambian Dalasi + + * `GEK` - Georgian Kupon Larit + + * `GEL` - Georgian Lari + + * `DEM` - German Mark + + * `GHS` - Ghanaian Cedi + + * `GHC` - Ghanaian Cedi (1979–2007) + + * `GIP` - Gibraltar Pound + + * `XAU` - Gold + + * `GRD` - Greek Drachma + + * `GTQ` - Guatemalan Quetzal + + * `GWP` - Guinea-Bissau Peso + + * `GNF` - Guinean Franc + + * `GNS` - Guinean Syli + + * `GYD` - Guyanaese Dollar + + * `HTG` - Haitian Gourde + + * `HNL` - Honduran Lempira + + * `HKD` - Hong Kong Dollar + + * `HUF` - Hungarian Forint + + * `IMP` - IMP + + * `ISK` - Icelandic Króna + + * `ISJ` - Icelandic Króna (1918–1981) + + * `INR` - Indian Rupee + + * `IDR` - Indonesian Rupiah + + * `IRR` - Iranian Rial + + * `IQD` - Iraqi Dinar + + * `IEP` - Irish Pound + + * `ILS` - Israeli New Shekel + + * `ILP` - Israeli Pound + + * `ILR` - Israeli Shekel (1980–1985) + + * `ITL` - Italian Lira + + * `JMD` - Jamaican Dollar + + * `JPY` - Japanese Yen + + * `JOD` - Jordanian Dinar + + * `KZT` - Kazakhstani Tenge + + * `KES` - Kenyan Shilling + + * `KWD` - Kuwaiti Dinar + + * `KGS` - Kyrgystani Som + + * `LAK` - Laotian Kip + + * `LVL` - Latvian Lats + + * `LVR` - Latvian Ruble + + * `LBP` - Lebanese Pound + + * `LSL` - Lesotho Loti + + * `LRD` - Liberian Dollar + + * `LYD` - Libyan Dinar + + * `LTL` - Lithuanian Litas + + * `LTT` - Lithuanian Talonas + + * `LUL` - Luxembourg Financial Franc + + * `LUC` - Luxembourgian Convertible Franc + + * `LUF` - Luxembourgian Franc + + * `MOP` - Macanese Pataca + + * `MKD` - Macedonian Denar + + * `MKN` - Macedonian Denar (1992–1993) + + * `MGA` - Malagasy Ariary + + * `MGF` - Malagasy Franc + + * `MWK` - Malawian Kwacha + + * `MYR` - Malaysian Ringgit + + * `MVR` - Maldivian Rufiyaa + + * `MVP` - Maldivian Rupee (1947–1981) + + * `MLF` - Malian Franc + + * `MTL` - Maltese Lira + + * `MTP` - Maltese Pound + + * `MRU` - Mauritanian Ouguiya + + * `MRO` - Mauritanian Ouguiya (1973–2017) + + * `MUR` - Mauritian Rupee + + * `MXV` - Mexican Investment Unit + + * `MXN` - Mexican Peso + + * `MXP` - Mexican Silver Peso (1861–1992) + + * `MDC` - Moldovan Cupon + + * `MDL` - Moldovan Leu + + * `MCF` - Monegasque Franc + + * `MNT` - Mongolian Tugrik + + * `MAD` - Moroccan Dirham + + * `MAF` - Moroccan Franc + + * `MZE` - Mozambican Escudo + + * `MZN` - Mozambican Metical + + * `MZM` - Mozambican Metical (1980–2006) + + * `MMK` - Myanmar Kyat + + * `NAD` - Namibian Dollar + + * `NPR` - Nepalese Rupee + + * `ANG` - Netherlands Antillean Guilder + + * `TWD` - New Taiwan Dollar + + * `NZD` - New Zealand Dollar + + * `NIO` - Nicaraguan Córdoba + + * `NIC` - Nicaraguan Córdoba (1988–1991) + + * `NGN` - Nigerian Naira + + * `KPW` - North Korean Won + + * `NOK` - Norwegian Krone + + * `OMR` - Omani Rial + + * `PKR` - Pakistani Rupee + + * `XPD` - Palladium + + * `PAB` - Panamanian Balboa + + * `PGK` - Papua New Guinean Kina + + * `PYG` - Paraguayan Guarani + + * `PEI` - Peruvian Inti + + * `PEN` - Peruvian Sol + + * `PES` - Peruvian Sol (1863–1965) + + * `PHP` - Philippine Peso + + * `XPT` - Platinum + + * `PLN` - Polish Zloty + + * `PLZ` - Polish Zloty (1950–1995) + + * `PTE` - Portuguese Escudo + + * `GWE` - Portuguese Guinea Escudo + + * `QAR` - Qatari Rial + + * `XRE` - RINET Funds + + * `RHD` - Rhodesian Dollar + + * `RON` - Romanian Leu + + * `ROL` - Romanian Leu (1952–2006) + + * `RUB` - Russian Ruble + + * `RUR` - Russian Ruble (1991–1998) + + * `RWF` - Rwandan Franc + + * `SVC` - Salvadoran Colón + + * `WST` - Samoan Tala + + * `SAR` - Saudi Riyal + + * `RSD` - Serbian Dinar + + * `CSD` - Serbian Dinar (2002–2006) + + * `SCR` - Seychellois Rupee + + * `SLL` - Sierra Leonean Leone + + * `XAG` - Silver + + * `SGD` - Singapore Dollar + + * `SKK` - Slovak Koruna + + * `SIT` - Slovenian Tolar + + * `SBD` - Solomon Islands Dollar + + * `SOS` - Somali Shilling + + * `ZAR` - South African Rand + + * `ZAL` - South African Rand (financial) + + * `KRH` - South Korean Hwan (1953–1962) + + * `KRW` - South Korean Won + + * `KRO` - South Korean Won (1945–1953) + + * `SSP` - South Sudanese Pound + + * `SUR` - Soviet Rouble + + * `ESP` - Spanish Peseta + + * `ESA` - Spanish Peseta (A account) + + * `ESB` - Spanish Peseta (convertible account) + + * `XDR` - Special Drawing Rights + + * `LKR` - Sri Lankan Rupee + + * `SHP` - St. Helena Pound + + * `XSU` - Sucre + + * `SDD` - Sudanese Dinar (1992–2007) + + * `SDG` - Sudanese Pound + + * `SDP` - Sudanese Pound (1957–1998) + + * `SRD` - Surinamese Dollar + + * `SRG` - Surinamese Guilder + + * `SZL` - Swazi Lilangeni + + * `SEK` - Swedish Krona + + * `CHF` - Swiss Franc + + * `SYP` - Syrian Pound + + * `STN` - São Tomé & Príncipe Dobra + + * `STD` - São Tomé & Príncipe Dobra (1977–2017) + + * `TVD` - TVD + + * `TJR` - Tajikistani Ruble + + * `TJS` - Tajikistani Somoni + + * `TZS` - Tanzanian Shilling + + * `XTS` - Testing Currency Code + + * `THB` - Thai Baht + + * `XXX` - The codes assigned for transactions where no currency is + involved + + * `TPE` - Timorese Escudo + + * `TOP` - Tongan Paʻanga + + * `TTD` - Trinidad & Tobago Dollar + + * `TND` - Tunisian Dinar + + * `TRY` - Turkish Lira + + * `TRL` - Turkish Lira (1922–2005) + + * `TMT` - Turkmenistani Manat + + * `TMM` - Turkmenistani Manat (1993–2009) + + * `USD` - US Dollar + + * `USN` - US Dollar (Next day) + + * `USS` - US Dollar (Same day) + + * `UGX` - Ugandan Shilling + + * `UGS` - Ugandan Shilling (1966–1987) + + * `UAH` - Ukrainian Hryvnia + + * `UAK` - Ukrainian Karbovanets + + * `AED` - United Arab Emirates Dirham + + * `UYW` - Uruguayan Nominal Wage Index Unit + + * `UYU` - Uruguayan Peso + + * `UYP` - Uruguayan Peso (1975–1993) + + * `UYI` - Uruguayan Peso (Indexed Units) + + * `UZS` - Uzbekistani Som + + * `VUV` - Vanuatu Vatu + + * `VES` - Venezuelan Bolívar + + * `VEB` - Venezuelan Bolívar (1871–2008) + + * `VEF` - Venezuelan Bolívar (2008–2018) + + * `VND` - Vietnamese Dong + + * `VNN` - Vietnamese Dong (1978–1985) + + * `CHE` - WIR Euro + + * `CHW` - WIR Franc + + * `XOF` - West African CFA Franc + + * `YDD` - Yemeni Dinar + + * `YER` - Yemeni Rial + + * `YUN` - Yugoslavian Convertible Dinar (1990–1992) + + * `YUD` - Yugoslavian Hard Dinar (1966–1990) + + * `YUM` - Yugoslavian New Dinar (1994–2002) + + * `YUR` - Yugoslavian Reformed Dinar (1992–1993) + + * `ZWN` - ZWN + + * `ZRN` - Zairean New Zaire (1993–1998) + + * `ZRZ` - Zairean Zaire (1971–1993) + + * `ZMW` - Zambian Kwacha + + * `ZMK` - Zambian Kwacha (1968–2012) + + * `ZWD` - Zimbabwean Dollar (1980–2008) + + * `ZWR` - Zimbabwean Dollar (2008) + + * `ZWL` - Zimbabwean Dollar (2009) + description: + type: optional + docs: A brief description or purpose for the expense report + validation: + maxLength: 1024 + accounting_period: + type: optional + docs: The accounting period the report was posted in + company: + type: optional + docs: The subsidiary that the expense report is created in + tracking_categories: + docs: The related tracking categories associated with the expense report + type: list + integration_params: + type: optional> + access: write-only + linked_account_params: + type: optional> + access: write-only + remote_fields: + type: optional> + access: write-only + source: + openapi: openapi/openapi.yml + ExpenseReportResponse: + properties: + model: ExpenseReport + warnings: list + errors: list + logs: optional> + source: + openapi: openapi/openapi.yml + ExpenseReportStatusEnum: + enum: + - DRAFT + - SUBMITTED + - APPROVED + - REJECTED + docs: |- + * `DRAFT` - DRAFT + * `SUBMITTED` - SUBMITTED + * `APPROVED` - APPROVED + * `REJECTED` - REJECTED + source: + openapi: openapi/openapi.yml ExpenseRequestAccount: discriminated: false docs: The expense's payment account. @@ -21838,6 +24887,7 @@ types: CreditNote: optional> Item: optional> PurchaseOrder: optional> + ExpenseReport: optional> TrackingCategory: optional> JournalEntry: optional> TaxRate: optional> @@ -21935,6 +24985,7 @@ types: CreditNote: optional> Item: optional> PurchaseOrder: optional> + ExpenseReport: optional> TrackingCategory: optional> JournalEntry: optional> TaxRate: optional> @@ -32019,6 +35070,21 @@ types: source: openapi: openapi/openapi.yml inline: true + ItemType: + discriminated: false + docs: |- + The item's type. + + * `INVENTORY` - INVENTORY + * `NON_INVENTORY` - NON_INVENTORY + * `SERVICE` - SERVICE + * `UNKNOWN` - UNKNOWN + union: + - Type2BbEnum + - string + source: + openapi: openapi/openapi.yml + inline: true ItemPurchaseAccount: discriminated: false docs: References the default account used to record a purchase of the item. @@ -32109,6 +35175,15 @@ types: * `ACTIVE` - ACTIVE * `ARCHIVED` - ARCHIVED + type: + type: optional + docs: |- + The item's type. + + * `INVENTORY` - INVENTORY + * `NON_INVENTORY` - NON_INVENTORY + * `SERVICE` - SERVICE + * `UNKNOWN` - UNKNOWN unit_price: type: optional docs: The item's unit price. @@ -38096,6 +41171,20 @@ types: results: optional> source: openapi: openapi/openapi.yml + PaginatedExpenseReportLineList: + properties: + next: optional + previous: optional + results: optional> + source: + openapi: openapi/openapi.yml + PaginatedExpenseReportList: + properties: + next: optional + previous: optional + results: optional> + source: + openapi: openapi/openapi.yml PaginatedGeneralLedgerTransactionList: properties: next: optional diff --git a/.mock/definition/accounting/employees.yml b/.mock/definition/accounting/employees.yml index 3ccf25f6..bc9f9fdb 100644 --- a/.mock/definition/accounting/employees.yml +++ b/.mock/definition/accounting/employees.yml @@ -14,6 +14,17 @@ service: request: name: EmployeesListRequest query-parameters: + company_id: + type: optional + docs: If provided, will only return employees for this company. + created_after: + type: optional + docs: If provided, will only return objects created after this datetime. + created_before: + type: optional + docs: >- + If provided, will only return objects created before this + datetime. cursor: type: optional docs: The pagination cursor value. @@ -40,9 +51,22 @@ service: docs: >- Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + modified_after: + type: optional + docs: >- + If provided, only objects synced by Merge after this date time + will be returned. + modified_before: + type: optional + docs: >- + If provided, only objects synced by Merge before this date time + will be returned. page_size: type: optional docs: Number of results to return per page. + remote_id: + type: optional + docs: The API provider's ID for the given object. response: docs: '' type: root.PaginatedEmployeeList diff --git a/.mock/definition/accounting/expenseReports.yml b/.mock/definition/accounting/expenseReports.yml new file mode 100644 index 00000000..d8794980 --- /dev/null +++ b/.mock/definition/accounting/expenseReports.yml @@ -0,0 +1,938 @@ +types: + ExpenseReportsListRequestExpand: + enum: + - accounting_period + - value: accounting_period,company + name: AccountingPeriodCompany + - company + - employee + - value: employee,accounting_period + name: EmployeeAccountingPeriod + - value: employee,accounting_period,company + name: EmployeeAccountingPeriodCompany + - value: employee,company + name: EmployeeCompany + - lines + - value: lines,accounting_period + name: LinesAccountingPeriod + - value: lines,accounting_period,company + name: LinesAccountingPeriodCompany + - value: lines,company + name: LinesCompany + - value: lines,employee + name: LinesEmployee + - value: lines,employee,accounting_period + name: LinesEmployeeAccountingPeriod + - value: lines,employee,accounting_period,company + name: LinesEmployeeAccountingPeriodCompany + - value: lines,employee,company + name: LinesEmployeeCompany + source: + openapi: openapi/openapi.yml + ExpenseReportsLinesListRequestExpand: + enum: + - account + - value: account,company + name: AccountCompany + - value: account,company,contact + name: AccountCompanyContact + - value: account,company,contact,tax_rate + name: AccountCompanyContactTaxRate + - value: account,company,tax_rate + name: AccountCompanyTaxRate + - value: account,contact + name: AccountContact + - value: account,contact,tax_rate + name: AccountContactTaxRate + - value: account,employee + name: AccountEmployee + - value: account,employee,company + name: AccountEmployeeCompany + - value: account,employee,company,contact + name: AccountEmployeeCompanyContact + - value: account,employee,company,contact,tax_rate + name: AccountEmployeeCompanyContactTaxRate + - value: account,employee,company,tax_rate + name: AccountEmployeeCompanyTaxRate + - value: account,employee,contact + name: AccountEmployeeContact + - value: account,employee,contact,tax_rate + name: AccountEmployeeContactTaxRate + - value: account,employee,project + name: AccountEmployeeProject + - value: account,employee,project,company + name: AccountEmployeeProjectCompany + - value: account,employee,project,company,contact + name: AccountEmployeeProjectCompanyContact + - value: account,employee,project,company,contact,tax_rate + name: AccountEmployeeProjectCompanyContactTaxRate + - value: account,employee,project,company,tax_rate + name: AccountEmployeeProjectCompanyTaxRate + - value: account,employee,project,contact + name: AccountEmployeeProjectContact + - value: account,employee,project,contact,tax_rate + name: AccountEmployeeProjectContactTaxRate + - value: account,employee,project,tax_rate + name: AccountEmployeeProjectTaxRate + - value: account,employee,tax_rate + name: AccountEmployeeTaxRate + - value: account,project + name: AccountProject + - value: account,project,company + name: AccountProjectCompany + - value: account,project,company,contact + name: AccountProjectCompanyContact + - value: account,project,company,contact,tax_rate + name: AccountProjectCompanyContactTaxRate + - value: account,project,company,tax_rate + name: AccountProjectCompanyTaxRate + - value: account,project,contact + name: AccountProjectContact + - value: account,project,contact,tax_rate + name: AccountProjectContactTaxRate + - value: account,project,tax_rate + name: AccountProjectTaxRate + - value: account,tax_rate + name: AccountTaxRate + - company + - value: company,contact + name: CompanyContact + - value: company,contact,tax_rate + name: CompanyContactTaxRate + - value: company,tax_rate + name: CompanyTaxRate + - contact + - value: contact,tax_rate + name: ContactTaxRate + - employee + - value: employee,company + name: EmployeeCompany + - value: employee,company,contact + name: EmployeeCompanyContact + - value: employee,company,contact,tax_rate + name: EmployeeCompanyContactTaxRate + - value: employee,company,tax_rate + name: EmployeeCompanyTaxRate + - value: employee,contact + name: EmployeeContact + - value: employee,contact,tax_rate + name: EmployeeContactTaxRate + - value: employee,project + name: EmployeeProject + - value: employee,project,company + name: EmployeeProjectCompany + - value: employee,project,company,contact + name: EmployeeProjectCompanyContact + - value: employee,project,company,contact,tax_rate + name: EmployeeProjectCompanyContactTaxRate + - value: employee,project,company,tax_rate + name: EmployeeProjectCompanyTaxRate + - value: employee,project,contact + name: EmployeeProjectContact + - value: employee,project,contact,tax_rate + name: EmployeeProjectContactTaxRate + - value: employee,project,tax_rate + name: EmployeeProjectTaxRate + - value: employee,tax_rate + name: EmployeeTaxRate + - project + - value: project,company + name: ProjectCompany + - value: project,company,contact + name: ProjectCompanyContact + - value: project,company,contact,tax_rate + name: ProjectCompanyContactTaxRate + - value: project,company,tax_rate + name: ProjectCompanyTaxRate + - value: project,contact + name: ProjectContact + - value: project,contact,tax_rate + name: ProjectContactTaxRate + - value: project,tax_rate + name: ProjectTaxRate + - tax_rate + source: + openapi: openapi/openapi.yml + ExpenseReportsRetrieveRequestExpand: + enum: + - accounting_period + - value: accounting_period,company + name: AccountingPeriodCompany + - company + - employee + - value: employee,accounting_period + name: EmployeeAccountingPeriod + - value: employee,accounting_period,company + name: EmployeeAccountingPeriodCompany + - value: employee,company + name: EmployeeCompany + - lines + - value: lines,accounting_period + name: LinesAccountingPeriod + - value: lines,accounting_period,company + name: LinesAccountingPeriodCompany + - value: lines,company + name: LinesCompany + - value: lines,employee + name: LinesEmployee + - value: lines,employee,accounting_period + name: LinesEmployeeAccountingPeriod + - value: lines,employee,accounting_period,company + name: LinesEmployeeAccountingPeriodCompany + - value: lines,employee,company + name: LinesEmployeeCompany + source: + openapi: openapi/openapi.yml +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /accounting/v1/expense-reports + method: GET + auth: true + docs: Returns a list of `ExpenseReport` objects. + source: + openapi: openapi/openapi.yml + request: + name: ExpenseReportsListRequest + query-parameters: + company_id: + type: optional + docs: If provided, will only return expense reports for this company. + created_after: + type: optional + docs: If provided, will only return objects created after this datetime. + created_before: + type: optional + docs: >- + If provided, will only return objects created before this + datetime. + cursor: + type: optional + docs: The pagination cursor value. + expand: + type: optional + docs: >- + Which relations should be returned in expanded form. Multiple + relation names should be comma separated without spaces. + include_deleted_data: + type: optional + docs: >- + 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/). + include_remote_data: + type: optional + docs: >- + Whether to include the original data Merge fetched from the + third-party to produce these models. + include_remote_fields: + type: optional + docs: >- + Whether to include all remote fields, including fields that Merge + did not map to common models, in a normalized format. + include_shell_data: + type: optional + docs: >- + Whether to include shell records. Shell records are empty records + (they may contain some metadata but all other fields are null). + modified_after: + type: optional + docs: >- + If provided, only objects synced by Merge after this date time + will be returned. + modified_before: + type: optional + docs: >- + If provided, only objects synced by Merge before this date time + will be returned. + page_size: + type: optional + docs: Number of results to return per page. + remote_id: + type: optional + docs: The API provider's ID for the given object. + response: + docs: '' + type: root.PaginatedExpenseReportList + status-code: 200 + examples: + - headers: {} + response: + body: + next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ + results: + - id: 123e4567-e89b-12d3-a456-426614174000 + remote_id: exp_123e4567-e89b-12d3-a456-426614174000 + created_at: '2024-01-31T12:00:00Z' + modified_at: '2024-01-31T14:30:00Z' + report_date: '2024-01-31T00:00:00Z' + report_identifier: EXP-2024-001 + employee: b9a9b824-6172-4d63-9d90-1c8a86c4f3b1 + status: DRAFT + total_amount: 150 + lines: + - id: '1234' + remote_id: abcd-1234 + created_at: '2021-09-15T00:00:00Z' + modified_at: '2021-10-16T00:00:00Z' + account: acc-1234 + description: Client lunch meeting + expense_date: '2024-01-15T00:00:00Z' + amount: 50 + currency: USD + exchange_rate: exchange_rate + is_billable: true + tracking_categories: + - cat-1 + - cat-2 + employee: emp-1234 + project: proj-5678 + company: comp-1234 + contact: cont-5678 + quantity: 1 + unit_price: 50 + non_reimbursable: false + tax_amount: 5 + inclusive_of_tax: false + tax_rate: tax-1234 + remote_was_deleted: false + currency: XUA + description: January 2024 Travel Expenses + accounting_period: 7d793c67-9f72-4a6b-9256-3936f237b0d9 + company: company + tracking_categories: + - a1b2c3d4-e5f6-4a5b-9c3d-2e1f0a9b8c7d + - d4c3b2a1-9e8f-7g6h-5i4j-3k2l1m0n9o8p + remote_was_deleted: true + field_mappings: + organization_defined_targets: + custom_key: custom_value + linked_account_defined_targets: + custom_key: custom_value + remote_data: + - path: /actions + data: + - Varies by platform + remote_fields: + - remote_field_class: remote_field_class + create: + path: /accounting/v1/expense-reports + method: POST + auth: true + docs: Creates an `ExpenseReport` object with the given values. + source: + openapi: openapi/openapi.yml + request: + name: ExpenseReportEndpointRequest + query-parameters: + is_debug_mode: + type: optional + docs: >- + Whether to include debug fields (such as log file links) in the + response. + run_async: + type: optional + docs: Whether or not third-party updates should be run asynchronously. + body: + properties: + model: root.ExpenseReportRequest + content-type: application/json + response: + docs: '' + type: root.ExpenseReportResponse + status-code: 201 + examples: + - headers: {} + request: + model: + tracking_categories: + - a1b2c3d4-e5f6-4a5b-9c3d-2e1f0a9b8c7d + - d4c3b2a1-9e8f-7g6h-5i4j-3k2l1m0n9o8p + response: + body: + model: + id: 123e4567-e89b-12d3-a456-426614174000 + remote_id: exp_123e4567-e89b-12d3-a456-426614174000 + created_at: '2024-01-31T12:00:00Z' + modified_at: '2024-01-31T14:30:00Z' + report_date: '2024-01-31T00:00:00Z' + report_identifier: EXP-2024-001 + employee: b9a9b824-6172-4d63-9d90-1c8a86c4f3b1 + status: DRAFT + total_amount: 150 + lines: + - id: '1234' + remote_id: abcd-1234 + created_at: '2021-09-15T00:00:00Z' + modified_at: '2021-10-16T00:00:00Z' + account: acc-1234 + description: Client lunch meeting + expense_date: '2024-01-15T00:00:00Z' + amount: 50 + currency: USD + exchange_rate: exchange_rate + is_billable: true + tracking_categories: + - cat-1 + - cat-2 + employee: emp-1234 + project: proj-5678 + company: comp-1234 + contact: cont-5678 + quantity: 1 + unit_price: 50 + non_reimbursable: false + tax_amount: 5 + inclusive_of_tax: false + tax_rate: tax-1234 + remote_was_deleted: false + currency: XUA + description: January 2024 Travel Expenses + accounting_period: 7d793c67-9f72-4a6b-9256-3936f237b0d9 + company: company + tracking_categories: + - a1b2c3d4-e5f6-4a5b-9c3d-2e1f0a9b8c7d + - d4c3b2a1-9e8f-7g6h-5i4j-3k2l1m0n9o8p + remote_was_deleted: true + field_mappings: + organization_defined_targets: + custom_key: custom_value + linked_account_defined_targets: + custom_key: custom_value + remote_data: + - path: /actions + data: + - Varies by platform + remote_fields: + - remote_field_class: remote_field_class + warnings: + - source: + pointer: pointer + title: Unrecognized Field + detail: An unrecognized field, age, was passed in with request data. + problem_type: UNRECOGNIZED_FIELD + errors: + - source: + pointer: pointer + title: Missing Required Field + detail: custom_fields is a required field on model. + problem_type: MISSING_REQUIRED_FIELD + logs: + - log_id: 99433219-8017-4acd-bb3c-ceb23d663832 + dashboard_view: >- + https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832 + log_summary: + url: www.exampleintegration.com/api/v1/exampleapi + method: POST + status_code: 200 + linesList: + path: /accounting/v1/expense-reports/{expense_report_id}/lines + method: GET + auth: true + docs: >- + Returns a list of `ExpenseReportLine` objects that point to a + `ExpenseReport` with the given id. + source: + openapi: openapi/openapi.yml + path-parameters: + expense_report_id: string + request: + name: ExpenseReportsLinesListRequest + query-parameters: + cursor: + type: optional + docs: The pagination cursor value. + expand: + type: optional + docs: >- + Which relations should be returned in expanded form. Multiple + relation names should be comma separated without spaces. + include_deleted_data: + type: optional + docs: >- + 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/). + include_remote_data: + type: optional + docs: >- + Whether to include the original data Merge fetched from the + third-party to produce these models. + include_remote_fields: + type: optional + docs: >- + Whether to include all remote fields, including fields that Merge + did not map to common models, in a normalized format. + include_shell_data: + type: optional + docs: >- + Whether to include shell records. Shell records are empty records + (they may contain some metadata but all other fields are null). + page_size: + type: optional + docs: Number of results to return per page. + response: + docs: '' + type: root.PaginatedExpenseReportLineList + status-code: 200 + examples: + - path-parameters: + expense_report_id: expense_report_id + headers: {} + response: + body: + next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ + results: + - id: '1234' + remote_id: abcd-1234 + created_at: '2021-09-15T00:00:00Z' + modified_at: '2021-10-16T00:00:00Z' + account: account + description: Client lunch meeting + expense_date: '2024-01-15T00:00:00Z' + amount: 50 + currency: XUA + exchange_rate: exchange_rate + is_billable: true + tracking_categories: + - cat-1 + - cat-2 + employee: employee + project: project + company: company + contact: contact + quantity: 1 + unit_price: 50 + non_reimbursable: true + tax_amount: 5 + inclusive_of_tax: true + tax_rate: tax_rate + remote_was_deleted: true + remote_fields: + - remote_field_class: remote_field_class + retrieve: + path: /accounting/v1/expense-reports/{id} + method: GET + auth: true + docs: Returns an `ExpenseReport` object with the given `id`. + source: + openapi: openapi/openapi.yml + path-parameters: + id: string + request: + name: ExpenseReportsRetrieveRequest + query-parameters: + expand: + type: optional + docs: >- + Which relations should be returned in expanded form. Multiple + relation names should be comma separated without spaces. + include_remote_data: + type: optional + docs: >- + Whether to include the original data Merge fetched from the + third-party to produce these models. + include_remote_fields: + type: optional + docs: >- + Whether to include all remote fields, including fields that Merge + did not map to common models, in a normalized format. + include_shell_data: + type: optional + docs: >- + Whether to include shell records. Shell records are empty records + (they may contain some metadata but all other fields are null). + response: + docs: '' + type: root.ExpenseReport + status-code: 200 + examples: + - path-parameters: + id: id + headers: {} + response: + body: + id: 123e4567-e89b-12d3-a456-426614174000 + remote_id: exp_123e4567-e89b-12d3-a456-426614174000 + created_at: '2024-01-31T12:00:00Z' + modified_at: '2024-01-31T14:30:00Z' + report_date: '2024-01-31T00:00:00Z' + report_identifier: EXP-2024-001 + employee: b9a9b824-6172-4d63-9d90-1c8a86c4f3b1 + status: DRAFT + total_amount: 150 + lines: + - id: '1234' + remote_id: abcd-1234 + created_at: '2021-09-15T00:00:00Z' + modified_at: '2021-10-16T00:00:00Z' + account: acc-1234 + description: Client lunch meeting + expense_date: '2024-01-15T00:00:00Z' + amount: 50 + currency: USD + exchange_rate: exchange_rate + is_billable: true + tracking_categories: + - cat-1 + - cat-2 + employee: emp-1234 + project: proj-5678 + company: comp-1234 + contact: cont-5678 + quantity: 1 + unit_price: 50 + non_reimbursable: false + tax_amount: 5 + inclusive_of_tax: false + tax_rate: tax-1234 + remote_was_deleted: false + remote_fields: + - remote_field_class: remote_field_class + currency: XUA + description: January 2024 Travel Expenses + accounting_period: 7d793c67-9f72-4a6b-9256-3936f237b0d9 + company: company + tracking_categories: + - a1b2c3d4-e5f6-4a5b-9c3d-2e1f0a9b8c7d + - d4c3b2a1-9e8f-7g6h-5i4j-3k2l1m0n9o8p + remote_was_deleted: true + field_mappings: + organization_defined_targets: + custom_key: custom_value + linked_account_defined_targets: + custom_key: custom_value + remote_data: + - path: /actions + data: + - Varies by platform + remote_fields: + - remote_field_class: remote_field_class + value: + key: value + linesRemoteFieldClassesList: + path: /accounting/v1/expense-reports/lines/remote-field-classes + method: GET + auth: true + docs: Returns a list of `RemoteFieldClass` objects. + source: + openapi: openapi/openapi.yml + request: + name: ExpenseReportsLinesRemoteFieldClassesListRequest + query-parameters: + cursor: + type: optional + docs: The pagination cursor value. + include_deleted_data: + type: optional + docs: >- + 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/). + include_remote_data: + type: optional + docs: >- + Whether to include the original data Merge fetched from the + third-party to produce these models. + include_shell_data: + type: optional + docs: >- + Whether to include shell records. Shell records are empty records + (they may contain some metadata but all other fields are null). + is_common_model_field: + type: optional + docs: >- + If provided, will only return remote field classes with this + is_common_model_field value + is_custom: + type: optional + docs: >- + If provided, will only return remote fields classes with this + is_custom value + page_size: + type: optional + docs: Number of results to return per page. + response: + docs: '' + type: root.PaginatedRemoteFieldClassList + status-code: 200 + examples: + - headers: {} + response: + body: + next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ + results: + - id: id + display_name: display_name + remote_key_name: remote_key_name + description: description + is_custom: true + is_required: true + field_type: string + field_format: string + field_choices: + - field_choices + metaPostRetrieve: + path: /accounting/v1/expense-reports/meta/post + method: GET + auth: true + docs: Returns metadata for `ExpenseReport` POSTs. + source: + openapi: openapi/openapi.yml + response: + docs: '' + type: root.MetaResponse + status-code: 200 + examples: + - headers: {} + response: + body: + request_schema: + type: object + properties: + model: + type: object + required: + - last_name + - first_name + - merge_categories + - new_york_city_neighborhood + - favorite_tv_shows + - favorite_watch + properties: + email_addresses: + type: array + items: + type: object + properties: + value: + type: string + title: value + email_address_type: + type: string + title: email_address_type + integration_params: + type: object + title: integration_params + properties: {} + linked_account_params: + type: object + title: linked_account_params + properties: {} + title: email_addresses + description: Array of email_addresses objects + urls: + type: array + items: + type: object + properties: + value: + type: string + title: value + url_type: + type: string + title: url_type + integration_params: + type: object + title: integration_params + properties: {} + linked_account_params: + type: object + title: linked_account_params + properties: {} + title: urls + description: Array of urls objects + first_name: + type: string + title: first_name + description: The first name. + last_name: + type: string + title: last_name + description: The last name. + phone_numbers: + type: array + items: + type: object + properties: + value: + type: string + title: value + phone_number_type: + type: string + title: phone_number_type + integration_params: + type: object + title: integration_params + properties: {} + linked_account_params: + type: object + title: linked_account_params + properties: {} + title: phone_numbers + description: Array of phone_numbers objects + tags: + type: array + items: + type: string + format: uuid + title: tags + description: Array of tags names + attachments: + type: array + items: + type: object + properties: + id: + type: string + title: id + file_url: + type: string + title: file_url + file_name: + type: string + title: file_name + attachment_type: + type: string + title: attachment_type + integration_params: + type: object + title: integration_params + properties: {} + linked_account_params: + type: object + title: linked_account_params + properties: {} + title: attachments + description: 'Array of attachments objects ' + merge_categories: + type: array + categories: + type: string + enum: + - HRIS + - ATS + - Accounting + - Ticketing + - File Storage + - CRM + - Marketing Automation + enum_information: + - value: HRIS + description: Merge HRIS Category + - value: ATS + description: Merge ATS Category + - value: Accounting + description: Merge Accounting Category + - value: Ticketing + description: Merge Ticketing Category + - value: File Storage + description: Merge File Storage Category + - value: CRM + description: Merge CRM Category + - value: Marketing Automation + description: Merge Marketing Automation Category + title: Merge Categories + description: Array of Merge's Unified API Categories + new_york_city_neighborhood: + type: string + title: Borough + description: One of the 5 Boroughs of New York City + favorite_tv_shows: + type: array + items: + type: string + format: uuid + title: Favorite TV Shows + description: Array of TV Show objects on merge.tv_shows + favorite_watch: + type: string + title: Favorite Watch + description: Favorite watch of all time + remote_field_classes: + key: value + status: + linked_account_status: linked_account_status + can_make_request: true + has_conditional_params: true + has_required_linked_account_params: true + remoteFieldClassesList: + path: /accounting/v1/expense-reports/remote-field-classes + method: GET + auth: true + docs: Returns a list of `RemoteFieldClass` objects. + source: + openapi: openapi/openapi.yml + request: + name: ExpenseReportsRemoteFieldClassesListRequest + query-parameters: + cursor: + type: optional + docs: The pagination cursor value. + include_deleted_data: + type: optional + docs: >- + 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/). + include_remote_data: + type: optional + docs: >- + Whether to include the original data Merge fetched from the + third-party to produce these models. + include_shell_data: + type: optional + docs: >- + Whether to include shell records. Shell records are empty records + (they may contain some metadata but all other fields are null). + is_common_model_field: + type: optional + docs: >- + If provided, will only return remote field classes with this + is_common_model_field value + is_custom: + type: optional + docs: >- + If provided, will only return remote fields classes with this + is_custom value + page_size: + type: optional + docs: Number of results to return per page. + response: + docs: '' + type: root.PaginatedRemoteFieldClassList + status-code: 200 + examples: + - headers: {} + response: + body: + next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ + results: + - id: id + display_name: display_name + remote_key_name: remote_key_name + description: description + is_custom: true + is_required: true + field_type: string + field_format: string + field_choices: + - field_choices + source: + openapi: openapi/openapi.yml diff --git a/.mock/definition/accounting/fieldMapping.yml b/.mock/definition/accounting/fieldMapping.yml index 7f106183..66389088 100644 --- a/.mock/definition/accounting/fieldMapping.yml +++ b/.mock/definition/accounting/fieldMapping.yml @@ -193,6 +193,22 @@ service: url_path: /example-url-path field_traversal_path: - example_remote_field_key + ExpenseReport: + - id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + is_integration_wide: true + target_field: + name: example_target_field_name + description: this is a example description of a target field + is_organization_wide: true + remote_field: + remote_key_name: example_remote_field_key + schema: + type: string + remote_endpoint_info: + method: GET + url_path: /example-url-path + field_traversal_path: + - example_remote_field_key TrackingCategory: - id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 is_integration_wide: true @@ -1134,6 +1150,10 @@ service: - name: example_target_field_name description: this is a example description of a target field is_mapped: is_mapped + ExpenseReport: + - name: example_target_field_name + description: this is a example description of a target field + is_mapped: is_mapped TrackingCategory: - name: example_target_field_name description: this is a example description of a target field diff --git a/.mock/definition/accounting/items.yml b/.mock/definition/accounting/items.yml index 7ee5dea7..29a34438 100644 --- a/.mock/definition/accounting/items.yml +++ b/.mock/definition/accounting/items.yml @@ -219,6 +219,7 @@ service: modified_at: '2021-10-16T00:00:00Z' name: Pickleball Paddle status: ACTIVE + type: INVENTORY unit_price: 10 purchase_price: 25 purchase_account: purchase_account @@ -276,6 +277,7 @@ service: modified_at: '2021-10-16T00:00:00Z' name: Pickleball Paddle status: ACTIVE + type: INVENTORY unit_price: 10 purchase_price: 25 purchase_account: purchase_account @@ -367,6 +369,7 @@ service: modified_at: '2021-10-16T00:00:00Z' name: Pickleball Paddle status: ACTIVE + type: INVENTORY unit_price: 10 purchase_price: 25 purchase_account: purchase_account @@ -428,6 +431,7 @@ service: modified_at: '2021-10-16T00:00:00Z' name: Pickleball Paddle status: ACTIVE + type: INVENTORY unit_price: 10 purchase_price: 25 purchase_account: purchase_account diff --git a/.mock/definition/accounting/payments.yml b/.mock/definition/accounting/payments.yml index 26c0f1b9..be829a43 100644 --- a/.mock/definition/accounting/payments.yml +++ b/.mock/definition/accounting/payments.yml @@ -653,7 +653,7 @@ service: remote_id: '234' created_at: '2021-09-15T00:00:00Z' modified_at: '2021-10-16T00:00:00Z' - applied_amount: applied_amount + applied_amount: '25' applied_date: '2020-03-31T00:00:00Z' related_object_id: a47e11b6-c73b-4a0c-be31-130fc48177fa related_object_type: INVOICE @@ -661,7 +661,7 @@ service: remote_id: '235' created_at: '2021-09-15T00:00:00Z' modified_at: '2021-10-16T00:00:00Z' - applied_amount: applied_amount + applied_amount: '25' applied_date: '2020-03-31T00:00:00Z' related_object_id: 9b96a886-29a5-452b-8733-2a1e03497cf4 related_object_type: CREDIT_NOTE @@ -734,7 +734,7 @@ service: remote_id: '234' created_at: '2021-09-15T00:00:00Z' modified_at: '2021-10-16T00:00:00Z' - applied_amount: applied_amount + applied_amount: '25' applied_date: '2020-03-31T00:00:00Z' related_object_id: a47e11b6-c73b-4a0c-be31-130fc48177fa related_object_type: INVOICE @@ -742,7 +742,7 @@ service: remote_id: '235' created_at: '2021-09-15T00:00:00Z' modified_at: '2021-10-16T00:00:00Z' - applied_amount: applied_amount + applied_amount: '25' applied_date: '2020-03-31T00:00:00Z' related_object_id: 9b96a886-29a5-452b-8733-2a1e03497cf4 related_object_type: CREDIT_NOTE @@ -844,7 +844,7 @@ service: remote_id: '234' created_at: '2021-09-15T00:00:00Z' modified_at: '2021-10-16T00:00:00Z' - applied_amount: applied_amount + applied_amount: '25' applied_date: '2020-03-31T00:00:00Z' related_object_id: a47e11b6-c73b-4a0c-be31-130fc48177fa related_object_type: INVOICE @@ -852,7 +852,7 @@ service: remote_id: '235' created_at: '2021-09-15T00:00:00Z' modified_at: '2021-10-16T00:00:00Z' - applied_amount: applied_amount + applied_amount: '25' applied_date: '2020-03-31T00:00:00Z' related_object_id: 9b96a886-29a5-452b-8733-2a1e03497cf4 related_object_type: CREDIT_NOTE @@ -931,7 +931,7 @@ service: remote_id: '234' created_at: '2021-09-15T00:00:00Z' modified_at: '2021-10-16T00:00:00Z' - applied_amount: applied_amount + applied_amount: '25' applied_date: '2020-03-31T00:00:00Z' related_object_id: a47e11b6-c73b-4a0c-be31-130fc48177fa related_object_type: INVOICE @@ -939,7 +939,7 @@ service: remote_id: '235' created_at: '2021-09-15T00:00:00Z' modified_at: '2021-10-16T00:00:00Z' - applied_amount: applied_amount + applied_amount: '25' applied_date: '2020-03-31T00:00:00Z' related_object_id: 9b96a886-29a5-452b-8733-2a1e03497cf4 related_object_type: CREDIT_NOTE diff --git a/.mock/definition/accounting/projects.yml b/.mock/definition/accounting/projects.yml index 097c0ff2..c83c6626 100644 --- a/.mock/definition/accounting/projects.yml +++ b/.mock/definition/accounting/projects.yml @@ -31,6 +31,17 @@ service: request: name: ProjectsListRequest query-parameters: + company_id: + type: optional + docs: If provided, will only return projects for this company. + created_after: + type: optional + docs: If provided, will only return objects created after this datetime. + created_before: + type: optional + docs: >- + If provided, will only return objects created before this + datetime. cursor: type: optional docs: The pagination cursor value. @@ -57,9 +68,22 @@ service: docs: >- Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + modified_after: + type: optional + docs: >- + If provided, only objects synced by Merge after this date time + will be returned. + modified_before: + type: optional + docs: >- + If provided, only objects synced by Merge before this date time + will be returned. page_size: type: optional docs: Number of results to return per page. + remote_id: + type: optional + docs: The API provider's ID for the given object. response: docs: '' type: root.PaginatedProjectList diff --git a/README.md b/README.md index 2667301c..f61bfd79 100644 --- a/README.md +++ b/README.md @@ -229,3 +229,4 @@ while response.next is not None: created_after="2030-01-01") ``` + diff --git a/poetry.lock b/poetry.lock index 3ddef646..c1c2313e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -38,13 +38,13 @@ trio = ["trio (>=0.26.1)"] [[package]] name = "certifi" -version = "2025.6.15" +version = "2025.7.14" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.7" files = [ - {file = "certifi-2025.6.15-py3-none-any.whl", hash = "sha256:2e0c7ce7cb5d8f8634ca55d2ba7e6ec2689a2fd6537d8dec1296a477a4910057"}, - {file = "certifi-2025.6.15.tar.gz", hash = "sha256:d747aa5a8b9bbbb1bb8c22bb13e22bd1f18e9796defa16bab421f7f7a317323b"}, + {file = "certifi-2025.7.14-py3-none-any.whl", hash = "sha256:6b31f564a415d79ee77df69d757bb49a5bb53bd9f756cbbe24394ffd6fc1f4b2"}, + {file = "certifi-2025.7.14.tar.gz", hash = "sha256:8ea99dbdfaaf2ba2f9bac77b9249ef62ec5218e7c2b2e903378ed5fccf765995"}, ] [[package]] diff --git a/pyproject.toml b/pyproject.toml index 5a5e5da9..88939876 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "MergePythonClient" [tool.poetry] name = "MergePythonClient" -version = "2.1.0" +version = "2.1.1" description = "" readme = "README.md" authors = [] diff --git a/reference.md b/reference.md index 493d037f..a497d5bf 100644 --- a/reference.md +++ b/reference.md @@ -40598,6 +40598,527 @@ client.accounting.employees.list()
+**company_id:** `typing.Optional[str]` — If provided, will only return employees for this company. + +
+
+ +
+
+ +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `typing.Optional[str]` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `typing.Optional[typing.Literal["company"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**include_deleted_data:** `typing.Optional[bool]` — 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/). + +
+
+ +
+
+ +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**include_shell_data:** `typing.Optional[bool]` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**page_size:** `typing.Optional[int]` — Number of results to return per page. + +
+
+ +
+
+ +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+ + + + + + + + +
client.accounting.employees.retrieve(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `Employee` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.accounting.employees.retrieve( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**expand:** `typing.Optional[typing.Literal["company"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**include_shell_data:** `typing.Optional[bool]` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Accounting ExpenseReports +
client.accounting.expense_reports.list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `ExpenseReport` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.accounting.expense_reports.list() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**company_id:** `typing.Optional[str]` — If provided, will only return expense reports for this company. + +
+
+ +
+
+ +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `typing.Optional[str]` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `typing.Optional[ExpenseReportsListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**include_deleted_data:** `typing.Optional[bool]` — 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/). + +
+
+ +
+
+ +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**include_shell_data:** `typing.Optional[bool]` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**page_size:** `typing.Optional[int]` — Number of results to return per page. + +
+
+ +
+
+ +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.accounting.expense_reports.create(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates an `ExpenseReport` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge +from merge.resources.accounting import ExpenseReportRequest + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.accounting.expense_reports.create( + model=ExpenseReportRequest( + tracking_categories=[ + "a1b2c3d4-e5f6-4a5b-9c3d-2e1f0a9b8c7d", + "d4c3b2a1-9e8f-7g6h-5i4j-3k2l1m0n9o8p", + ], + ), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**model:** `ExpenseReportRequest` + +
+
+ +
+
+ +**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.accounting.expense_reports.lines_list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `ExpenseReportLine` objects that point to a `ExpenseReport` with the given id. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.accounting.expense_reports.lines_list( + expense_report_id="expense_report_id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**expense_report_id:** `str` + +
+
+ +
+
+ **cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -40606,7 +41127,219 @@ client.accounting.employees.list()
-**expand:** `typing.Optional[typing.Literal["company"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**expand:** `typing.Optional[ExpenseReportsLinesListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**include_deleted_data:** `typing.Optional[bool]` — 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/). + +
+
+ +
+
+ +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**include_shell_data:** `typing.Optional[bool]` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**page_size:** `typing.Optional[int]` — Number of results to return per page. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.accounting.expense_reports.retrieve(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `ExpenseReport` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.accounting.expense_reports.retrieve( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**expand:** `typing.Optional[ExpenseReportsRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**include_shell_data:** `typing.Optional[bool]` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.accounting.expense_reports.lines_remote_field_classes_list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.accounting.expense_reports.lines_remote_field_classes_list() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -40638,6 +41371,22 @@ client.accounting.employees.list()
+**is_common_model_field:** `typing.Optional[bool]` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**is_custom:** `typing.Optional[bool]` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ **page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -40658,7 +41407,7 @@ client.accounting.employees.list()
-
client.accounting.employees.retrieve(...) +
client.accounting.expense_reports.meta_post_retrieve()
@@ -40670,7 +41419,7 @@ client.accounting.employees.list()
-Returns an `Employee` object with the given `id`. +Returns metadata for `ExpenseReport` POSTs.
@@ -40691,9 +41440,68 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.accounting.employees.retrieve( - id="id", +client.accounting.expense_reports.meta_post_retrieve() + +``` + +
+ + + +#### ⚙️ Parameters + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + + + +
+ +
client.accounting.expense_reports.remote_field_classes_list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", ) +client.accounting.expense_reports.remote_field_classes_list() ```
@@ -40709,7 +41517,7 @@ client.accounting.employees.retrieve(
-**id:** `str` +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -40717,7 +41525,7 @@ client.accounting.employees.retrieve(
-**expand:** `typing.Optional[typing.Literal["company"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**include_deleted_data:** `typing.Optional[bool]` — 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/).
@@ -40741,6 +41549,30 @@ client.accounting.employees.retrieve(
+**is_common_model_field:** `typing.Optional[bool]` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**is_custom:** `typing.Optional[bool]` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ +**page_size:** `typing.Optional[int]` — Number of results to return per page. + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -46769,6 +47601,30 @@ client.accounting.projects.list()
+**company_id:** `typing.Optional[str]` — If provided, will only return projects for this company. + +
+
+ +
+
+ +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ **cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -46809,6 +47665,22 @@ client.accounting.projects.list()
+**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ **page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -46817,6 +47689,14 @@ client.accounting.projects.list()
+**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
diff --git a/src/merge/core/client_wrapper.py b/src/merge/core/client_wrapper.py index a844b5dd..955b5565 100644 --- a/src/merge/core/client_wrapper.py +++ b/src/merge/core/client_wrapper.py @@ -24,10 +24,10 @@ def __init__( def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { - "User-Agent": "MergePythonClient/2.1.0", + "User-Agent": "MergePythonClient/2.1.1", "X-Fern-Language": "Python", "X-Fern-SDK-Name": "MergePythonClient", - "X-Fern-SDK-Version": "2.1.0", + "X-Fern-SDK-Version": "2.1.1", **(self.get_custom_headers() or {}), } if self._account_token is not None: diff --git a/src/merge/core/unchecked_base_model.py b/src/merge/core/unchecked_base_model.py index 2c2d92a7..e04a6f81 100644 --- a/src/merge/core/unchecked_base_model.py +++ b/src/merge/core/unchecked_base_model.py @@ -124,12 +124,50 @@ def construct( return m +def _validate_collection_items_compatible(collection: typing.Any, target_type: typing.Type[typing.Any]) -> bool: + """ + Validate that all items in a collection are compatible with the target type. + + Args: + collection: The collection to validate (list, set, or dict values) + target_type: The target type to validate against + + Returns: + True if all items are compatible, False otherwise + """ + if inspect.isclass(target_type) and issubclass(target_type, pydantic.BaseModel): + for item in collection: + try: + # Try to validate the item against the target type + if isinstance(item, dict): + parse_obj_as(target_type, item) + else: + # If it's not a dict, it might already be the right type + if not isinstance(item, target_type): + return False + except Exception: + return False + return True + + def _convert_undiscriminated_union_type(union_type: typing.Type[typing.Any], object_: typing.Any) -> typing.Any: inner_types = get_args(union_type) if typing.Any in inner_types: return object_ for inner_type in inner_types: + # Handle lists of objects that need parsing + if get_origin(inner_type) is list and isinstance(object_, list): + list_inner_type = get_args(inner_type)[0] + try: + if inspect.isclass(list_inner_type) and issubclass(list_inner_type, pydantic.BaseModel): + # Validate that all items in the list are compatible with the target type + if _validate_collection_items_compatible(object_, list_inner_type): + parsed_list = [parse_obj_as(object_=item, type_=list_inner_type) for item in object_] + return parsed_list + except Exception: + pass + try: if inspect.isclass(inner_type) and issubclass(inner_type, pydantic.BaseModel): # Attempt a validated parse until one works diff --git a/src/merge/resources/accounting/__init__.py b/src/merge/resources/accounting/__init__.py index d457fc48..ce637e34 100644 --- a/src/merge/resources/accounting/__init__.py +++ b/src/merge/resources/accounting/__init__.py @@ -163,6 +163,29 @@ ExpenseLineRequestTrackingCategory, ExpenseLineTrackingCategoriesItem, ExpenseLineTrackingCategory, + ExpenseReport, + ExpenseReportCompany, + ExpenseReportLine, + ExpenseReportLineAccount, + ExpenseReportLineCompany, + ExpenseReportLineContact, + ExpenseReportLineEmployee, + ExpenseReportLineProject, + ExpenseReportLineRequest, + ExpenseReportLineRequestAccount, + ExpenseReportLineRequestCompany, + ExpenseReportLineRequestContact, + ExpenseReportLineRequestEmployee, + ExpenseReportLineRequestProject, + ExpenseReportLineRequestTaxRate, + ExpenseReportLineTaxRate, + ExpenseReportRequest, + ExpenseReportRequestAccountingPeriod, + ExpenseReportRequestCompany, + ExpenseReportRequestEmployee, + ExpenseReportResponse, + ExpenseReportStatus, + ExpenseReportStatusEnum, ExpenseRequest, ExpenseRequestAccount, ExpenseRequestAccountingPeriod, @@ -275,6 +298,7 @@ ItemSalesTaxRate, ItemSchema, ItemStatus, + ItemType, ItemTypeEnum, JournalEntry, JournalEntryAccountingPeriod, @@ -329,6 +353,8 @@ PaginatedCreditNoteList, PaginatedEmployeeList, PaginatedExpenseList, + PaginatedExpenseReportLineList, + PaginatedExpenseReportList, PaginatedGeneralLedgerTransactionList, PaginatedIncomeStatementList, PaginatedInvoiceList, @@ -508,6 +534,9 @@ CreditNotesRetrieveRequestRemoteFields, CreditNotesRetrieveRequestShowEnumOrigins, EndUserDetailsRequestLanguage, + ExpenseReportsLinesListRequestExpand, + ExpenseReportsListRequestExpand, + ExpenseReportsRetrieveRequestExpand, ExpensesListRequestExpand, ExpensesRetrieveRequestExpand, GeneralLedgerTransactionsListRequestExpand, @@ -551,6 +580,7 @@ credit_notes, delete_account, employees, + expense_reports, expenses, field_mapping, force_resync, @@ -757,6 +787,32 @@ "ExpenseLineRequestTrackingCategory", "ExpenseLineTrackingCategoriesItem", "ExpenseLineTrackingCategory", + "ExpenseReport", + "ExpenseReportCompany", + "ExpenseReportLine", + "ExpenseReportLineAccount", + "ExpenseReportLineCompany", + "ExpenseReportLineContact", + "ExpenseReportLineEmployee", + "ExpenseReportLineProject", + "ExpenseReportLineRequest", + "ExpenseReportLineRequestAccount", + "ExpenseReportLineRequestCompany", + "ExpenseReportLineRequestContact", + "ExpenseReportLineRequestEmployee", + "ExpenseReportLineRequestProject", + "ExpenseReportLineRequestTaxRate", + "ExpenseReportLineTaxRate", + "ExpenseReportRequest", + "ExpenseReportRequestAccountingPeriod", + "ExpenseReportRequestCompany", + "ExpenseReportRequestEmployee", + "ExpenseReportResponse", + "ExpenseReportStatus", + "ExpenseReportStatusEnum", + "ExpenseReportsLinesListRequestExpand", + "ExpenseReportsListRequestExpand", + "ExpenseReportsRetrieveRequestExpand", "ExpenseRequest", "ExpenseRequestAccount", "ExpenseRequestAccountingPeriod", @@ -878,6 +934,7 @@ "ItemSalesTaxRate", "ItemSchema", "ItemStatus", + "ItemType", "ItemTypeEnum", "ItemsListRequestExpand", "ItemsRetrieveRequestExpand", @@ -937,6 +994,8 @@ "PaginatedCreditNoteList", "PaginatedEmployeeList", "PaginatedExpenseList", + "PaginatedExpenseReportLineList", + "PaginatedExpenseReportList", "PaginatedGeneralLedgerTransactionList", "PaginatedIncomeStatementList", "PaginatedInvoiceList", @@ -1127,6 +1186,7 @@ "credit_notes", "delete_account", "employees", + "expense_reports", "expenses", "field_mapping", "force_resync", diff --git a/src/merge/resources/accounting/client.py b/src/merge/resources/accounting/client.py index 856b2583..5350ccfa 100644 --- a/src/merge/resources/accounting/client.py +++ b/src/merge/resources/accounting/client.py @@ -24,6 +24,7 @@ from .resources.credit_notes.client import AsyncCreditNotesClient, CreditNotesClient from .resources.delete_account.client import AsyncDeleteAccountClient, DeleteAccountClient from .resources.employees.client import AsyncEmployeesClient, EmployeesClient +from .resources.expense_reports.client import AsyncExpenseReportsClient, ExpenseReportsClient from .resources.expenses.client import AsyncExpensesClient, ExpensesClient from .resources.field_mapping.client import AsyncFieldMappingClient, FieldMappingClient from .resources.force_resync.client import AsyncForceResyncClient, ForceResyncClient @@ -104,6 +105,8 @@ def __init__(self, *, client_wrapper: SyncClientWrapper): self.employees = EmployeesClient(client_wrapper=client_wrapper) + self.expense_reports = ExpenseReportsClient(client_wrapper=client_wrapper) + self.expenses = ExpensesClient(client_wrapper=client_wrapper) self.field_mapping = FieldMappingClient(client_wrapper=client_wrapper) @@ -211,6 +214,8 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper): self.employees = AsyncEmployeesClient(client_wrapper=client_wrapper) + self.expense_reports = AsyncExpenseReportsClient(client_wrapper=client_wrapper) + self.expenses = AsyncExpensesClient(client_wrapper=client_wrapper) self.field_mapping = AsyncFieldMappingClient(client_wrapper=client_wrapper) diff --git a/src/merge/resources/accounting/resources/__init__.py b/src/merge/resources/accounting/resources/__init__.py index b80f6cff..99d5cf4b 100644 --- a/src/merge/resources/accounting/resources/__init__.py +++ b/src/merge/resources/accounting/resources/__init__.py @@ -22,6 +22,7 @@ credit_notes, delete_account, employees, + expense_reports, expenses, field_mapping, force_resync, @@ -67,6 +68,11 @@ CreditNotesRetrieveRequestRemoteFields, CreditNotesRetrieveRequestShowEnumOrigins, ) +from .expense_reports import ( + ExpenseReportsLinesListRequestExpand, + ExpenseReportsListRequestExpand, + ExpenseReportsRetrieveRequestExpand, +) from .expenses import ExpensesListRequestExpand, ExpensesRetrieveRequestExpand from .general_ledger_transactions import ( GeneralLedgerTransactionsListRequestExpand, @@ -106,6 +112,9 @@ "CreditNotesRetrieveRequestRemoteFields", "CreditNotesRetrieveRequestShowEnumOrigins", "EndUserDetailsRequestLanguage", + "ExpenseReportsLinesListRequestExpand", + "ExpenseReportsListRequestExpand", + "ExpenseReportsRetrieveRequestExpand", "ExpensesListRequestExpand", "ExpensesRetrieveRequestExpand", "GeneralLedgerTransactionsListRequestExpand", @@ -149,6 +158,7 @@ "credit_notes", "delete_account", "employees", + "expense_reports", "expenses", "field_mapping", "force_resync", diff --git a/src/merge/resources/accounting/resources/employees/client.py b/src/merge/resources/accounting/resources/employees/client.py index 1e1a6018..eef0756f 100644 --- a/src/merge/resources/accounting/resources/employees/client.py +++ b/src/merge/resources/accounting/resources/employees/client.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import datetime as dt import typing from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper @@ -27,12 +28,18 @@ def with_raw_response(self) -> RawEmployeesClient: def list( self, *, + company_id: typing.Optional[str] = None, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, cursor: typing.Optional[str] = None, expand: typing.Optional[typing.Literal["company"]] = None, include_deleted_data: typing.Optional[bool] = None, include_remote_data: typing.Optional[bool] = None, include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, page_size: typing.Optional[int] = None, + remote_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> PaginatedEmployeeList: """ @@ -40,6 +47,15 @@ def list( Parameters ---------- + company_id : typing.Optional[str] + If provided, will only return employees for this company. + + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + cursor : typing.Optional[str] The pagination cursor value. @@ -55,9 +71,18 @@ def list( include_shell_data : typing.Optional[bool] Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + page_size : typing.Optional[int] Number of results to return per page. + remote_id : typing.Optional[str] + The API provider's ID for the given object. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -77,12 +102,18 @@ def list( client.accounting.employees.list() """ _response = self._raw_client.list( + company_id=company_id, + created_after=created_after, + created_before=created_before, cursor=cursor, expand=expand, include_deleted_data=include_deleted_data, include_remote_data=include_remote_data, include_shell_data=include_shell_data, + modified_after=modified_after, + modified_before=modified_before, page_size=page_size, + remote_id=remote_id, request_options=request_options, ) return _response.data @@ -160,12 +191,18 @@ def with_raw_response(self) -> AsyncRawEmployeesClient: async def list( self, *, + company_id: typing.Optional[str] = None, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, cursor: typing.Optional[str] = None, expand: typing.Optional[typing.Literal["company"]] = None, include_deleted_data: typing.Optional[bool] = None, include_remote_data: typing.Optional[bool] = None, include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, page_size: typing.Optional[int] = None, + remote_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> PaginatedEmployeeList: """ @@ -173,6 +210,15 @@ async def list( Parameters ---------- + company_id : typing.Optional[str] + If provided, will only return employees for this company. + + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + cursor : typing.Optional[str] The pagination cursor value. @@ -188,9 +234,18 @@ async def list( include_shell_data : typing.Optional[bool] Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + page_size : typing.Optional[int] Number of results to return per page. + remote_id : typing.Optional[str] + The API provider's ID for the given object. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -218,12 +273,18 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.list( + company_id=company_id, + created_after=created_after, + created_before=created_before, cursor=cursor, expand=expand, include_deleted_data=include_deleted_data, include_remote_data=include_remote_data, include_shell_data=include_shell_data, + modified_after=modified_after, + modified_before=modified_before, page_size=page_size, + remote_id=remote_id, request_options=request_options, ) return _response.data diff --git a/src/merge/resources/accounting/resources/employees/raw_client.py b/src/merge/resources/accounting/resources/employees/raw_client.py index 80480b1f..65ffab63 100644 --- a/src/merge/resources/accounting/resources/employees/raw_client.py +++ b/src/merge/resources/accounting/resources/employees/raw_client.py @@ -1,10 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +import datetime as dt import typing from json.decoder import JSONDecodeError from .....core.api_error import ApiError from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.datetime_utils import serialize_datetime from .....core.http_response import AsyncHttpResponse, HttpResponse from .....core.jsonable_encoder import jsonable_encoder from .....core.request_options import RequestOptions @@ -20,12 +22,18 @@ def __init__(self, *, client_wrapper: SyncClientWrapper): def list( self, *, + company_id: typing.Optional[str] = None, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, cursor: typing.Optional[str] = None, expand: typing.Optional[typing.Literal["company"]] = None, include_deleted_data: typing.Optional[bool] = None, include_remote_data: typing.Optional[bool] = None, include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, page_size: typing.Optional[int] = None, + remote_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[PaginatedEmployeeList]: """ @@ -33,6 +41,15 @@ def list( Parameters ---------- + company_id : typing.Optional[str] + If provided, will only return employees for this company. + + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + cursor : typing.Optional[str] The pagination cursor value. @@ -48,9 +65,18 @@ def list( include_shell_data : typing.Optional[bool] Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + page_size : typing.Optional[int] Number of results to return per page. + remote_id : typing.Optional[str] + The API provider's ID for the given object. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -63,12 +89,18 @@ def list( "accounting/v1/employees", method="GET", params={ + "company_id": company_id, + "created_after": serialize_datetime(created_after) if created_after is not None else None, + "created_before": serialize_datetime(created_before) if created_before is not None else None, "cursor": cursor, "expand": expand, "include_deleted_data": include_deleted_data, "include_remote_data": include_remote_data, "include_shell_data": include_shell_data, + "modified_after": serialize_datetime(modified_after) if modified_after is not None else None, + "modified_before": serialize_datetime(modified_before) if modified_before is not None else None, "page_size": page_size, + "remote_id": remote_id, }, request_options=request_options, ) @@ -153,12 +185,18 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper): async def list( self, *, + company_id: typing.Optional[str] = None, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, cursor: typing.Optional[str] = None, expand: typing.Optional[typing.Literal["company"]] = None, include_deleted_data: typing.Optional[bool] = None, include_remote_data: typing.Optional[bool] = None, include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, page_size: typing.Optional[int] = None, + remote_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[PaginatedEmployeeList]: """ @@ -166,6 +204,15 @@ async def list( Parameters ---------- + company_id : typing.Optional[str] + If provided, will only return employees for this company. + + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + cursor : typing.Optional[str] The pagination cursor value. @@ -181,9 +228,18 @@ async def list( include_shell_data : typing.Optional[bool] Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + page_size : typing.Optional[int] Number of results to return per page. + remote_id : typing.Optional[str] + The API provider's ID for the given object. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -196,12 +252,18 @@ async def list( "accounting/v1/employees", method="GET", params={ + "company_id": company_id, + "created_after": serialize_datetime(created_after) if created_after is not None else None, + "created_before": serialize_datetime(created_before) if created_before is not None else None, "cursor": cursor, "expand": expand, "include_deleted_data": include_deleted_data, "include_remote_data": include_remote_data, "include_shell_data": include_shell_data, + "modified_after": serialize_datetime(modified_after) if modified_after is not None else None, + "modified_before": serialize_datetime(modified_before) if modified_before is not None else None, "page_size": page_size, + "remote_id": remote_id, }, request_options=request_options, ) diff --git a/src/merge/resources/accounting/resources/expense_reports/__init__.py b/src/merge/resources/accounting/resources/expense_reports/__init__.py new file mode 100644 index 00000000..b83948b7 --- /dev/null +++ b/src/merge/resources/accounting/resources/expense_reports/__init__.py @@ -0,0 +1,15 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +from .types import ( + ExpenseReportsLinesListRequestExpand, + ExpenseReportsListRequestExpand, + ExpenseReportsRetrieveRequestExpand, +) + +__all__ = [ + "ExpenseReportsLinesListRequestExpand", + "ExpenseReportsListRequestExpand", + "ExpenseReportsRetrieveRequestExpand", +] diff --git a/src/merge/resources/accounting/resources/expense_reports/client.py b/src/merge/resources/accounting/resources/expense_reports/client.py new file mode 100644 index 00000000..2a30eb5f --- /dev/null +++ b/src/merge/resources/accounting/resources/expense_reports/client.py @@ -0,0 +1,1001 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.request_options import RequestOptions +from ...types.expense_report import ExpenseReport +from ...types.expense_report_request import ExpenseReportRequest +from ...types.expense_report_response import ExpenseReportResponse +from ...types.meta_response import MetaResponse +from ...types.paginated_expense_report_line_list import PaginatedExpenseReportLineList +from ...types.paginated_expense_report_list import PaginatedExpenseReportList +from ...types.paginated_remote_field_class_list import PaginatedRemoteFieldClassList +from .raw_client import AsyncRawExpenseReportsClient, RawExpenseReportsClient +from .types.expense_reports_lines_list_request_expand import ExpenseReportsLinesListRequestExpand +from .types.expense_reports_list_request_expand import ExpenseReportsListRequestExpand +from .types.expense_reports_retrieve_request_expand import ExpenseReportsRetrieveRequestExpand + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class ExpenseReportsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawExpenseReportsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawExpenseReportsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawExpenseReportsClient + """ + return self._raw_client + + def list( + self, + *, + company_id: typing.Optional[str] = None, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, + cursor: typing.Optional[str] = None, + expand: typing.Optional[ExpenseReportsListRequestExpand] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_remote_fields: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, + page_size: typing.Optional[int] = None, + remote_id: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedExpenseReportList: + """ + Returns a list of `ExpenseReport` objects. + + Parameters + ---------- + company_id : typing.Optional[str] + If provided, will only return expense reports for this company. + + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + + cursor : typing.Optional[str] + The pagination cursor value. + + expand : typing.Optional[ExpenseReportsListRequestExpand] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + include_deleted_data : typing.Optional[bool] + 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/). + + include_remote_data : typing.Optional[bool] + Whether to include the original data Merge fetched from the third-party to produce these models. + + include_remote_fields : typing.Optional[bool] + Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + + include_shell_data : typing.Optional[bool] + Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + + page_size : typing.Optional[int] + Number of results to return per page. + + remote_id : typing.Optional[str] + The API provider's ID for the given object. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedExpenseReportList + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.accounting.expense_reports.list() + """ + _response = self._raw_client.list( + company_id=company_id, + created_after=created_after, + created_before=created_before, + cursor=cursor, + expand=expand, + include_deleted_data=include_deleted_data, + include_remote_data=include_remote_data, + include_remote_fields=include_remote_fields, + include_shell_data=include_shell_data, + modified_after=modified_after, + modified_before=modified_before, + page_size=page_size, + remote_id=remote_id, + request_options=request_options, + ) + return _response.data + + def create( + self, + *, + model: ExpenseReportRequest, + is_debug_mode: typing.Optional[bool] = None, + run_async: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> ExpenseReportResponse: + """ + Creates an `ExpenseReport` object with the given values. + + Parameters + ---------- + model : ExpenseReportRequest + + is_debug_mode : typing.Optional[bool] + Whether to include debug fields (such as log file links) in the response. + + run_async : typing.Optional[bool] + Whether or not third-party updates should be run asynchronously. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ExpenseReportResponse + + + Examples + -------- + from merge import Merge + from merge.resources.accounting import ExpenseReportRequest + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.accounting.expense_reports.create( + model=ExpenseReportRequest( + tracking_categories=[ + "a1b2c3d4-e5f6-4a5b-9c3d-2e1f0a9b8c7d", + "d4c3b2a1-9e8f-7g6h-5i4j-3k2l1m0n9o8p", + ], + ), + ) + """ + _response = self._raw_client.create( + model=model, is_debug_mode=is_debug_mode, run_async=run_async, request_options=request_options + ) + return _response.data + + def lines_list( + self, + expense_report_id: str, + *, + cursor: typing.Optional[str] = None, + expand: typing.Optional[ExpenseReportsLinesListRequestExpand] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_remote_fields: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + page_size: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedExpenseReportLineList: + """ + Returns a list of `ExpenseReportLine` objects that point to a `ExpenseReport` with the given id. + + Parameters + ---------- + expense_report_id : str + + cursor : typing.Optional[str] + The pagination cursor value. + + expand : typing.Optional[ExpenseReportsLinesListRequestExpand] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + include_deleted_data : typing.Optional[bool] + 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/). + + include_remote_data : typing.Optional[bool] + Whether to include the original data Merge fetched from the third-party to produce these models. + + include_remote_fields : typing.Optional[bool] + Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + + include_shell_data : typing.Optional[bool] + Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + + page_size : typing.Optional[int] + Number of results to return per page. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedExpenseReportLineList + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.accounting.expense_reports.lines_list( + expense_report_id="expense_report_id", + ) + """ + _response = self._raw_client.lines_list( + expense_report_id, + cursor=cursor, + expand=expand, + include_deleted_data=include_deleted_data, + include_remote_data=include_remote_data, + include_remote_fields=include_remote_fields, + include_shell_data=include_shell_data, + page_size=page_size, + request_options=request_options, + ) + return _response.data + + def retrieve( + self, + id: str, + *, + expand: typing.Optional[ExpenseReportsRetrieveRequestExpand] = None, + include_remote_data: typing.Optional[bool] = None, + include_remote_fields: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> ExpenseReport: + """ + Returns an `ExpenseReport` object with the given `id`. + + Parameters + ---------- + id : str + + expand : typing.Optional[ExpenseReportsRetrieveRequestExpand] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + include_remote_data : typing.Optional[bool] + Whether to include the original data Merge fetched from the third-party to produce these models. + + include_remote_fields : typing.Optional[bool] + Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + + include_shell_data : typing.Optional[bool] + Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ExpenseReport + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.accounting.expense_reports.retrieve( + id="id", + ) + """ + _response = self._raw_client.retrieve( + id, + expand=expand, + include_remote_data=include_remote_data, + include_remote_fields=include_remote_fields, + include_shell_data=include_shell_data, + request_options=request_options, + ) + return _response.data + + def lines_remote_field_classes_list( + self, + *, + cursor: typing.Optional[str] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + is_common_model_field: typing.Optional[bool] = None, + is_custom: typing.Optional[bool] = None, + page_size: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedRemoteFieldClassList: + """ + Returns a list of `RemoteFieldClass` objects. + + Parameters + ---------- + cursor : typing.Optional[str] + The pagination cursor value. + + include_deleted_data : typing.Optional[bool] + 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/). + + include_remote_data : typing.Optional[bool] + Whether to include the original data Merge fetched from the third-party to produce these models. + + include_shell_data : typing.Optional[bool] + Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + + is_common_model_field : typing.Optional[bool] + If provided, will only return remote field classes with this is_common_model_field value + + is_custom : typing.Optional[bool] + If provided, will only return remote fields classes with this is_custom value + + page_size : typing.Optional[int] + Number of results to return per page. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedRemoteFieldClassList + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.accounting.expense_reports.lines_remote_field_classes_list() + """ + _response = self._raw_client.lines_remote_field_classes_list( + cursor=cursor, + include_deleted_data=include_deleted_data, + include_remote_data=include_remote_data, + include_shell_data=include_shell_data, + is_common_model_field=is_common_model_field, + is_custom=is_custom, + page_size=page_size, + request_options=request_options, + ) + return _response.data + + def meta_post_retrieve(self, *, request_options: typing.Optional[RequestOptions] = None) -> MetaResponse: + """ + Returns metadata for `ExpenseReport` POSTs. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + MetaResponse + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.accounting.expense_reports.meta_post_retrieve() + """ + _response = self._raw_client.meta_post_retrieve(request_options=request_options) + return _response.data + + def remote_field_classes_list( + self, + *, + cursor: typing.Optional[str] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + is_common_model_field: typing.Optional[bool] = None, + is_custom: typing.Optional[bool] = None, + page_size: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedRemoteFieldClassList: + """ + Returns a list of `RemoteFieldClass` objects. + + Parameters + ---------- + cursor : typing.Optional[str] + The pagination cursor value. + + include_deleted_data : typing.Optional[bool] + 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/). + + include_remote_data : typing.Optional[bool] + Whether to include the original data Merge fetched from the third-party to produce these models. + + include_shell_data : typing.Optional[bool] + Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + + is_common_model_field : typing.Optional[bool] + If provided, will only return remote field classes with this is_common_model_field value + + is_custom : typing.Optional[bool] + If provided, will only return remote fields classes with this is_custom value + + page_size : typing.Optional[int] + Number of results to return per page. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedRemoteFieldClassList + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.accounting.expense_reports.remote_field_classes_list() + """ + _response = self._raw_client.remote_field_classes_list( + cursor=cursor, + include_deleted_data=include_deleted_data, + include_remote_data=include_remote_data, + include_shell_data=include_shell_data, + is_common_model_field=is_common_model_field, + is_custom=is_custom, + page_size=page_size, + request_options=request_options, + ) + return _response.data + + +class AsyncExpenseReportsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawExpenseReportsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawExpenseReportsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawExpenseReportsClient + """ + return self._raw_client + + async def list( + self, + *, + company_id: typing.Optional[str] = None, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, + cursor: typing.Optional[str] = None, + expand: typing.Optional[ExpenseReportsListRequestExpand] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_remote_fields: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, + page_size: typing.Optional[int] = None, + remote_id: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedExpenseReportList: + """ + Returns a list of `ExpenseReport` objects. + + Parameters + ---------- + company_id : typing.Optional[str] + If provided, will only return expense reports for this company. + + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + + cursor : typing.Optional[str] + The pagination cursor value. + + expand : typing.Optional[ExpenseReportsListRequestExpand] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + include_deleted_data : typing.Optional[bool] + 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/). + + include_remote_data : typing.Optional[bool] + Whether to include the original data Merge fetched from the third-party to produce these models. + + include_remote_fields : typing.Optional[bool] + Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + + include_shell_data : typing.Optional[bool] + Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + + page_size : typing.Optional[int] + Number of results to return per page. + + remote_id : typing.Optional[str] + The API provider's ID for the given object. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedExpenseReportList + + + Examples + -------- + import asyncio + + from merge import AsyncMerge + + client = AsyncMerge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.accounting.expense_reports.list() + + + asyncio.run(main()) + """ + _response = await self._raw_client.list( + company_id=company_id, + created_after=created_after, + created_before=created_before, + cursor=cursor, + expand=expand, + include_deleted_data=include_deleted_data, + include_remote_data=include_remote_data, + include_remote_fields=include_remote_fields, + include_shell_data=include_shell_data, + modified_after=modified_after, + modified_before=modified_before, + page_size=page_size, + remote_id=remote_id, + request_options=request_options, + ) + return _response.data + + async def create( + self, + *, + model: ExpenseReportRequest, + is_debug_mode: typing.Optional[bool] = None, + run_async: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> ExpenseReportResponse: + """ + Creates an `ExpenseReport` object with the given values. + + Parameters + ---------- + model : ExpenseReportRequest + + is_debug_mode : typing.Optional[bool] + Whether to include debug fields (such as log file links) in the response. + + run_async : typing.Optional[bool] + Whether or not third-party updates should be run asynchronously. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ExpenseReportResponse + + + Examples + -------- + import asyncio + + from merge import AsyncMerge + from merge.resources.accounting import ExpenseReportRequest + + client = AsyncMerge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.accounting.expense_reports.create( + model=ExpenseReportRequest( + tracking_categories=[ + "a1b2c3d4-e5f6-4a5b-9c3d-2e1f0a9b8c7d", + "d4c3b2a1-9e8f-7g6h-5i4j-3k2l1m0n9o8p", + ], + ), + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.create( + model=model, is_debug_mode=is_debug_mode, run_async=run_async, request_options=request_options + ) + return _response.data + + async def lines_list( + self, + expense_report_id: str, + *, + cursor: typing.Optional[str] = None, + expand: typing.Optional[ExpenseReportsLinesListRequestExpand] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_remote_fields: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + page_size: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedExpenseReportLineList: + """ + Returns a list of `ExpenseReportLine` objects that point to a `ExpenseReport` with the given id. + + Parameters + ---------- + expense_report_id : str + + cursor : typing.Optional[str] + The pagination cursor value. + + expand : typing.Optional[ExpenseReportsLinesListRequestExpand] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + include_deleted_data : typing.Optional[bool] + 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/). + + include_remote_data : typing.Optional[bool] + Whether to include the original data Merge fetched from the third-party to produce these models. + + include_remote_fields : typing.Optional[bool] + Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + + include_shell_data : typing.Optional[bool] + Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + + page_size : typing.Optional[int] + Number of results to return per page. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedExpenseReportLineList + + + Examples + -------- + import asyncio + + from merge import AsyncMerge + + client = AsyncMerge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.accounting.expense_reports.lines_list( + expense_report_id="expense_report_id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.lines_list( + expense_report_id, + cursor=cursor, + expand=expand, + include_deleted_data=include_deleted_data, + include_remote_data=include_remote_data, + include_remote_fields=include_remote_fields, + include_shell_data=include_shell_data, + page_size=page_size, + request_options=request_options, + ) + return _response.data + + async def retrieve( + self, + id: str, + *, + expand: typing.Optional[ExpenseReportsRetrieveRequestExpand] = None, + include_remote_data: typing.Optional[bool] = None, + include_remote_fields: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> ExpenseReport: + """ + Returns an `ExpenseReport` object with the given `id`. + + Parameters + ---------- + id : str + + expand : typing.Optional[ExpenseReportsRetrieveRequestExpand] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + include_remote_data : typing.Optional[bool] + Whether to include the original data Merge fetched from the third-party to produce these models. + + include_remote_fields : typing.Optional[bool] + Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + + include_shell_data : typing.Optional[bool] + Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ExpenseReport + + + Examples + -------- + import asyncio + + from merge import AsyncMerge + + client = AsyncMerge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.accounting.expense_reports.retrieve( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.retrieve( + id, + expand=expand, + include_remote_data=include_remote_data, + include_remote_fields=include_remote_fields, + include_shell_data=include_shell_data, + request_options=request_options, + ) + return _response.data + + async def lines_remote_field_classes_list( + self, + *, + cursor: typing.Optional[str] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + is_common_model_field: typing.Optional[bool] = None, + is_custom: typing.Optional[bool] = None, + page_size: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedRemoteFieldClassList: + """ + Returns a list of `RemoteFieldClass` objects. + + Parameters + ---------- + cursor : typing.Optional[str] + The pagination cursor value. + + include_deleted_data : typing.Optional[bool] + 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/). + + include_remote_data : typing.Optional[bool] + Whether to include the original data Merge fetched from the third-party to produce these models. + + include_shell_data : typing.Optional[bool] + Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + + is_common_model_field : typing.Optional[bool] + If provided, will only return remote field classes with this is_common_model_field value + + is_custom : typing.Optional[bool] + If provided, will only return remote fields classes with this is_custom value + + page_size : typing.Optional[int] + Number of results to return per page. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedRemoteFieldClassList + + + Examples + -------- + import asyncio + + from merge import AsyncMerge + + client = AsyncMerge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.accounting.expense_reports.lines_remote_field_classes_list() + + + asyncio.run(main()) + """ + _response = await self._raw_client.lines_remote_field_classes_list( + cursor=cursor, + include_deleted_data=include_deleted_data, + include_remote_data=include_remote_data, + include_shell_data=include_shell_data, + is_common_model_field=is_common_model_field, + is_custom=is_custom, + page_size=page_size, + request_options=request_options, + ) + return _response.data + + async def meta_post_retrieve(self, *, request_options: typing.Optional[RequestOptions] = None) -> MetaResponse: + """ + Returns metadata for `ExpenseReport` POSTs. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + MetaResponse + + + Examples + -------- + import asyncio + + from merge import AsyncMerge + + client = AsyncMerge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.accounting.expense_reports.meta_post_retrieve() + + + asyncio.run(main()) + """ + _response = await self._raw_client.meta_post_retrieve(request_options=request_options) + return _response.data + + async def remote_field_classes_list( + self, + *, + cursor: typing.Optional[str] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + is_common_model_field: typing.Optional[bool] = None, + is_custom: typing.Optional[bool] = None, + page_size: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedRemoteFieldClassList: + """ + Returns a list of `RemoteFieldClass` objects. + + Parameters + ---------- + cursor : typing.Optional[str] + The pagination cursor value. + + include_deleted_data : typing.Optional[bool] + 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/). + + include_remote_data : typing.Optional[bool] + Whether to include the original data Merge fetched from the third-party to produce these models. + + include_shell_data : typing.Optional[bool] + Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + + is_common_model_field : typing.Optional[bool] + If provided, will only return remote field classes with this is_common_model_field value + + is_custom : typing.Optional[bool] + If provided, will only return remote fields classes with this is_custom value + + page_size : typing.Optional[int] + Number of results to return per page. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedRemoteFieldClassList + + + Examples + -------- + import asyncio + + from merge import AsyncMerge + + client = AsyncMerge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.accounting.expense_reports.remote_field_classes_list() + + + asyncio.run(main()) + """ + _response = await self._raw_client.remote_field_classes_list( + cursor=cursor, + include_deleted_data=include_deleted_data, + include_remote_data=include_remote_data, + include_shell_data=include_shell_data, + is_common_model_field=is_common_model_field, + is_custom=is_custom, + page_size=page_size, + request_options=request_options, + ) + return _response.data diff --git a/src/merge/resources/accounting/resources/expense_reports/raw_client.py b/src/merge/resources/accounting/resources/expense_reports/raw_client.py new file mode 100644 index 00000000..58bfec92 --- /dev/null +++ b/src/merge/resources/accounting/resources/expense_reports/raw_client.py @@ -0,0 +1,1020 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.datetime_utils import serialize_datetime +from .....core.http_response import AsyncHttpResponse, HttpResponse +from .....core.jsonable_encoder import jsonable_encoder +from .....core.request_options import RequestOptions +from .....core.unchecked_base_model import construct_type +from ...types.expense_report import ExpenseReport +from ...types.expense_report_request import ExpenseReportRequest +from ...types.expense_report_response import ExpenseReportResponse +from ...types.meta_response import MetaResponse +from ...types.paginated_expense_report_line_list import PaginatedExpenseReportLineList +from ...types.paginated_expense_report_list import PaginatedExpenseReportList +from ...types.paginated_remote_field_class_list import PaginatedRemoteFieldClassList +from .types.expense_reports_lines_list_request_expand import ExpenseReportsLinesListRequestExpand +from .types.expense_reports_list_request_expand import ExpenseReportsListRequestExpand +from .types.expense_reports_retrieve_request_expand import ExpenseReportsRetrieveRequestExpand + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class RawExpenseReportsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, + *, + company_id: typing.Optional[str] = None, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, + cursor: typing.Optional[str] = None, + expand: typing.Optional[ExpenseReportsListRequestExpand] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_remote_fields: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, + page_size: typing.Optional[int] = None, + remote_id: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[PaginatedExpenseReportList]: + """ + Returns a list of `ExpenseReport` objects. + + Parameters + ---------- + company_id : typing.Optional[str] + If provided, will only return expense reports for this company. + + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + + cursor : typing.Optional[str] + The pagination cursor value. + + expand : typing.Optional[ExpenseReportsListRequestExpand] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + include_deleted_data : typing.Optional[bool] + 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/). + + include_remote_data : typing.Optional[bool] + Whether to include the original data Merge fetched from the third-party to produce these models. + + include_remote_fields : typing.Optional[bool] + Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + + include_shell_data : typing.Optional[bool] + Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + + page_size : typing.Optional[int] + Number of results to return per page. + + remote_id : typing.Optional[str] + The API provider's ID for the given object. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[PaginatedExpenseReportList] + + """ + _response = self._client_wrapper.httpx_client.request( + "accounting/v1/expense-reports", + method="GET", + params={ + "company_id": company_id, + "created_after": serialize_datetime(created_after) if created_after is not None else None, + "created_before": serialize_datetime(created_before) if created_before is not None else None, + "cursor": cursor, + "expand": expand, + "include_deleted_data": include_deleted_data, + "include_remote_data": include_remote_data, + "include_remote_fields": include_remote_fields, + "include_shell_data": include_shell_data, + "modified_after": serialize_datetime(modified_after) if modified_after is not None else None, + "modified_before": serialize_datetime(modified_before) if modified_before is not None else None, + "page_size": page_size, + "remote_id": remote_id, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedExpenseReportList, + construct_type( + type_=PaginatedExpenseReportList, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def create( + self, + *, + model: ExpenseReportRequest, + is_debug_mode: typing.Optional[bool] = None, + run_async: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[ExpenseReportResponse]: + """ + Creates an `ExpenseReport` object with the given values. + + Parameters + ---------- + model : ExpenseReportRequest + + is_debug_mode : typing.Optional[bool] + Whether to include debug fields (such as log file links) in the response. + + run_async : typing.Optional[bool] + Whether or not third-party updates should be run asynchronously. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[ExpenseReportResponse] + + """ + _response = self._client_wrapper.httpx_client.request( + "accounting/v1/expense-reports", + method="POST", + params={ + "is_debug_mode": is_debug_mode, + "run_async": run_async, + }, + json={ + "model": model, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ExpenseReportResponse, + construct_type( + type_=ExpenseReportResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def lines_list( + self, + expense_report_id: str, + *, + cursor: typing.Optional[str] = None, + expand: typing.Optional[ExpenseReportsLinesListRequestExpand] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_remote_fields: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + page_size: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[PaginatedExpenseReportLineList]: + """ + Returns a list of `ExpenseReportLine` objects that point to a `ExpenseReport` with the given id. + + Parameters + ---------- + expense_report_id : str + + cursor : typing.Optional[str] + The pagination cursor value. + + expand : typing.Optional[ExpenseReportsLinesListRequestExpand] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + include_deleted_data : typing.Optional[bool] + 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/). + + include_remote_data : typing.Optional[bool] + Whether to include the original data Merge fetched from the third-party to produce these models. + + include_remote_fields : typing.Optional[bool] + Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + + include_shell_data : typing.Optional[bool] + Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + + page_size : typing.Optional[int] + Number of results to return per page. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[PaginatedExpenseReportLineList] + + """ + _response = self._client_wrapper.httpx_client.request( + f"accounting/v1/expense-reports/{jsonable_encoder(expense_report_id)}/lines", + method="GET", + params={ + "cursor": cursor, + "expand": expand, + "include_deleted_data": include_deleted_data, + "include_remote_data": include_remote_data, + "include_remote_fields": include_remote_fields, + "include_shell_data": include_shell_data, + "page_size": page_size, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedExpenseReportLineList, + construct_type( + type_=PaginatedExpenseReportLineList, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def retrieve( + self, + id: str, + *, + expand: typing.Optional[ExpenseReportsRetrieveRequestExpand] = None, + include_remote_data: typing.Optional[bool] = None, + include_remote_fields: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[ExpenseReport]: + """ + Returns an `ExpenseReport` object with the given `id`. + + Parameters + ---------- + id : str + + expand : typing.Optional[ExpenseReportsRetrieveRequestExpand] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + include_remote_data : typing.Optional[bool] + Whether to include the original data Merge fetched from the third-party to produce these models. + + include_remote_fields : typing.Optional[bool] + Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + + include_shell_data : typing.Optional[bool] + Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[ExpenseReport] + + """ + _response = self._client_wrapper.httpx_client.request( + f"accounting/v1/expense-reports/{jsonable_encoder(id)}", + method="GET", + params={ + "expand": expand, + "include_remote_data": include_remote_data, + "include_remote_fields": include_remote_fields, + "include_shell_data": include_shell_data, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ExpenseReport, + construct_type( + type_=ExpenseReport, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def lines_remote_field_classes_list( + self, + *, + cursor: typing.Optional[str] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + is_common_model_field: typing.Optional[bool] = None, + is_custom: typing.Optional[bool] = None, + page_size: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[PaginatedRemoteFieldClassList]: + """ + Returns a list of `RemoteFieldClass` objects. + + Parameters + ---------- + cursor : typing.Optional[str] + The pagination cursor value. + + include_deleted_data : typing.Optional[bool] + 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/). + + include_remote_data : typing.Optional[bool] + Whether to include the original data Merge fetched from the third-party to produce these models. + + include_shell_data : typing.Optional[bool] + Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + + is_common_model_field : typing.Optional[bool] + If provided, will only return remote field classes with this is_common_model_field value + + is_custom : typing.Optional[bool] + If provided, will only return remote fields classes with this is_custom value + + page_size : typing.Optional[int] + Number of results to return per page. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[PaginatedRemoteFieldClassList] + + """ + _response = self._client_wrapper.httpx_client.request( + "accounting/v1/expense-reports/lines/remote-field-classes", + method="GET", + params={ + "cursor": cursor, + "include_deleted_data": include_deleted_data, + "include_remote_data": include_remote_data, + "include_shell_data": include_shell_data, + "is_common_model_field": is_common_model_field, + "is_custom": is_custom, + "page_size": page_size, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedRemoteFieldClassList, + construct_type( + type_=PaginatedRemoteFieldClassList, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def meta_post_retrieve( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[MetaResponse]: + """ + Returns metadata for `ExpenseReport` POSTs. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[MetaResponse] + + """ + _response = self._client_wrapper.httpx_client.request( + "accounting/v1/expense-reports/meta/post", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + MetaResponse, + construct_type( + type_=MetaResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def remote_field_classes_list( + self, + *, + cursor: typing.Optional[str] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + is_common_model_field: typing.Optional[bool] = None, + is_custom: typing.Optional[bool] = None, + page_size: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[PaginatedRemoteFieldClassList]: + """ + Returns a list of `RemoteFieldClass` objects. + + Parameters + ---------- + cursor : typing.Optional[str] + The pagination cursor value. + + include_deleted_data : typing.Optional[bool] + 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/). + + include_remote_data : typing.Optional[bool] + Whether to include the original data Merge fetched from the third-party to produce these models. + + include_shell_data : typing.Optional[bool] + Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + + is_common_model_field : typing.Optional[bool] + If provided, will only return remote field classes with this is_common_model_field value + + is_custom : typing.Optional[bool] + If provided, will only return remote fields classes with this is_custom value + + page_size : typing.Optional[int] + Number of results to return per page. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[PaginatedRemoteFieldClassList] + + """ + _response = self._client_wrapper.httpx_client.request( + "accounting/v1/expense-reports/remote-field-classes", + method="GET", + params={ + "cursor": cursor, + "include_deleted_data": include_deleted_data, + "include_remote_data": include_remote_data, + "include_shell_data": include_shell_data, + "is_common_model_field": is_common_model_field, + "is_custom": is_custom, + "page_size": page_size, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedRemoteFieldClassList, + construct_type( + type_=PaginatedRemoteFieldClassList, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + +class AsyncRawExpenseReportsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, + *, + company_id: typing.Optional[str] = None, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, + cursor: typing.Optional[str] = None, + expand: typing.Optional[ExpenseReportsListRequestExpand] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_remote_fields: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, + page_size: typing.Optional[int] = None, + remote_id: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[PaginatedExpenseReportList]: + """ + Returns a list of `ExpenseReport` objects. + + Parameters + ---------- + company_id : typing.Optional[str] + If provided, will only return expense reports for this company. + + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + + cursor : typing.Optional[str] + The pagination cursor value. + + expand : typing.Optional[ExpenseReportsListRequestExpand] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + include_deleted_data : typing.Optional[bool] + 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/). + + include_remote_data : typing.Optional[bool] + Whether to include the original data Merge fetched from the third-party to produce these models. + + include_remote_fields : typing.Optional[bool] + Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + + include_shell_data : typing.Optional[bool] + Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + + page_size : typing.Optional[int] + Number of results to return per page. + + remote_id : typing.Optional[str] + The API provider's ID for the given object. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[PaginatedExpenseReportList] + + """ + _response = await self._client_wrapper.httpx_client.request( + "accounting/v1/expense-reports", + method="GET", + params={ + "company_id": company_id, + "created_after": serialize_datetime(created_after) if created_after is not None else None, + "created_before": serialize_datetime(created_before) if created_before is not None else None, + "cursor": cursor, + "expand": expand, + "include_deleted_data": include_deleted_data, + "include_remote_data": include_remote_data, + "include_remote_fields": include_remote_fields, + "include_shell_data": include_shell_data, + "modified_after": serialize_datetime(modified_after) if modified_after is not None else None, + "modified_before": serialize_datetime(modified_before) if modified_before is not None else None, + "page_size": page_size, + "remote_id": remote_id, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedExpenseReportList, + construct_type( + type_=PaginatedExpenseReportList, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def create( + self, + *, + model: ExpenseReportRequest, + is_debug_mode: typing.Optional[bool] = None, + run_async: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[ExpenseReportResponse]: + """ + Creates an `ExpenseReport` object with the given values. + + Parameters + ---------- + model : ExpenseReportRequest + + is_debug_mode : typing.Optional[bool] + Whether to include debug fields (such as log file links) in the response. + + run_async : typing.Optional[bool] + Whether or not third-party updates should be run asynchronously. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[ExpenseReportResponse] + + """ + _response = await self._client_wrapper.httpx_client.request( + "accounting/v1/expense-reports", + method="POST", + params={ + "is_debug_mode": is_debug_mode, + "run_async": run_async, + }, + json={ + "model": model, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ExpenseReportResponse, + construct_type( + type_=ExpenseReportResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def lines_list( + self, + expense_report_id: str, + *, + cursor: typing.Optional[str] = None, + expand: typing.Optional[ExpenseReportsLinesListRequestExpand] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_remote_fields: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + page_size: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[PaginatedExpenseReportLineList]: + """ + Returns a list of `ExpenseReportLine` objects that point to a `ExpenseReport` with the given id. + + Parameters + ---------- + expense_report_id : str + + cursor : typing.Optional[str] + The pagination cursor value. + + expand : typing.Optional[ExpenseReportsLinesListRequestExpand] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + include_deleted_data : typing.Optional[bool] + 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/). + + include_remote_data : typing.Optional[bool] + Whether to include the original data Merge fetched from the third-party to produce these models. + + include_remote_fields : typing.Optional[bool] + Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + + include_shell_data : typing.Optional[bool] + Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + + page_size : typing.Optional[int] + Number of results to return per page. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[PaginatedExpenseReportLineList] + + """ + _response = await self._client_wrapper.httpx_client.request( + f"accounting/v1/expense-reports/{jsonable_encoder(expense_report_id)}/lines", + method="GET", + params={ + "cursor": cursor, + "expand": expand, + "include_deleted_data": include_deleted_data, + "include_remote_data": include_remote_data, + "include_remote_fields": include_remote_fields, + "include_shell_data": include_shell_data, + "page_size": page_size, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedExpenseReportLineList, + construct_type( + type_=PaginatedExpenseReportLineList, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def retrieve( + self, + id: str, + *, + expand: typing.Optional[ExpenseReportsRetrieveRequestExpand] = None, + include_remote_data: typing.Optional[bool] = None, + include_remote_fields: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[ExpenseReport]: + """ + Returns an `ExpenseReport` object with the given `id`. + + Parameters + ---------- + id : str + + expand : typing.Optional[ExpenseReportsRetrieveRequestExpand] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + include_remote_data : typing.Optional[bool] + Whether to include the original data Merge fetched from the third-party to produce these models. + + include_remote_fields : typing.Optional[bool] + Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + + include_shell_data : typing.Optional[bool] + Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[ExpenseReport] + + """ + _response = await self._client_wrapper.httpx_client.request( + f"accounting/v1/expense-reports/{jsonable_encoder(id)}", + method="GET", + params={ + "expand": expand, + "include_remote_data": include_remote_data, + "include_remote_fields": include_remote_fields, + "include_shell_data": include_shell_data, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ExpenseReport, + construct_type( + type_=ExpenseReport, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def lines_remote_field_classes_list( + self, + *, + cursor: typing.Optional[str] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + is_common_model_field: typing.Optional[bool] = None, + is_custom: typing.Optional[bool] = None, + page_size: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[PaginatedRemoteFieldClassList]: + """ + Returns a list of `RemoteFieldClass` objects. + + Parameters + ---------- + cursor : typing.Optional[str] + The pagination cursor value. + + include_deleted_data : typing.Optional[bool] + 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/). + + include_remote_data : typing.Optional[bool] + Whether to include the original data Merge fetched from the third-party to produce these models. + + include_shell_data : typing.Optional[bool] + Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + + is_common_model_field : typing.Optional[bool] + If provided, will only return remote field classes with this is_common_model_field value + + is_custom : typing.Optional[bool] + If provided, will only return remote fields classes with this is_custom value + + page_size : typing.Optional[int] + Number of results to return per page. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[PaginatedRemoteFieldClassList] + + """ + _response = await self._client_wrapper.httpx_client.request( + "accounting/v1/expense-reports/lines/remote-field-classes", + method="GET", + params={ + "cursor": cursor, + "include_deleted_data": include_deleted_data, + "include_remote_data": include_remote_data, + "include_shell_data": include_shell_data, + "is_common_model_field": is_common_model_field, + "is_custom": is_custom, + "page_size": page_size, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedRemoteFieldClassList, + construct_type( + type_=PaginatedRemoteFieldClassList, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def meta_post_retrieve( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[MetaResponse]: + """ + Returns metadata for `ExpenseReport` POSTs. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[MetaResponse] + + """ + _response = await self._client_wrapper.httpx_client.request( + "accounting/v1/expense-reports/meta/post", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + MetaResponse, + construct_type( + type_=MetaResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def remote_field_classes_list( + self, + *, + cursor: typing.Optional[str] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + is_common_model_field: typing.Optional[bool] = None, + is_custom: typing.Optional[bool] = None, + page_size: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[PaginatedRemoteFieldClassList]: + """ + Returns a list of `RemoteFieldClass` objects. + + Parameters + ---------- + cursor : typing.Optional[str] + The pagination cursor value. + + include_deleted_data : typing.Optional[bool] + 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/). + + include_remote_data : typing.Optional[bool] + Whether to include the original data Merge fetched from the third-party to produce these models. + + include_shell_data : typing.Optional[bool] + Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + + is_common_model_field : typing.Optional[bool] + If provided, will only return remote field classes with this is_common_model_field value + + is_custom : typing.Optional[bool] + If provided, will only return remote fields classes with this is_custom value + + page_size : typing.Optional[int] + Number of results to return per page. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[PaginatedRemoteFieldClassList] + + """ + _response = await self._client_wrapper.httpx_client.request( + "accounting/v1/expense-reports/remote-field-classes", + method="GET", + params={ + "cursor": cursor, + "include_deleted_data": include_deleted_data, + "include_remote_data": include_remote_data, + "include_shell_data": include_shell_data, + "is_common_model_field": is_common_model_field, + "is_custom": is_custom, + "page_size": page_size, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedRemoteFieldClassList, + construct_type( + type_=PaginatedRemoteFieldClassList, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/merge/resources/accounting/resources/expense_reports/types/__init__.py b/src/merge/resources/accounting/resources/expense_reports/types/__init__.py new file mode 100644 index 00000000..2d22b4c5 --- /dev/null +++ b/src/merge/resources/accounting/resources/expense_reports/types/__init__.py @@ -0,0 +1,13 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +from .expense_reports_lines_list_request_expand import ExpenseReportsLinesListRequestExpand +from .expense_reports_list_request_expand import ExpenseReportsListRequestExpand +from .expense_reports_retrieve_request_expand import ExpenseReportsRetrieveRequestExpand + +__all__ = [ + "ExpenseReportsLinesListRequestExpand", + "ExpenseReportsListRequestExpand", + "ExpenseReportsRetrieveRequestExpand", +] diff --git a/src/merge/resources/accounting/resources/expense_reports/types/expense_reports_lines_list_request_expand.py b/src/merge/resources/accounting/resources/expense_reports/types/expense_reports_lines_list_request_expand.py new file mode 100644 index 00000000..792c010b --- /dev/null +++ b/src/merge/resources/accounting/resources/expense_reports/types/expense_reports_lines_list_request_expand.py @@ -0,0 +1,265 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class ExpenseReportsLinesListRequestExpand(str, enum.Enum): + ACCOUNT = "account" + ACCOUNT_COMPANY = "account,company" + ACCOUNT_COMPANY_CONTACT = "account,company,contact" + ACCOUNT_COMPANY_CONTACT_TAX_RATE = "account,company,contact,tax_rate" + ACCOUNT_COMPANY_TAX_RATE = "account,company,tax_rate" + ACCOUNT_CONTACT = "account,contact" + ACCOUNT_CONTACT_TAX_RATE = "account,contact,tax_rate" + ACCOUNT_EMPLOYEE = "account,employee" + ACCOUNT_EMPLOYEE_COMPANY = "account,employee,company" + ACCOUNT_EMPLOYEE_COMPANY_CONTACT = "account,employee,company,contact" + ACCOUNT_EMPLOYEE_COMPANY_CONTACT_TAX_RATE = "account,employee,company,contact,tax_rate" + ACCOUNT_EMPLOYEE_COMPANY_TAX_RATE = "account,employee,company,tax_rate" + ACCOUNT_EMPLOYEE_CONTACT = "account,employee,contact" + ACCOUNT_EMPLOYEE_CONTACT_TAX_RATE = "account,employee,contact,tax_rate" + ACCOUNT_EMPLOYEE_PROJECT = "account,employee,project" + ACCOUNT_EMPLOYEE_PROJECT_COMPANY = "account,employee,project,company" + ACCOUNT_EMPLOYEE_PROJECT_COMPANY_CONTACT = "account,employee,project,company,contact" + ACCOUNT_EMPLOYEE_PROJECT_COMPANY_CONTACT_TAX_RATE = "account,employee,project,company,contact,tax_rate" + ACCOUNT_EMPLOYEE_PROJECT_COMPANY_TAX_RATE = "account,employee,project,company,tax_rate" + ACCOUNT_EMPLOYEE_PROJECT_CONTACT = "account,employee,project,contact" + ACCOUNT_EMPLOYEE_PROJECT_CONTACT_TAX_RATE = "account,employee,project,contact,tax_rate" + ACCOUNT_EMPLOYEE_PROJECT_TAX_RATE = "account,employee,project,tax_rate" + ACCOUNT_EMPLOYEE_TAX_RATE = "account,employee,tax_rate" + ACCOUNT_PROJECT = "account,project" + ACCOUNT_PROJECT_COMPANY = "account,project,company" + ACCOUNT_PROJECT_COMPANY_CONTACT = "account,project,company,contact" + ACCOUNT_PROJECT_COMPANY_CONTACT_TAX_RATE = "account,project,company,contact,tax_rate" + ACCOUNT_PROJECT_COMPANY_TAX_RATE = "account,project,company,tax_rate" + ACCOUNT_PROJECT_CONTACT = "account,project,contact" + ACCOUNT_PROJECT_CONTACT_TAX_RATE = "account,project,contact,tax_rate" + ACCOUNT_PROJECT_TAX_RATE = "account,project,tax_rate" + ACCOUNT_TAX_RATE = "account,tax_rate" + COMPANY = "company" + COMPANY_CONTACT = "company,contact" + COMPANY_CONTACT_TAX_RATE = "company,contact,tax_rate" + COMPANY_TAX_RATE = "company,tax_rate" + CONTACT = "contact" + CONTACT_TAX_RATE = "contact,tax_rate" + EMPLOYEE = "employee" + EMPLOYEE_COMPANY = "employee,company" + EMPLOYEE_COMPANY_CONTACT = "employee,company,contact" + EMPLOYEE_COMPANY_CONTACT_TAX_RATE = "employee,company,contact,tax_rate" + EMPLOYEE_COMPANY_TAX_RATE = "employee,company,tax_rate" + EMPLOYEE_CONTACT = "employee,contact" + EMPLOYEE_CONTACT_TAX_RATE = "employee,contact,tax_rate" + EMPLOYEE_PROJECT = "employee,project" + EMPLOYEE_PROJECT_COMPANY = "employee,project,company" + EMPLOYEE_PROJECT_COMPANY_CONTACT = "employee,project,company,contact" + EMPLOYEE_PROJECT_COMPANY_CONTACT_TAX_RATE = "employee,project,company,contact,tax_rate" + EMPLOYEE_PROJECT_COMPANY_TAX_RATE = "employee,project,company,tax_rate" + EMPLOYEE_PROJECT_CONTACT = "employee,project,contact" + EMPLOYEE_PROJECT_CONTACT_TAX_RATE = "employee,project,contact,tax_rate" + EMPLOYEE_PROJECT_TAX_RATE = "employee,project,tax_rate" + EMPLOYEE_TAX_RATE = "employee,tax_rate" + PROJECT = "project" + PROJECT_COMPANY = "project,company" + PROJECT_COMPANY_CONTACT = "project,company,contact" + PROJECT_COMPANY_CONTACT_TAX_RATE = "project,company,contact,tax_rate" + PROJECT_COMPANY_TAX_RATE = "project,company,tax_rate" + PROJECT_CONTACT = "project,contact" + PROJECT_CONTACT_TAX_RATE = "project,contact,tax_rate" + PROJECT_TAX_RATE = "project,tax_rate" + TAX_RATE = "tax_rate" + + def visit( + self, + account: typing.Callable[[], T_Result], + account_company: typing.Callable[[], T_Result], + account_company_contact: typing.Callable[[], T_Result], + account_company_contact_tax_rate: typing.Callable[[], T_Result], + account_company_tax_rate: typing.Callable[[], T_Result], + account_contact: typing.Callable[[], T_Result], + account_contact_tax_rate: typing.Callable[[], T_Result], + account_employee: typing.Callable[[], T_Result], + account_employee_company: typing.Callable[[], T_Result], + account_employee_company_contact: typing.Callable[[], T_Result], + account_employee_company_contact_tax_rate: typing.Callable[[], T_Result], + account_employee_company_tax_rate: typing.Callable[[], T_Result], + account_employee_contact: typing.Callable[[], T_Result], + account_employee_contact_tax_rate: typing.Callable[[], T_Result], + account_employee_project: typing.Callable[[], T_Result], + account_employee_project_company: typing.Callable[[], T_Result], + account_employee_project_company_contact: typing.Callable[[], T_Result], + account_employee_project_company_contact_tax_rate: typing.Callable[[], T_Result], + account_employee_project_company_tax_rate: typing.Callable[[], T_Result], + account_employee_project_contact: typing.Callable[[], T_Result], + account_employee_project_contact_tax_rate: typing.Callable[[], T_Result], + account_employee_project_tax_rate: typing.Callable[[], T_Result], + account_employee_tax_rate: typing.Callable[[], T_Result], + account_project: typing.Callable[[], T_Result], + account_project_company: typing.Callable[[], T_Result], + account_project_company_contact: typing.Callable[[], T_Result], + account_project_company_contact_tax_rate: typing.Callable[[], T_Result], + account_project_company_tax_rate: typing.Callable[[], T_Result], + account_project_contact: typing.Callable[[], T_Result], + account_project_contact_tax_rate: typing.Callable[[], T_Result], + account_project_tax_rate: typing.Callable[[], T_Result], + account_tax_rate: typing.Callable[[], T_Result], + company: typing.Callable[[], T_Result], + company_contact: typing.Callable[[], T_Result], + company_contact_tax_rate: typing.Callable[[], T_Result], + company_tax_rate: typing.Callable[[], T_Result], + contact: typing.Callable[[], T_Result], + contact_tax_rate: typing.Callable[[], T_Result], + employee: typing.Callable[[], T_Result], + employee_company: typing.Callable[[], T_Result], + employee_company_contact: typing.Callable[[], T_Result], + employee_company_contact_tax_rate: typing.Callable[[], T_Result], + employee_company_tax_rate: typing.Callable[[], T_Result], + employee_contact: typing.Callable[[], T_Result], + employee_contact_tax_rate: typing.Callable[[], T_Result], + employee_project: typing.Callable[[], T_Result], + employee_project_company: typing.Callable[[], T_Result], + employee_project_company_contact: typing.Callable[[], T_Result], + employee_project_company_contact_tax_rate: typing.Callable[[], T_Result], + employee_project_company_tax_rate: typing.Callable[[], T_Result], + employee_project_contact: typing.Callable[[], T_Result], + employee_project_contact_tax_rate: typing.Callable[[], T_Result], + employee_project_tax_rate: typing.Callable[[], T_Result], + employee_tax_rate: typing.Callable[[], T_Result], + project: typing.Callable[[], T_Result], + project_company: typing.Callable[[], T_Result], + project_company_contact: typing.Callable[[], T_Result], + project_company_contact_tax_rate: typing.Callable[[], T_Result], + project_company_tax_rate: typing.Callable[[], T_Result], + project_contact: typing.Callable[[], T_Result], + project_contact_tax_rate: typing.Callable[[], T_Result], + project_tax_rate: typing.Callable[[], T_Result], + tax_rate: typing.Callable[[], T_Result], + ) -> T_Result: + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT: + return account() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_COMPANY: + return account_company() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_COMPANY_CONTACT: + return account_company_contact() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_COMPANY_CONTACT_TAX_RATE: + return account_company_contact_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_COMPANY_TAX_RATE: + return account_company_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_CONTACT: + return account_contact() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_CONTACT_TAX_RATE: + return account_contact_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_EMPLOYEE: + return account_employee() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_EMPLOYEE_COMPANY: + return account_employee_company() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_EMPLOYEE_COMPANY_CONTACT: + return account_employee_company_contact() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_EMPLOYEE_COMPANY_CONTACT_TAX_RATE: + return account_employee_company_contact_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_EMPLOYEE_COMPANY_TAX_RATE: + return account_employee_company_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_EMPLOYEE_CONTACT: + return account_employee_contact() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_EMPLOYEE_CONTACT_TAX_RATE: + return account_employee_contact_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_EMPLOYEE_PROJECT: + return account_employee_project() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_EMPLOYEE_PROJECT_COMPANY: + return account_employee_project_company() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_EMPLOYEE_PROJECT_COMPANY_CONTACT: + return account_employee_project_company_contact() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_EMPLOYEE_PROJECT_COMPANY_CONTACT_TAX_RATE: + return account_employee_project_company_contact_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_EMPLOYEE_PROJECT_COMPANY_TAX_RATE: + return account_employee_project_company_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_EMPLOYEE_PROJECT_CONTACT: + return account_employee_project_contact() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_EMPLOYEE_PROJECT_CONTACT_TAX_RATE: + return account_employee_project_contact_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_EMPLOYEE_PROJECT_TAX_RATE: + return account_employee_project_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_EMPLOYEE_TAX_RATE: + return account_employee_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_PROJECT: + return account_project() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_PROJECT_COMPANY: + return account_project_company() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_PROJECT_COMPANY_CONTACT: + return account_project_company_contact() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_PROJECT_COMPANY_CONTACT_TAX_RATE: + return account_project_company_contact_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_PROJECT_COMPANY_TAX_RATE: + return account_project_company_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_PROJECT_CONTACT: + return account_project_contact() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_PROJECT_CONTACT_TAX_RATE: + return account_project_contact_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_PROJECT_TAX_RATE: + return account_project_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.ACCOUNT_TAX_RATE: + return account_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.COMPANY: + return company() + if self is ExpenseReportsLinesListRequestExpand.COMPANY_CONTACT: + return company_contact() + if self is ExpenseReportsLinesListRequestExpand.COMPANY_CONTACT_TAX_RATE: + return company_contact_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.COMPANY_TAX_RATE: + return company_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.CONTACT: + return contact() + if self is ExpenseReportsLinesListRequestExpand.CONTACT_TAX_RATE: + return contact_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.EMPLOYEE: + return employee() + if self is ExpenseReportsLinesListRequestExpand.EMPLOYEE_COMPANY: + return employee_company() + if self is ExpenseReportsLinesListRequestExpand.EMPLOYEE_COMPANY_CONTACT: + return employee_company_contact() + if self is ExpenseReportsLinesListRequestExpand.EMPLOYEE_COMPANY_CONTACT_TAX_RATE: + return employee_company_contact_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.EMPLOYEE_COMPANY_TAX_RATE: + return employee_company_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.EMPLOYEE_CONTACT: + return employee_contact() + if self is ExpenseReportsLinesListRequestExpand.EMPLOYEE_CONTACT_TAX_RATE: + return employee_contact_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.EMPLOYEE_PROJECT: + return employee_project() + if self is ExpenseReportsLinesListRequestExpand.EMPLOYEE_PROJECT_COMPANY: + return employee_project_company() + if self is ExpenseReportsLinesListRequestExpand.EMPLOYEE_PROJECT_COMPANY_CONTACT: + return employee_project_company_contact() + if self is ExpenseReportsLinesListRequestExpand.EMPLOYEE_PROJECT_COMPANY_CONTACT_TAX_RATE: + return employee_project_company_contact_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.EMPLOYEE_PROJECT_COMPANY_TAX_RATE: + return employee_project_company_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.EMPLOYEE_PROJECT_CONTACT: + return employee_project_contact() + if self is ExpenseReportsLinesListRequestExpand.EMPLOYEE_PROJECT_CONTACT_TAX_RATE: + return employee_project_contact_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.EMPLOYEE_PROJECT_TAX_RATE: + return employee_project_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.EMPLOYEE_TAX_RATE: + return employee_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.PROJECT: + return project() + if self is ExpenseReportsLinesListRequestExpand.PROJECT_COMPANY: + return project_company() + if self is ExpenseReportsLinesListRequestExpand.PROJECT_COMPANY_CONTACT: + return project_company_contact() + if self is ExpenseReportsLinesListRequestExpand.PROJECT_COMPANY_CONTACT_TAX_RATE: + return project_company_contact_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.PROJECT_COMPANY_TAX_RATE: + return project_company_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.PROJECT_CONTACT: + return project_contact() + if self is ExpenseReportsLinesListRequestExpand.PROJECT_CONTACT_TAX_RATE: + return project_contact_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.PROJECT_TAX_RATE: + return project_tax_rate() + if self is ExpenseReportsLinesListRequestExpand.TAX_RATE: + return tax_rate() diff --git a/src/merge/resources/accounting/resources/expense_reports/types/expense_reports_list_request_expand.py b/src/merge/resources/accounting/resources/expense_reports/types/expense_reports_list_request_expand.py new file mode 100644 index 00000000..fa1b24ce --- /dev/null +++ b/src/merge/resources/accounting/resources/expense_reports/types/expense_reports_list_request_expand.py @@ -0,0 +1,73 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class ExpenseReportsListRequestExpand(str, enum.Enum): + ACCOUNTING_PERIOD = "accounting_period" + ACCOUNTING_PERIOD_COMPANY = "accounting_period,company" + COMPANY = "company" + EMPLOYEE = "employee" + EMPLOYEE_ACCOUNTING_PERIOD = "employee,accounting_period" + EMPLOYEE_ACCOUNTING_PERIOD_COMPANY = "employee,accounting_period,company" + EMPLOYEE_COMPANY = "employee,company" + LINES = "lines" + LINES_ACCOUNTING_PERIOD = "lines,accounting_period" + LINES_ACCOUNTING_PERIOD_COMPANY = "lines,accounting_period,company" + LINES_COMPANY = "lines,company" + LINES_EMPLOYEE = "lines,employee" + LINES_EMPLOYEE_ACCOUNTING_PERIOD = "lines,employee,accounting_period" + LINES_EMPLOYEE_ACCOUNTING_PERIOD_COMPANY = "lines,employee,accounting_period,company" + LINES_EMPLOYEE_COMPANY = "lines,employee,company" + + def visit( + self, + accounting_period: typing.Callable[[], T_Result], + accounting_period_company: typing.Callable[[], T_Result], + company: typing.Callable[[], T_Result], + employee: typing.Callable[[], T_Result], + employee_accounting_period: typing.Callable[[], T_Result], + employee_accounting_period_company: typing.Callable[[], T_Result], + employee_company: typing.Callable[[], T_Result], + lines: typing.Callable[[], T_Result], + lines_accounting_period: typing.Callable[[], T_Result], + lines_accounting_period_company: typing.Callable[[], T_Result], + lines_company: typing.Callable[[], T_Result], + lines_employee: typing.Callable[[], T_Result], + lines_employee_accounting_period: typing.Callable[[], T_Result], + lines_employee_accounting_period_company: typing.Callable[[], T_Result], + lines_employee_company: typing.Callable[[], T_Result], + ) -> T_Result: + if self is ExpenseReportsListRequestExpand.ACCOUNTING_PERIOD: + return accounting_period() + if self is ExpenseReportsListRequestExpand.ACCOUNTING_PERIOD_COMPANY: + return accounting_period_company() + if self is ExpenseReportsListRequestExpand.COMPANY: + return company() + if self is ExpenseReportsListRequestExpand.EMPLOYEE: + return employee() + if self is ExpenseReportsListRequestExpand.EMPLOYEE_ACCOUNTING_PERIOD: + return employee_accounting_period() + if self is ExpenseReportsListRequestExpand.EMPLOYEE_ACCOUNTING_PERIOD_COMPANY: + return employee_accounting_period_company() + if self is ExpenseReportsListRequestExpand.EMPLOYEE_COMPANY: + return employee_company() + if self is ExpenseReportsListRequestExpand.LINES: + return lines() + if self is ExpenseReportsListRequestExpand.LINES_ACCOUNTING_PERIOD: + return lines_accounting_period() + if self is ExpenseReportsListRequestExpand.LINES_ACCOUNTING_PERIOD_COMPANY: + return lines_accounting_period_company() + if self is ExpenseReportsListRequestExpand.LINES_COMPANY: + return lines_company() + if self is ExpenseReportsListRequestExpand.LINES_EMPLOYEE: + return lines_employee() + if self is ExpenseReportsListRequestExpand.LINES_EMPLOYEE_ACCOUNTING_PERIOD: + return lines_employee_accounting_period() + if self is ExpenseReportsListRequestExpand.LINES_EMPLOYEE_ACCOUNTING_PERIOD_COMPANY: + return lines_employee_accounting_period_company() + if self is ExpenseReportsListRequestExpand.LINES_EMPLOYEE_COMPANY: + return lines_employee_company() diff --git a/src/merge/resources/accounting/resources/expense_reports/types/expense_reports_retrieve_request_expand.py b/src/merge/resources/accounting/resources/expense_reports/types/expense_reports_retrieve_request_expand.py new file mode 100644 index 00000000..5d56c2da --- /dev/null +++ b/src/merge/resources/accounting/resources/expense_reports/types/expense_reports_retrieve_request_expand.py @@ -0,0 +1,73 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class ExpenseReportsRetrieveRequestExpand(str, enum.Enum): + ACCOUNTING_PERIOD = "accounting_period" + ACCOUNTING_PERIOD_COMPANY = "accounting_period,company" + COMPANY = "company" + EMPLOYEE = "employee" + EMPLOYEE_ACCOUNTING_PERIOD = "employee,accounting_period" + EMPLOYEE_ACCOUNTING_PERIOD_COMPANY = "employee,accounting_period,company" + EMPLOYEE_COMPANY = "employee,company" + LINES = "lines" + LINES_ACCOUNTING_PERIOD = "lines,accounting_period" + LINES_ACCOUNTING_PERIOD_COMPANY = "lines,accounting_period,company" + LINES_COMPANY = "lines,company" + LINES_EMPLOYEE = "lines,employee" + LINES_EMPLOYEE_ACCOUNTING_PERIOD = "lines,employee,accounting_period" + LINES_EMPLOYEE_ACCOUNTING_PERIOD_COMPANY = "lines,employee,accounting_period,company" + LINES_EMPLOYEE_COMPANY = "lines,employee,company" + + def visit( + self, + accounting_period: typing.Callable[[], T_Result], + accounting_period_company: typing.Callable[[], T_Result], + company: typing.Callable[[], T_Result], + employee: typing.Callable[[], T_Result], + employee_accounting_period: typing.Callable[[], T_Result], + employee_accounting_period_company: typing.Callable[[], T_Result], + employee_company: typing.Callable[[], T_Result], + lines: typing.Callable[[], T_Result], + lines_accounting_period: typing.Callable[[], T_Result], + lines_accounting_period_company: typing.Callable[[], T_Result], + lines_company: typing.Callable[[], T_Result], + lines_employee: typing.Callable[[], T_Result], + lines_employee_accounting_period: typing.Callable[[], T_Result], + lines_employee_accounting_period_company: typing.Callable[[], T_Result], + lines_employee_company: typing.Callable[[], T_Result], + ) -> T_Result: + if self is ExpenseReportsRetrieveRequestExpand.ACCOUNTING_PERIOD: + return accounting_period() + if self is ExpenseReportsRetrieveRequestExpand.ACCOUNTING_PERIOD_COMPANY: + return accounting_period_company() + if self is ExpenseReportsRetrieveRequestExpand.COMPANY: + return company() + if self is ExpenseReportsRetrieveRequestExpand.EMPLOYEE: + return employee() + if self is ExpenseReportsRetrieveRequestExpand.EMPLOYEE_ACCOUNTING_PERIOD: + return employee_accounting_period() + if self is ExpenseReportsRetrieveRequestExpand.EMPLOYEE_ACCOUNTING_PERIOD_COMPANY: + return employee_accounting_period_company() + if self is ExpenseReportsRetrieveRequestExpand.EMPLOYEE_COMPANY: + return employee_company() + if self is ExpenseReportsRetrieveRequestExpand.LINES: + return lines() + if self is ExpenseReportsRetrieveRequestExpand.LINES_ACCOUNTING_PERIOD: + return lines_accounting_period() + if self is ExpenseReportsRetrieveRequestExpand.LINES_ACCOUNTING_PERIOD_COMPANY: + return lines_accounting_period_company() + if self is ExpenseReportsRetrieveRequestExpand.LINES_COMPANY: + return lines_company() + if self is ExpenseReportsRetrieveRequestExpand.LINES_EMPLOYEE: + return lines_employee() + if self is ExpenseReportsRetrieveRequestExpand.LINES_EMPLOYEE_ACCOUNTING_PERIOD: + return lines_employee_accounting_period() + if self is ExpenseReportsRetrieveRequestExpand.LINES_EMPLOYEE_ACCOUNTING_PERIOD_COMPANY: + return lines_employee_accounting_period_company() + if self is ExpenseReportsRetrieveRequestExpand.LINES_EMPLOYEE_COMPANY: + return lines_employee_company() diff --git a/src/merge/resources/accounting/resources/projects/client.py b/src/merge/resources/accounting/resources/projects/client.py index 35cd8109..4afffa7e 100644 --- a/src/merge/resources/accounting/resources/projects/client.py +++ b/src/merge/resources/accounting/resources/projects/client.py @@ -1,5 +1,6 @@ # This file was auto-generated by Fern from our API Definition. +import datetime as dt import typing from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper @@ -29,12 +30,18 @@ def with_raw_response(self) -> RawProjectsClient: def list( self, *, + company_id: typing.Optional[str] = None, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, cursor: typing.Optional[str] = None, expand: typing.Optional[ProjectsListRequestExpand] = None, include_deleted_data: typing.Optional[bool] = None, include_remote_data: typing.Optional[bool] = None, include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, page_size: typing.Optional[int] = None, + remote_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> PaginatedProjectList: """ @@ -42,6 +49,15 @@ def list( Parameters ---------- + company_id : typing.Optional[str] + If provided, will only return projects for this company. + + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + cursor : typing.Optional[str] The pagination cursor value. @@ -57,9 +73,18 @@ def list( include_shell_data : typing.Optional[bool] Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + page_size : typing.Optional[int] Number of results to return per page. + remote_id : typing.Optional[str] + The API provider's ID for the given object. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -79,12 +104,18 @@ def list( client.accounting.projects.list() """ _response = self._raw_client.list( + company_id=company_id, + created_after=created_after, + created_before=created_before, cursor=cursor, expand=expand, include_deleted_data=include_deleted_data, include_remote_data=include_remote_data, include_shell_data=include_shell_data, + modified_after=modified_after, + modified_before=modified_before, page_size=page_size, + remote_id=remote_id, request_options=request_options, ) return _response.data @@ -162,12 +193,18 @@ def with_raw_response(self) -> AsyncRawProjectsClient: async def list( self, *, + company_id: typing.Optional[str] = None, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, cursor: typing.Optional[str] = None, expand: typing.Optional[ProjectsListRequestExpand] = None, include_deleted_data: typing.Optional[bool] = None, include_remote_data: typing.Optional[bool] = None, include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, page_size: typing.Optional[int] = None, + remote_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> PaginatedProjectList: """ @@ -175,6 +212,15 @@ async def list( Parameters ---------- + company_id : typing.Optional[str] + If provided, will only return projects for this company. + + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + cursor : typing.Optional[str] The pagination cursor value. @@ -190,9 +236,18 @@ async def list( include_shell_data : typing.Optional[bool] Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + page_size : typing.Optional[int] Number of results to return per page. + remote_id : typing.Optional[str] + The API provider's ID for the given object. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -220,12 +275,18 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.list( + company_id=company_id, + created_after=created_after, + created_before=created_before, cursor=cursor, expand=expand, include_deleted_data=include_deleted_data, include_remote_data=include_remote_data, include_shell_data=include_shell_data, + modified_after=modified_after, + modified_before=modified_before, page_size=page_size, + remote_id=remote_id, request_options=request_options, ) return _response.data diff --git a/src/merge/resources/accounting/resources/projects/raw_client.py b/src/merge/resources/accounting/resources/projects/raw_client.py index cc7e7f81..bd66cec8 100644 --- a/src/merge/resources/accounting/resources/projects/raw_client.py +++ b/src/merge/resources/accounting/resources/projects/raw_client.py @@ -1,10 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +import datetime as dt import typing from json.decoder import JSONDecodeError from .....core.api_error import ApiError from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.datetime_utils import serialize_datetime from .....core.http_response import AsyncHttpResponse, HttpResponse from .....core.jsonable_encoder import jsonable_encoder from .....core.request_options import RequestOptions @@ -22,12 +24,18 @@ def __init__(self, *, client_wrapper: SyncClientWrapper): def list( self, *, + company_id: typing.Optional[str] = None, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, cursor: typing.Optional[str] = None, expand: typing.Optional[ProjectsListRequestExpand] = None, include_deleted_data: typing.Optional[bool] = None, include_remote_data: typing.Optional[bool] = None, include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, page_size: typing.Optional[int] = None, + remote_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[PaginatedProjectList]: """ @@ -35,6 +43,15 @@ def list( Parameters ---------- + company_id : typing.Optional[str] + If provided, will only return projects for this company. + + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + cursor : typing.Optional[str] The pagination cursor value. @@ -50,9 +67,18 @@ def list( include_shell_data : typing.Optional[bool] Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + page_size : typing.Optional[int] Number of results to return per page. + remote_id : typing.Optional[str] + The API provider's ID for the given object. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -65,12 +91,18 @@ def list( "accounting/v1/projects", method="GET", params={ + "company_id": company_id, + "created_after": serialize_datetime(created_after) if created_after is not None else None, + "created_before": serialize_datetime(created_before) if created_before is not None else None, "cursor": cursor, "expand": expand, "include_deleted_data": include_deleted_data, "include_remote_data": include_remote_data, "include_shell_data": include_shell_data, + "modified_after": serialize_datetime(modified_after) if modified_after is not None else None, + "modified_before": serialize_datetime(modified_before) if modified_before is not None else None, "page_size": page_size, + "remote_id": remote_id, }, request_options=request_options, ) @@ -155,12 +187,18 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper): async def list( self, *, + company_id: typing.Optional[str] = None, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, cursor: typing.Optional[str] = None, expand: typing.Optional[ProjectsListRequestExpand] = None, include_deleted_data: typing.Optional[bool] = None, include_remote_data: typing.Optional[bool] = None, include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, page_size: typing.Optional[int] = None, + remote_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[PaginatedProjectList]: """ @@ -168,6 +206,15 @@ async def list( Parameters ---------- + company_id : typing.Optional[str] + If provided, will only return projects for this company. + + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + cursor : typing.Optional[str] The pagination cursor value. @@ -183,9 +230,18 @@ async def list( include_shell_data : typing.Optional[bool] Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + page_size : typing.Optional[int] Number of results to return per page. + remote_id : typing.Optional[str] + The API provider's ID for the given object. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -198,12 +254,18 @@ async def list( "accounting/v1/projects", method="GET", params={ + "company_id": company_id, + "created_after": serialize_datetime(created_after) if created_after is not None else None, + "created_before": serialize_datetime(created_before) if created_before is not None else None, "cursor": cursor, "expand": expand, "include_deleted_data": include_deleted_data, "include_remote_data": include_remote_data, "include_shell_data": include_shell_data, + "modified_after": serialize_datetime(modified_after) if modified_after is not None else None, + "modified_before": serialize_datetime(modified_before) if modified_before is not None else None, "page_size": page_size, + "remote_id": remote_id, }, request_options=request_options, ) diff --git a/src/merge/resources/accounting/types/__init__.py b/src/merge/resources/accounting/types/__init__.py index 2d91f7fb..ccc53eea 100644 --- a/src/merge/resources/accounting/types/__init__.py +++ b/src/merge/resources/accounting/types/__init__.py @@ -162,6 +162,29 @@ from .expense_line_request_tracking_category import ExpenseLineRequestTrackingCategory from .expense_line_tracking_categories_item import ExpenseLineTrackingCategoriesItem from .expense_line_tracking_category import ExpenseLineTrackingCategory +from .expense_report import ExpenseReport +from .expense_report_company import ExpenseReportCompany +from .expense_report_line import ExpenseReportLine +from .expense_report_line_account import ExpenseReportLineAccount +from .expense_report_line_company import ExpenseReportLineCompany +from .expense_report_line_contact import ExpenseReportLineContact +from .expense_report_line_employee import ExpenseReportLineEmployee +from .expense_report_line_project import ExpenseReportLineProject +from .expense_report_line_request import ExpenseReportLineRequest +from .expense_report_line_request_account import ExpenseReportLineRequestAccount +from .expense_report_line_request_company import ExpenseReportLineRequestCompany +from .expense_report_line_request_contact import ExpenseReportLineRequestContact +from .expense_report_line_request_employee import ExpenseReportLineRequestEmployee +from .expense_report_line_request_project import ExpenseReportLineRequestProject +from .expense_report_line_request_tax_rate import ExpenseReportLineRequestTaxRate +from .expense_report_line_tax_rate import ExpenseReportLineTaxRate +from .expense_report_request import ExpenseReportRequest +from .expense_report_request_accounting_period import ExpenseReportRequestAccountingPeriod +from .expense_report_request_company import ExpenseReportRequestCompany +from .expense_report_request_employee import ExpenseReportRequestEmployee +from .expense_report_response import ExpenseReportResponse +from .expense_report_status import ExpenseReportStatus +from .expense_report_status_enum import ExpenseReportStatusEnum from .expense_request import ExpenseRequest from .expense_request_account import ExpenseRequestAccount from .expense_request_accounting_period import ExpenseRequestAccountingPeriod @@ -278,6 +301,7 @@ from .item_sales_tax_rate import ItemSalesTaxRate from .item_schema import ItemSchema from .item_status import ItemStatus +from .item_type import ItemType from .item_type_enum import ItemTypeEnum from .journal_entry import JournalEntry from .journal_entry_accounting_period import JournalEntryAccountingPeriod @@ -332,6 +356,8 @@ from .paginated_credit_note_list import PaginatedCreditNoteList from .paginated_employee_list import PaginatedEmployeeList from .paginated_expense_list import PaginatedExpenseList +from .paginated_expense_report_line_list import PaginatedExpenseReportLineList +from .paginated_expense_report_list import PaginatedExpenseReportList from .paginated_general_ledger_transaction_list import PaginatedGeneralLedgerTransactionList from .paginated_income_statement_list import PaginatedIncomeStatementList from .paginated_invoice_list import PaginatedInvoiceList @@ -657,6 +683,29 @@ "ExpenseLineRequestTrackingCategory", "ExpenseLineTrackingCategoriesItem", "ExpenseLineTrackingCategory", + "ExpenseReport", + "ExpenseReportCompany", + "ExpenseReportLine", + "ExpenseReportLineAccount", + "ExpenseReportLineCompany", + "ExpenseReportLineContact", + "ExpenseReportLineEmployee", + "ExpenseReportLineProject", + "ExpenseReportLineRequest", + "ExpenseReportLineRequestAccount", + "ExpenseReportLineRequestCompany", + "ExpenseReportLineRequestContact", + "ExpenseReportLineRequestEmployee", + "ExpenseReportLineRequestProject", + "ExpenseReportLineRequestTaxRate", + "ExpenseReportLineTaxRate", + "ExpenseReportRequest", + "ExpenseReportRequestAccountingPeriod", + "ExpenseReportRequestCompany", + "ExpenseReportRequestEmployee", + "ExpenseReportResponse", + "ExpenseReportStatus", + "ExpenseReportStatusEnum", "ExpenseRequest", "ExpenseRequestAccount", "ExpenseRequestAccountingPeriod", @@ -769,6 +818,7 @@ "ItemSalesTaxRate", "ItemSchema", "ItemStatus", + "ItemType", "ItemTypeEnum", "JournalEntry", "JournalEntryAccountingPeriod", @@ -823,6 +873,8 @@ "PaginatedCreditNoteList", "PaginatedEmployeeList", "PaginatedExpenseList", + "PaginatedExpenseReportLineList", + "PaginatedExpenseReportList", "PaginatedGeneralLedgerTransactionList", "PaginatedIncomeStatementList", "PaginatedInvoiceList", diff --git a/src/merge/resources/accounting/types/expense_report.py b/src/merge/resources/accounting/types/expense_report.py new file mode 100644 index 00000000..9cd03e8d --- /dev/null +++ b/src/merge/resources/accounting/types/expense_report.py @@ -0,0 +1,423 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ....core.unchecked_base_model import UncheckedBaseModel +from .expense_report_company import ExpenseReportCompany +from .expense_report_line import ExpenseReportLine +from .expense_report_status import ExpenseReportStatus +from .remote_data import RemoteData +from .remote_field import RemoteField +from .transaction_currency_enum import TransactionCurrencyEnum + + +class ExpenseReport(UncheckedBaseModel): + """ + # The ExpenseReport Object + ### Description + The `ExpenseReport` object represents a collection of expenses submitted for review and reimbursement. + It includes details about the submitter, status, amounts, and associated metadata. + + ### Usage Example + Fetch from the `GET ExpenseReport` endpoint to view details of expense reports and their line items. + """ + + id: typing.Optional[str] = None + remote_id: typing.Optional[str] = pydantic.Field(default=None) + """ + The third-party API ID of the matching object. + """ + + created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The datetime that this object was created by Merge. + """ + + modified_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The datetime that this object was modified by Merge. + """ + + report_date: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The date of the expense report. + """ + + report_identifier: typing.Optional[str] = pydantic.Field(default=None) + """ + Human-readable expense report identifier. + """ + + employee: typing.Optional[str] = pydantic.Field(default=None) + """ + Identifier for the employee who submitted or is associated with the expense report + """ + + status: typing.Optional[ExpenseReportStatus] = pydantic.Field(default=None) + """ + Overall status of the expense report. One of DRAFT, SUBMITTED, APPROVED, REJECTED + + * `DRAFT` - DRAFT + * `SUBMITTED` - SUBMITTED + * `APPROVED` - APPROVED + * `REJECTED` - REJECTED + """ + + total_amount: typing.Optional[float] = pydantic.Field(default=None) + """ + Total amount of the expense report + """ + + lines: typing.Optional[typing.List[ExpenseReportLine]] = None + currency: typing.Optional[TransactionCurrencyEnum] = pydantic.Field(default=None) + """ + Currency code for the expense report + + * `XUA` - ADB Unit of Account + * `AFN` - Afghan Afghani + * `AFA` - Afghan Afghani (1927–2002) + * `ALL` - Albanian Lek + * `ALK` - Albanian Lek (1946–1965) + * `DZD` - Algerian Dinar + * `ADP` - Andorran Peseta + * `AOA` - Angolan Kwanza + * `AOK` - Angolan Kwanza (1977–1991) + * `AON` - Angolan New Kwanza (1990–2000) + * `AOR` - Angolan Readjusted Kwanza (1995–1999) + * `ARA` - Argentine Austral + * `ARS` - Argentine Peso + * `ARM` - Argentine Peso (1881–1970) + * `ARP` - Argentine Peso (1983–1985) + * `ARL` - Argentine Peso Ley (1970–1983) + * `AMD` - Armenian Dram + * `AWG` - Aruban Florin + * `AUD` - Australian Dollar + * `ATS` - Austrian Schilling + * `AZN` - Azerbaijani Manat + * `AZM` - Azerbaijani Manat (1993–2006) + * `BSD` - Bahamian Dollar + * `BHD` - Bahraini Dinar + * `BDT` - Bangladeshi Taka + * `BBD` - Barbadian Dollar + * `BYN` - Belarusian Ruble + * `BYB` - Belarusian Ruble (1994–1999) + * `BYR` - Belarusian Ruble (2000–2016) + * `BEF` - Belgian Franc + * `BEC` - Belgian Franc (convertible) + * `BEL` - Belgian Franc (financial) + * `BZD` - Belize Dollar + * `BMD` - Bermudan Dollar + * `BTN` - Bhutanese Ngultrum + * `BOB` - Bolivian Boliviano + * `BOL` - Bolivian Boliviano (1863–1963) + * `BOV` - Bolivian Mvdol + * `BOP` - Bolivian Peso + * `BAM` - Bosnia-Herzegovina Convertible Mark + * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) + * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) + * `BWP` - Botswanan Pula + * `BRC` - Brazilian Cruzado (1986–1989) + * `BRZ` - Brazilian Cruzeiro (1942–1967) + * `BRE` - Brazilian Cruzeiro (1990–1993) + * `BRR` - Brazilian Cruzeiro (1993–1994) + * `BRN` - Brazilian New Cruzado (1989–1990) + * `BRB` - Brazilian New Cruzeiro (1967–1986) + * `BRL` - Brazilian Real + * `GBP` - British Pound + * `BND` - Brunei Dollar + * `BGL` - Bulgarian Hard Lev + * `BGN` - Bulgarian Lev + * `BGO` - Bulgarian Lev (1879–1952) + * `BGM` - Bulgarian Socialist Lev + * `BUK` - Burmese Kyat + * `BIF` - Burundian Franc + * `XPF` - CFP Franc + * `KHR` - Cambodian Riel + * `CAD` - Canadian Dollar + * `CVE` - Cape Verdean Escudo + * `KYD` - Cayman Islands Dollar + * `XAF` - Central African CFA Franc + * `CLE` - Chilean Escudo + * `CLP` - Chilean Peso + * `CLF` - Chilean Unit of Account (UF) + * `CNX` - Chinese People’s Bank Dollar + * `CNY` - Chinese Yuan + * `CNH` - Chinese Yuan (offshore) + * `COP` - Colombian Peso + * `COU` - Colombian Real Value Unit + * `KMF` - Comorian Franc + * `CDF` - Congolese Franc + * `CRC` - Costa Rican Colón + * `HRD` - Croatian Dinar + * `HRK` - Croatian Kuna + * `CUC` - Cuban Convertible Peso + * `CUP` - Cuban Peso + * `CYP` - Cypriot Pound + * `CZK` - Czech Koruna + * `CSK` - Czechoslovak Hard Koruna + * `DKK` - Danish Krone + * `DJF` - Djiboutian Franc + * `DOP` - Dominican Peso + * `NLG` - Dutch Guilder + * `XCD` - East Caribbean Dollar + * `DDM` - East German Mark + * `ECS` - Ecuadorian Sucre + * `ECV` - Ecuadorian Unit of Constant Value + * `EGP` - Egyptian Pound + * `GQE` - Equatorial Guinean Ekwele + * `ERN` - Eritrean Nakfa + * `EEK` - Estonian Kroon + * `ETB` - Ethiopian Birr + * `EUR` - Euro + * `XBA` - European Composite Unit + * `XEU` - European Currency Unit + * `XBB` - European Monetary Unit + * `XBC` - European Unit of Account (XBC) + * `XBD` - European Unit of Account (XBD) + * `FKP` - Falkland Islands Pound + * `FJD` - Fijian Dollar + * `FIM` - Finnish Markka + * `FRF` - French Franc + * `XFO` - French Gold Franc + * `XFU` - French UIC-Franc + * `GMD` - Gambian Dalasi + * `GEK` - Georgian Kupon Larit + * `GEL` - Georgian Lari + * `DEM` - German Mark + * `GHS` - Ghanaian Cedi + * `GHC` - Ghanaian Cedi (1979–2007) + * `GIP` - Gibraltar Pound + * `XAU` - Gold + * `GRD` - Greek Drachma + * `GTQ` - Guatemalan Quetzal + * `GWP` - Guinea-Bissau Peso + * `GNF` - Guinean Franc + * `GNS` - Guinean Syli + * `GYD` - Guyanaese Dollar + * `HTG` - Haitian Gourde + * `HNL` - Honduran Lempira + * `HKD` - Hong Kong Dollar + * `HUF` - Hungarian Forint + * `IMP` - IMP + * `ISK` - Icelandic Króna + * `ISJ` - Icelandic Króna (1918–1981) + * `INR` - Indian Rupee + * `IDR` - Indonesian Rupiah + * `IRR` - Iranian Rial + * `IQD` - Iraqi Dinar + * `IEP` - Irish Pound + * `ILS` - Israeli New Shekel + * `ILP` - Israeli Pound + * `ILR` - Israeli Shekel (1980–1985) + * `ITL` - Italian Lira + * `JMD` - Jamaican Dollar + * `JPY` - Japanese Yen + * `JOD` - Jordanian Dinar + * `KZT` - Kazakhstani Tenge + * `KES` - Kenyan Shilling + * `KWD` - Kuwaiti Dinar + * `KGS` - Kyrgystani Som + * `LAK` - Laotian Kip + * `LVL` - Latvian Lats + * `LVR` - Latvian Ruble + * `LBP` - Lebanese Pound + * `LSL` - Lesotho Loti + * `LRD` - Liberian Dollar + * `LYD` - Libyan Dinar + * `LTL` - Lithuanian Litas + * `LTT` - Lithuanian Talonas + * `LUL` - Luxembourg Financial Franc + * `LUC` - Luxembourgian Convertible Franc + * `LUF` - Luxembourgian Franc + * `MOP` - Macanese Pataca + * `MKD` - Macedonian Denar + * `MKN` - Macedonian Denar (1992–1993) + * `MGA` - Malagasy Ariary + * `MGF` - Malagasy Franc + * `MWK` - Malawian Kwacha + * `MYR` - Malaysian Ringgit + * `MVR` - Maldivian Rufiyaa + * `MVP` - Maldivian Rupee (1947–1981) + * `MLF` - Malian Franc + * `MTL` - Maltese Lira + * `MTP` - Maltese Pound + * `MRU` - Mauritanian Ouguiya + * `MRO` - Mauritanian Ouguiya (1973–2017) + * `MUR` - Mauritian Rupee + * `MXV` - Mexican Investment Unit + * `MXN` - Mexican Peso + * `MXP` - Mexican Silver Peso (1861–1992) + * `MDC` - Moldovan Cupon + * `MDL` - Moldovan Leu + * `MCF` - Monegasque Franc + * `MNT` - Mongolian Tugrik + * `MAD` - Moroccan Dirham + * `MAF` - Moroccan Franc + * `MZE` - Mozambican Escudo + * `MZN` - Mozambican Metical + * `MZM` - Mozambican Metical (1980–2006) + * `MMK` - Myanmar Kyat + * `NAD` - Namibian Dollar + * `NPR` - Nepalese Rupee + * `ANG` - Netherlands Antillean Guilder + * `TWD` - New Taiwan Dollar + * `NZD` - New Zealand Dollar + * `NIO` - Nicaraguan Córdoba + * `NIC` - Nicaraguan Córdoba (1988–1991) + * `NGN` - Nigerian Naira + * `KPW` - North Korean Won + * `NOK` - Norwegian Krone + * `OMR` - Omani Rial + * `PKR` - Pakistani Rupee + * `XPD` - Palladium + * `PAB` - Panamanian Balboa + * `PGK` - Papua New Guinean Kina + * `PYG` - Paraguayan Guarani + * `PEI` - Peruvian Inti + * `PEN` - Peruvian Sol + * `PES` - Peruvian Sol (1863–1965) + * `PHP` - Philippine Peso + * `XPT` - Platinum + * `PLN` - Polish Zloty + * `PLZ` - Polish Zloty (1950–1995) + * `PTE` - Portuguese Escudo + * `GWE` - Portuguese Guinea Escudo + * `QAR` - Qatari Rial + * `XRE` - RINET Funds + * `RHD` - Rhodesian Dollar + * `RON` - Romanian Leu + * `ROL` - Romanian Leu (1952–2006) + * `RUB` - Russian Ruble + * `RUR` - Russian Ruble (1991–1998) + * `RWF` - Rwandan Franc + * `SVC` - Salvadoran Colón + * `WST` - Samoan Tala + * `SAR` - Saudi Riyal + * `RSD` - Serbian Dinar + * `CSD` - Serbian Dinar (2002–2006) + * `SCR` - Seychellois Rupee + * `SLL` - Sierra Leonean Leone + * `XAG` - Silver + * `SGD` - Singapore Dollar + * `SKK` - Slovak Koruna + * `SIT` - Slovenian Tolar + * `SBD` - Solomon Islands Dollar + * `SOS` - Somali Shilling + * `ZAR` - South African Rand + * `ZAL` - South African Rand (financial) + * `KRH` - South Korean Hwan (1953–1962) + * `KRW` - South Korean Won + * `KRO` - South Korean Won (1945–1953) + * `SSP` - South Sudanese Pound + * `SUR` - Soviet Rouble + * `ESP` - Spanish Peseta + * `ESA` - Spanish Peseta (A account) + * `ESB` - Spanish Peseta (convertible account) + * `XDR` - Special Drawing Rights + * `LKR` - Sri Lankan Rupee + * `SHP` - St. Helena Pound + * `XSU` - Sucre + * `SDD` - Sudanese Dinar (1992–2007) + * `SDG` - Sudanese Pound + * `SDP` - Sudanese Pound (1957–1998) + * `SRD` - Surinamese Dollar + * `SRG` - Surinamese Guilder + * `SZL` - Swazi Lilangeni + * `SEK` - Swedish Krona + * `CHF` - Swiss Franc + * `SYP` - Syrian Pound + * `STN` - São Tomé & Príncipe Dobra + * `STD` - São Tomé & Príncipe Dobra (1977–2017) + * `TVD` - TVD + * `TJR` - Tajikistani Ruble + * `TJS` - Tajikistani Somoni + * `TZS` - Tanzanian Shilling + * `XTS` - Testing Currency Code + * `THB` - Thai Baht + * `XXX` - The codes assigned for transactions where no currency is involved + * `TPE` - Timorese Escudo + * `TOP` - Tongan Paʻanga + * `TTD` - Trinidad & Tobago Dollar + * `TND` - Tunisian Dinar + * `TRY` - Turkish Lira + * `TRL` - Turkish Lira (1922–2005) + * `TMT` - Turkmenistani Manat + * `TMM` - Turkmenistani Manat (1993–2009) + * `USD` - US Dollar + * `USN` - US Dollar (Next day) + * `USS` - US Dollar (Same day) + * `UGX` - Ugandan Shilling + * `UGS` - Ugandan Shilling (1966–1987) + * `UAH` - Ukrainian Hryvnia + * `UAK` - Ukrainian Karbovanets + * `AED` - United Arab Emirates Dirham + * `UYW` - Uruguayan Nominal Wage Index Unit + * `UYU` - Uruguayan Peso + * `UYP` - Uruguayan Peso (1975–1993) + * `UYI` - Uruguayan Peso (Indexed Units) + * `UZS` - Uzbekistani Som + * `VUV` - Vanuatu Vatu + * `VES` - Venezuelan Bolívar + * `VEB` - Venezuelan Bolívar (1871–2008) + * `VEF` - Venezuelan Bolívar (2008–2018) + * `VND` - Vietnamese Dong + * `VNN` - Vietnamese Dong (1978–1985) + * `CHE` - WIR Euro + * `CHW` - WIR Franc + * `XOF` - West African CFA Franc + * `YDD` - Yemeni Dinar + * `YER` - Yemeni Rial + * `YUN` - Yugoslavian Convertible Dinar (1990–1992) + * `YUD` - Yugoslavian Hard Dinar (1966–1990) + * `YUM` - Yugoslavian New Dinar (1994–2002) + * `YUR` - Yugoslavian Reformed Dinar (1992–1993) + * `ZWN` - ZWN + * `ZRN` - Zairean New Zaire (1993–1998) + * `ZRZ` - Zairean Zaire (1971–1993) + * `ZMW` - Zambian Kwacha + * `ZMK` - Zambian Kwacha (1968–2012) + * `ZWD` - Zimbabwean Dollar (1980–2008) + * `ZWR` - Zimbabwean Dollar (2008) + * `ZWL` - Zimbabwean Dollar (2009) + """ + + description: typing.Optional[str] = pydantic.Field(default=None) + """ + A brief description or purpose for the expense report + """ + + accounting_period: typing.Optional[str] = pydantic.Field(default=None) + """ + The accounting period the report was posted in + """ + + company: typing.Optional[ExpenseReportCompany] = pydantic.Field(default=None) + """ + The subsidiary that the expense report is created in + """ + + tracking_categories: typing.List[str] = pydantic.Field() + """ + The related tracking categories associated with the expense report + """ + + remote_was_deleted: typing.Optional[bool] = pydantic.Field(default=None) + """ + 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/). + """ + + field_mappings: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None + remote_data: typing.Optional[typing.List[RemoteData]] = None + remote_fields: typing.Optional[typing.List[RemoteField]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/merge/resources/accounting/types/expense_report_company.py b/src/merge/resources/accounting/types/expense_report_company.py new file mode 100644 index 00000000..25c0a252 --- /dev/null +++ b/src/merge/resources/accounting/types/expense_report_company.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .company_info import CompanyInfo + +ExpenseReportCompany = typing.Union[str, CompanyInfo] diff --git a/src/merge/resources/accounting/types/expense_report_line.py b/src/merge/resources/accounting/types/expense_report_line.py new file mode 100644 index 00000000..a5b01dfc --- /dev/null +++ b/src/merge/resources/accounting/types/expense_report_line.py @@ -0,0 +1,441 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ....core.unchecked_base_model import UncheckedBaseModel +from .expense_report_line_account import ExpenseReportLineAccount +from .expense_report_line_company import ExpenseReportLineCompany +from .expense_report_line_contact import ExpenseReportLineContact +from .expense_report_line_employee import ExpenseReportLineEmployee +from .expense_report_line_project import ExpenseReportLineProject +from .expense_report_line_tax_rate import ExpenseReportLineTaxRate +from .remote_field import RemoteField +from .transaction_currency_enum import TransactionCurrencyEnum + + +class ExpenseReportLine(UncheckedBaseModel): + """ + # The ExpenseReportLine Object + ### Description + The `ExpenseReportLine` object represents an individual line item within an expense report, containing details about + a specific expense such as amount, description, and associated metadata. + + ### Usage Example + Fetch from the `GET ExpenseReport` endpoint and expand the lines field to view all line items in the expense report. + """ + + id: typing.Optional[str] = None + remote_id: typing.Optional[str] = pydantic.Field(default=None) + """ + The third-party API ID of the matching object. + """ + + created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The datetime that this object was created by Merge. + """ + + modified_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The datetime that this object was modified by Merge. + """ + + account: typing.Optional[ExpenseReportLineAccount] = None + description: typing.Optional[str] = pydantic.Field(default=None) + """ + Description of the individual expense. + """ + + expense_date: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The date the individual expense was incurred. + """ + + amount: typing.Optional[float] = pydantic.Field(default=None) + """ + The amount of the expense for the line item. + """ + + currency: typing.Optional[TransactionCurrencyEnum] = pydantic.Field(default=None) + """ + Currency of the expense line (if different from the report currency). + + * `XUA` - ADB Unit of Account + * `AFN` - Afghan Afghani + * `AFA` - Afghan Afghani (1927–2002) + * `ALL` - Albanian Lek + * `ALK` - Albanian Lek (1946–1965) + * `DZD` - Algerian Dinar + * `ADP` - Andorran Peseta + * `AOA` - Angolan Kwanza + * `AOK` - Angolan Kwanza (1977–1991) + * `AON` - Angolan New Kwanza (1990–2000) + * `AOR` - Angolan Readjusted Kwanza (1995–1999) + * `ARA` - Argentine Austral + * `ARS` - Argentine Peso + * `ARM` - Argentine Peso (1881–1970) + * `ARP` - Argentine Peso (1983–1985) + * `ARL` - Argentine Peso Ley (1970–1983) + * `AMD` - Armenian Dram + * `AWG` - Aruban Florin + * `AUD` - Australian Dollar + * `ATS` - Austrian Schilling + * `AZN` - Azerbaijani Manat + * `AZM` - Azerbaijani Manat (1993–2006) + * `BSD` - Bahamian Dollar + * `BHD` - Bahraini Dinar + * `BDT` - Bangladeshi Taka + * `BBD` - Barbadian Dollar + * `BYN` - Belarusian Ruble + * `BYB` - Belarusian Ruble (1994–1999) + * `BYR` - Belarusian Ruble (2000–2016) + * `BEF` - Belgian Franc + * `BEC` - Belgian Franc (convertible) + * `BEL` - Belgian Franc (financial) + * `BZD` - Belize Dollar + * `BMD` - Bermudan Dollar + * `BTN` - Bhutanese Ngultrum + * `BOB` - Bolivian Boliviano + * `BOL` - Bolivian Boliviano (1863–1963) + * `BOV` - Bolivian Mvdol + * `BOP` - Bolivian Peso + * `BAM` - Bosnia-Herzegovina Convertible Mark + * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) + * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) + * `BWP` - Botswanan Pula + * `BRC` - Brazilian Cruzado (1986–1989) + * `BRZ` - Brazilian Cruzeiro (1942–1967) + * `BRE` - Brazilian Cruzeiro (1990–1993) + * `BRR` - Brazilian Cruzeiro (1993–1994) + * `BRN` - Brazilian New Cruzado (1989–1990) + * `BRB` - Brazilian New Cruzeiro (1967–1986) + * `BRL` - Brazilian Real + * `GBP` - British Pound + * `BND` - Brunei Dollar + * `BGL` - Bulgarian Hard Lev + * `BGN` - Bulgarian Lev + * `BGO` - Bulgarian Lev (1879–1952) + * `BGM` - Bulgarian Socialist Lev + * `BUK` - Burmese Kyat + * `BIF` - Burundian Franc + * `XPF` - CFP Franc + * `KHR` - Cambodian Riel + * `CAD` - Canadian Dollar + * `CVE` - Cape Verdean Escudo + * `KYD` - Cayman Islands Dollar + * `XAF` - Central African CFA Franc + * `CLE` - Chilean Escudo + * `CLP` - Chilean Peso + * `CLF` - Chilean Unit of Account (UF) + * `CNX` - Chinese People’s Bank Dollar + * `CNY` - Chinese Yuan + * `CNH` - Chinese Yuan (offshore) + * `COP` - Colombian Peso + * `COU` - Colombian Real Value Unit + * `KMF` - Comorian Franc + * `CDF` - Congolese Franc + * `CRC` - Costa Rican Colón + * `HRD` - Croatian Dinar + * `HRK` - Croatian Kuna + * `CUC` - Cuban Convertible Peso + * `CUP` - Cuban Peso + * `CYP` - Cypriot Pound + * `CZK` - Czech Koruna + * `CSK` - Czechoslovak Hard Koruna + * `DKK` - Danish Krone + * `DJF` - Djiboutian Franc + * `DOP` - Dominican Peso + * `NLG` - Dutch Guilder + * `XCD` - East Caribbean Dollar + * `DDM` - East German Mark + * `ECS` - Ecuadorian Sucre + * `ECV` - Ecuadorian Unit of Constant Value + * `EGP` - Egyptian Pound + * `GQE` - Equatorial Guinean Ekwele + * `ERN` - Eritrean Nakfa + * `EEK` - Estonian Kroon + * `ETB` - Ethiopian Birr + * `EUR` - Euro + * `XBA` - European Composite Unit + * `XEU` - European Currency Unit + * `XBB` - European Monetary Unit + * `XBC` - European Unit of Account (XBC) + * `XBD` - European Unit of Account (XBD) + * `FKP` - Falkland Islands Pound + * `FJD` - Fijian Dollar + * `FIM` - Finnish Markka + * `FRF` - French Franc + * `XFO` - French Gold Franc + * `XFU` - French UIC-Franc + * `GMD` - Gambian Dalasi + * `GEK` - Georgian Kupon Larit + * `GEL` - Georgian Lari + * `DEM` - German Mark + * `GHS` - Ghanaian Cedi + * `GHC` - Ghanaian Cedi (1979–2007) + * `GIP` - Gibraltar Pound + * `XAU` - Gold + * `GRD` - Greek Drachma + * `GTQ` - Guatemalan Quetzal + * `GWP` - Guinea-Bissau Peso + * `GNF` - Guinean Franc + * `GNS` - Guinean Syli + * `GYD` - Guyanaese Dollar + * `HTG` - Haitian Gourde + * `HNL` - Honduran Lempira + * `HKD` - Hong Kong Dollar + * `HUF` - Hungarian Forint + * `IMP` - IMP + * `ISK` - Icelandic Króna + * `ISJ` - Icelandic Króna (1918–1981) + * `INR` - Indian Rupee + * `IDR` - Indonesian Rupiah + * `IRR` - Iranian Rial + * `IQD` - Iraqi Dinar + * `IEP` - Irish Pound + * `ILS` - Israeli New Shekel + * `ILP` - Israeli Pound + * `ILR` - Israeli Shekel (1980–1985) + * `ITL` - Italian Lira + * `JMD` - Jamaican Dollar + * `JPY` - Japanese Yen + * `JOD` - Jordanian Dinar + * `KZT` - Kazakhstani Tenge + * `KES` - Kenyan Shilling + * `KWD` - Kuwaiti Dinar + * `KGS` - Kyrgystani Som + * `LAK` - Laotian Kip + * `LVL` - Latvian Lats + * `LVR` - Latvian Ruble + * `LBP` - Lebanese Pound + * `LSL` - Lesotho Loti + * `LRD` - Liberian Dollar + * `LYD` - Libyan Dinar + * `LTL` - Lithuanian Litas + * `LTT` - Lithuanian Talonas + * `LUL` - Luxembourg Financial Franc + * `LUC` - Luxembourgian Convertible Franc + * `LUF` - Luxembourgian Franc + * `MOP` - Macanese Pataca + * `MKD` - Macedonian Denar + * `MKN` - Macedonian Denar (1992–1993) + * `MGA` - Malagasy Ariary + * `MGF` - Malagasy Franc + * `MWK` - Malawian Kwacha + * `MYR` - Malaysian Ringgit + * `MVR` - Maldivian Rufiyaa + * `MVP` - Maldivian Rupee (1947–1981) + * `MLF` - Malian Franc + * `MTL` - Maltese Lira + * `MTP` - Maltese Pound + * `MRU` - Mauritanian Ouguiya + * `MRO` - Mauritanian Ouguiya (1973–2017) + * `MUR` - Mauritian Rupee + * `MXV` - Mexican Investment Unit + * `MXN` - Mexican Peso + * `MXP` - Mexican Silver Peso (1861–1992) + * `MDC` - Moldovan Cupon + * `MDL` - Moldovan Leu + * `MCF` - Monegasque Franc + * `MNT` - Mongolian Tugrik + * `MAD` - Moroccan Dirham + * `MAF` - Moroccan Franc + * `MZE` - Mozambican Escudo + * `MZN` - Mozambican Metical + * `MZM` - Mozambican Metical (1980–2006) + * `MMK` - Myanmar Kyat + * `NAD` - Namibian Dollar + * `NPR` - Nepalese Rupee + * `ANG` - Netherlands Antillean Guilder + * `TWD` - New Taiwan Dollar + * `NZD` - New Zealand Dollar + * `NIO` - Nicaraguan Córdoba + * `NIC` - Nicaraguan Córdoba (1988–1991) + * `NGN` - Nigerian Naira + * `KPW` - North Korean Won + * `NOK` - Norwegian Krone + * `OMR` - Omani Rial + * `PKR` - Pakistani Rupee + * `XPD` - Palladium + * `PAB` - Panamanian Balboa + * `PGK` - Papua New Guinean Kina + * `PYG` - Paraguayan Guarani + * `PEI` - Peruvian Inti + * `PEN` - Peruvian Sol + * `PES` - Peruvian Sol (1863–1965) + * `PHP` - Philippine Peso + * `XPT` - Platinum + * `PLN` - Polish Zloty + * `PLZ` - Polish Zloty (1950–1995) + * `PTE` - Portuguese Escudo + * `GWE` - Portuguese Guinea Escudo + * `QAR` - Qatari Rial + * `XRE` - RINET Funds + * `RHD` - Rhodesian Dollar + * `RON` - Romanian Leu + * `ROL` - Romanian Leu (1952–2006) + * `RUB` - Russian Ruble + * `RUR` - Russian Ruble (1991–1998) + * `RWF` - Rwandan Franc + * `SVC` - Salvadoran Colón + * `WST` - Samoan Tala + * `SAR` - Saudi Riyal + * `RSD` - Serbian Dinar + * `CSD` - Serbian Dinar (2002–2006) + * `SCR` - Seychellois Rupee + * `SLL` - Sierra Leonean Leone + * `XAG` - Silver + * `SGD` - Singapore Dollar + * `SKK` - Slovak Koruna + * `SIT` - Slovenian Tolar + * `SBD` - Solomon Islands Dollar + * `SOS` - Somali Shilling + * `ZAR` - South African Rand + * `ZAL` - South African Rand (financial) + * `KRH` - South Korean Hwan (1953–1962) + * `KRW` - South Korean Won + * `KRO` - South Korean Won (1945–1953) + * `SSP` - South Sudanese Pound + * `SUR` - Soviet Rouble + * `ESP` - Spanish Peseta + * `ESA` - Spanish Peseta (A account) + * `ESB` - Spanish Peseta (convertible account) + * `XDR` - Special Drawing Rights + * `LKR` - Sri Lankan Rupee + * `SHP` - St. Helena Pound + * `XSU` - Sucre + * `SDD` - Sudanese Dinar (1992–2007) + * `SDG` - Sudanese Pound + * `SDP` - Sudanese Pound (1957–1998) + * `SRD` - Surinamese Dollar + * `SRG` - Surinamese Guilder + * `SZL` - Swazi Lilangeni + * `SEK` - Swedish Krona + * `CHF` - Swiss Franc + * `SYP` - Syrian Pound + * `STN` - São Tomé & Príncipe Dobra + * `STD` - São Tomé & Príncipe Dobra (1977–2017) + * `TVD` - TVD + * `TJR` - Tajikistani Ruble + * `TJS` - Tajikistani Somoni + * `TZS` - Tanzanian Shilling + * `XTS` - Testing Currency Code + * `THB` - Thai Baht + * `XXX` - The codes assigned for transactions where no currency is involved + * `TPE` - Timorese Escudo + * `TOP` - Tongan Paʻanga + * `TTD` - Trinidad & Tobago Dollar + * `TND` - Tunisian Dinar + * `TRY` - Turkish Lira + * `TRL` - Turkish Lira (1922–2005) + * `TMT` - Turkmenistani Manat + * `TMM` - Turkmenistani Manat (1993–2009) + * `USD` - US Dollar + * `USN` - US Dollar (Next day) + * `USS` - US Dollar (Same day) + * `UGX` - Ugandan Shilling + * `UGS` - Ugandan Shilling (1966–1987) + * `UAH` - Ukrainian Hryvnia + * `UAK` - Ukrainian Karbovanets + * `AED` - United Arab Emirates Dirham + * `UYW` - Uruguayan Nominal Wage Index Unit + * `UYU` - Uruguayan Peso + * `UYP` - Uruguayan Peso (1975–1993) + * `UYI` - Uruguayan Peso (Indexed Units) + * `UZS` - Uzbekistani Som + * `VUV` - Vanuatu Vatu + * `VES` - Venezuelan Bolívar + * `VEB` - Venezuelan Bolívar (1871–2008) + * `VEF` - Venezuelan Bolívar (2008–2018) + * `VND` - Vietnamese Dong + * `VNN` - Vietnamese Dong (1978–1985) + * `CHE` - WIR Euro + * `CHW` - WIR Franc + * `XOF` - West African CFA Franc + * `YDD` - Yemeni Dinar + * `YER` - Yemeni Rial + * `YUN` - Yugoslavian Convertible Dinar (1990–1992) + * `YUD` - Yugoslavian Hard Dinar (1966–1990) + * `YUM` - Yugoslavian New Dinar (1994–2002) + * `YUR` - Yugoslavian Reformed Dinar (1992–1993) + * `ZWN` - ZWN + * `ZRN` - Zairean New Zaire (1993–1998) + * `ZRZ` - Zairean Zaire (1971–1993) + * `ZMW` - Zambian Kwacha + * `ZMK` - Zambian Kwacha (1968–2012) + * `ZWD` - Zimbabwean Dollar (1980–2008) + * `ZWR` - Zimbabwean Dollar (2008) + * `ZWL` - Zimbabwean Dollar (2009) + """ + + exchange_rate: typing.Optional[str] = pydantic.Field(default=None) + """ + Exchange rate used if the line item is in a foreign currency. + """ + + is_billable: typing.Optional[bool] = pydantic.Field(default=None) + """ + Whether the expense line is billable to a client or project. + """ + + tracking_categories: typing.List[str] = pydantic.Field() + """ + The related tracking categories associated with the expense report (Department, Location, Class, Expense Category) + """ + + employee: typing.Optional[ExpenseReportLineEmployee] = pydantic.Field(default=None) + """ + Identifier for the employee who submitted or is associated with the expense report + """ + + project: typing.Optional[ExpenseReportLineProject] = None + company: typing.Optional[ExpenseReportLineCompany] = pydantic.Field(default=None) + """ + The subsidiary that the expense report is created in + """ + + contact: typing.Optional[ExpenseReportLineContact] = None + quantity: typing.Optional[float] = pydantic.Field(default=None) + """ + Quantity for the expense line (e.g., miles driven, items purchased). + """ + + unit_price: typing.Optional[float] = pydantic.Field(default=None) + """ + Price per unit for the expense line (if applicable). + """ + + non_reimbursable: typing.Optional[bool] = pydantic.Field(default=None) + """ + Whether the expense line is non-reimbursable (e.g., paid via company card). + """ + + tax_amount: typing.Optional[float] = pydantic.Field(default=None) + """ + Tax amount applicable for the line item. + """ + + inclusive_of_tax: typing.Optional[bool] = pydantic.Field(default=None) + """ + Whether the amount is inclusive of tax. + """ + + tax_rate: typing.Optional[ExpenseReportLineTaxRate] = None + remote_was_deleted: typing.Optional[bool] = pydantic.Field(default=None) + """ + 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/). + """ + + remote_fields: typing.Optional[typing.List[RemoteField]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/merge/resources/accounting/types/expense_report_line_account.py b/src/merge/resources/accounting/types/expense_report_line_account.py new file mode 100644 index 00000000..4494e2da --- /dev/null +++ b/src/merge/resources/accounting/types/expense_report_line_account.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .account import Account + +ExpenseReportLineAccount = typing.Union[str, Account] diff --git a/src/merge/resources/accounting/types/expense_report_line_company.py b/src/merge/resources/accounting/types/expense_report_line_company.py new file mode 100644 index 00000000..8c43e25a --- /dev/null +++ b/src/merge/resources/accounting/types/expense_report_line_company.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .company_info import CompanyInfo + +ExpenseReportLineCompany = typing.Union[str, CompanyInfo] diff --git a/src/merge/resources/accounting/types/expense_report_line_contact.py b/src/merge/resources/accounting/types/expense_report_line_contact.py new file mode 100644 index 00000000..83c30234 --- /dev/null +++ b/src/merge/resources/accounting/types/expense_report_line_contact.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .contact import Contact + +ExpenseReportLineContact = typing.Union[str, Contact] diff --git a/src/merge/resources/accounting/types/expense_report_line_employee.py b/src/merge/resources/accounting/types/expense_report_line_employee.py new file mode 100644 index 00000000..7765b49d --- /dev/null +++ b/src/merge/resources/accounting/types/expense_report_line_employee.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .employee import Employee + +ExpenseReportLineEmployee = typing.Union[str, Employee] diff --git a/src/merge/resources/accounting/types/expense_report_line_project.py b/src/merge/resources/accounting/types/expense_report_line_project.py new file mode 100644 index 00000000..21c40fb1 --- /dev/null +++ b/src/merge/resources/accounting/types/expense_report_line_project.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .project import Project + +ExpenseReportLineProject = typing.Union[str, Project] diff --git a/src/merge/resources/accounting/types/expense_report_line_request.py b/src/merge/resources/accounting/types/expense_report_line_request.py new file mode 100644 index 00000000..cc0cf8ad --- /dev/null +++ b/src/merge/resources/accounting/types/expense_report_line_request.py @@ -0,0 +1,427 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ....core.unchecked_base_model import UncheckedBaseModel +from .expense_report_line_request_account import ExpenseReportLineRequestAccount +from .expense_report_line_request_company import ExpenseReportLineRequestCompany +from .expense_report_line_request_contact import ExpenseReportLineRequestContact +from .expense_report_line_request_employee import ExpenseReportLineRequestEmployee +from .expense_report_line_request_project import ExpenseReportLineRequestProject +from .expense_report_line_request_tax_rate import ExpenseReportLineRequestTaxRate +from .remote_field_request import RemoteFieldRequest +from .transaction_currency_enum import TransactionCurrencyEnum + + +class ExpenseReportLineRequest(UncheckedBaseModel): + """ + # The ExpenseReportLine Object + ### Description + The `ExpenseReportLine` object represents an individual line item within an expense report, containing details about + a specific expense such as amount, description, and associated metadata. + + ### Usage Example + Fetch from the `GET ExpenseReport` endpoint and expand the lines field to view all line items in the expense report. + """ + + remote_id: typing.Optional[str] = pydantic.Field(default=None) + """ + The third-party API ID of the matching object. + """ + + account: typing.Optional[ExpenseReportLineRequestAccount] = None + description: typing.Optional[str] = pydantic.Field(default=None) + """ + Description of the individual expense. + """ + + expense_date: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The date the individual expense was incurred. + """ + + amount: typing.Optional[float] = pydantic.Field(default=None) + """ + The amount of the expense for the line item. + """ + + currency: typing.Optional[TransactionCurrencyEnum] = pydantic.Field(default=None) + """ + Currency of the expense line (if different from the report currency). + + * `XUA` - ADB Unit of Account + * `AFN` - Afghan Afghani + * `AFA` - Afghan Afghani (1927–2002) + * `ALL` - Albanian Lek + * `ALK` - Albanian Lek (1946–1965) + * `DZD` - Algerian Dinar + * `ADP` - Andorran Peseta + * `AOA` - Angolan Kwanza + * `AOK` - Angolan Kwanza (1977–1991) + * `AON` - Angolan New Kwanza (1990–2000) + * `AOR` - Angolan Readjusted Kwanza (1995–1999) + * `ARA` - Argentine Austral + * `ARS` - Argentine Peso + * `ARM` - Argentine Peso (1881–1970) + * `ARP` - Argentine Peso (1983–1985) + * `ARL` - Argentine Peso Ley (1970–1983) + * `AMD` - Armenian Dram + * `AWG` - Aruban Florin + * `AUD` - Australian Dollar + * `ATS` - Austrian Schilling + * `AZN` - Azerbaijani Manat + * `AZM` - Azerbaijani Manat (1993–2006) + * `BSD` - Bahamian Dollar + * `BHD` - Bahraini Dinar + * `BDT` - Bangladeshi Taka + * `BBD` - Barbadian Dollar + * `BYN` - Belarusian Ruble + * `BYB` - Belarusian Ruble (1994–1999) + * `BYR` - Belarusian Ruble (2000–2016) + * `BEF` - Belgian Franc + * `BEC` - Belgian Franc (convertible) + * `BEL` - Belgian Franc (financial) + * `BZD` - Belize Dollar + * `BMD` - Bermudan Dollar + * `BTN` - Bhutanese Ngultrum + * `BOB` - Bolivian Boliviano + * `BOL` - Bolivian Boliviano (1863–1963) + * `BOV` - Bolivian Mvdol + * `BOP` - Bolivian Peso + * `BAM` - Bosnia-Herzegovina Convertible Mark + * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) + * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) + * `BWP` - Botswanan Pula + * `BRC` - Brazilian Cruzado (1986–1989) + * `BRZ` - Brazilian Cruzeiro (1942–1967) + * `BRE` - Brazilian Cruzeiro (1990–1993) + * `BRR` - Brazilian Cruzeiro (1993–1994) + * `BRN` - Brazilian New Cruzado (1989–1990) + * `BRB` - Brazilian New Cruzeiro (1967–1986) + * `BRL` - Brazilian Real + * `GBP` - British Pound + * `BND` - Brunei Dollar + * `BGL` - Bulgarian Hard Lev + * `BGN` - Bulgarian Lev + * `BGO` - Bulgarian Lev (1879–1952) + * `BGM` - Bulgarian Socialist Lev + * `BUK` - Burmese Kyat + * `BIF` - Burundian Franc + * `XPF` - CFP Franc + * `KHR` - Cambodian Riel + * `CAD` - Canadian Dollar + * `CVE` - Cape Verdean Escudo + * `KYD` - Cayman Islands Dollar + * `XAF` - Central African CFA Franc + * `CLE` - Chilean Escudo + * `CLP` - Chilean Peso + * `CLF` - Chilean Unit of Account (UF) + * `CNX` - Chinese People’s Bank Dollar + * `CNY` - Chinese Yuan + * `CNH` - Chinese Yuan (offshore) + * `COP` - Colombian Peso + * `COU` - Colombian Real Value Unit + * `KMF` - Comorian Franc + * `CDF` - Congolese Franc + * `CRC` - Costa Rican Colón + * `HRD` - Croatian Dinar + * `HRK` - Croatian Kuna + * `CUC` - Cuban Convertible Peso + * `CUP` - Cuban Peso + * `CYP` - Cypriot Pound + * `CZK` - Czech Koruna + * `CSK` - Czechoslovak Hard Koruna + * `DKK` - Danish Krone + * `DJF` - Djiboutian Franc + * `DOP` - Dominican Peso + * `NLG` - Dutch Guilder + * `XCD` - East Caribbean Dollar + * `DDM` - East German Mark + * `ECS` - Ecuadorian Sucre + * `ECV` - Ecuadorian Unit of Constant Value + * `EGP` - Egyptian Pound + * `GQE` - Equatorial Guinean Ekwele + * `ERN` - Eritrean Nakfa + * `EEK` - Estonian Kroon + * `ETB` - Ethiopian Birr + * `EUR` - Euro + * `XBA` - European Composite Unit + * `XEU` - European Currency Unit + * `XBB` - European Monetary Unit + * `XBC` - European Unit of Account (XBC) + * `XBD` - European Unit of Account (XBD) + * `FKP` - Falkland Islands Pound + * `FJD` - Fijian Dollar + * `FIM` - Finnish Markka + * `FRF` - French Franc + * `XFO` - French Gold Franc + * `XFU` - French UIC-Franc + * `GMD` - Gambian Dalasi + * `GEK` - Georgian Kupon Larit + * `GEL` - Georgian Lari + * `DEM` - German Mark + * `GHS` - Ghanaian Cedi + * `GHC` - Ghanaian Cedi (1979–2007) + * `GIP` - Gibraltar Pound + * `XAU` - Gold + * `GRD` - Greek Drachma + * `GTQ` - Guatemalan Quetzal + * `GWP` - Guinea-Bissau Peso + * `GNF` - Guinean Franc + * `GNS` - Guinean Syli + * `GYD` - Guyanaese Dollar + * `HTG` - Haitian Gourde + * `HNL` - Honduran Lempira + * `HKD` - Hong Kong Dollar + * `HUF` - Hungarian Forint + * `IMP` - IMP + * `ISK` - Icelandic Króna + * `ISJ` - Icelandic Króna (1918–1981) + * `INR` - Indian Rupee + * `IDR` - Indonesian Rupiah + * `IRR` - Iranian Rial + * `IQD` - Iraqi Dinar + * `IEP` - Irish Pound + * `ILS` - Israeli New Shekel + * `ILP` - Israeli Pound + * `ILR` - Israeli Shekel (1980–1985) + * `ITL` - Italian Lira + * `JMD` - Jamaican Dollar + * `JPY` - Japanese Yen + * `JOD` - Jordanian Dinar + * `KZT` - Kazakhstani Tenge + * `KES` - Kenyan Shilling + * `KWD` - Kuwaiti Dinar + * `KGS` - Kyrgystani Som + * `LAK` - Laotian Kip + * `LVL` - Latvian Lats + * `LVR` - Latvian Ruble + * `LBP` - Lebanese Pound + * `LSL` - Lesotho Loti + * `LRD` - Liberian Dollar + * `LYD` - Libyan Dinar + * `LTL` - Lithuanian Litas + * `LTT` - Lithuanian Talonas + * `LUL` - Luxembourg Financial Franc + * `LUC` - Luxembourgian Convertible Franc + * `LUF` - Luxembourgian Franc + * `MOP` - Macanese Pataca + * `MKD` - Macedonian Denar + * `MKN` - Macedonian Denar (1992–1993) + * `MGA` - Malagasy Ariary + * `MGF` - Malagasy Franc + * `MWK` - Malawian Kwacha + * `MYR` - Malaysian Ringgit + * `MVR` - Maldivian Rufiyaa + * `MVP` - Maldivian Rupee (1947–1981) + * `MLF` - Malian Franc + * `MTL` - Maltese Lira + * `MTP` - Maltese Pound + * `MRU` - Mauritanian Ouguiya + * `MRO` - Mauritanian Ouguiya (1973–2017) + * `MUR` - Mauritian Rupee + * `MXV` - Mexican Investment Unit + * `MXN` - Mexican Peso + * `MXP` - Mexican Silver Peso (1861–1992) + * `MDC` - Moldovan Cupon + * `MDL` - Moldovan Leu + * `MCF` - Monegasque Franc + * `MNT` - Mongolian Tugrik + * `MAD` - Moroccan Dirham + * `MAF` - Moroccan Franc + * `MZE` - Mozambican Escudo + * `MZN` - Mozambican Metical + * `MZM` - Mozambican Metical (1980–2006) + * `MMK` - Myanmar Kyat + * `NAD` - Namibian Dollar + * `NPR` - Nepalese Rupee + * `ANG` - Netherlands Antillean Guilder + * `TWD` - New Taiwan Dollar + * `NZD` - New Zealand Dollar + * `NIO` - Nicaraguan Córdoba + * `NIC` - Nicaraguan Córdoba (1988–1991) + * `NGN` - Nigerian Naira + * `KPW` - North Korean Won + * `NOK` - Norwegian Krone + * `OMR` - Omani Rial + * `PKR` - Pakistani Rupee + * `XPD` - Palladium + * `PAB` - Panamanian Balboa + * `PGK` - Papua New Guinean Kina + * `PYG` - Paraguayan Guarani + * `PEI` - Peruvian Inti + * `PEN` - Peruvian Sol + * `PES` - Peruvian Sol (1863–1965) + * `PHP` - Philippine Peso + * `XPT` - Platinum + * `PLN` - Polish Zloty + * `PLZ` - Polish Zloty (1950–1995) + * `PTE` - Portuguese Escudo + * `GWE` - Portuguese Guinea Escudo + * `QAR` - Qatari Rial + * `XRE` - RINET Funds + * `RHD` - Rhodesian Dollar + * `RON` - Romanian Leu + * `ROL` - Romanian Leu (1952–2006) + * `RUB` - Russian Ruble + * `RUR` - Russian Ruble (1991–1998) + * `RWF` - Rwandan Franc + * `SVC` - Salvadoran Colón + * `WST` - Samoan Tala + * `SAR` - Saudi Riyal + * `RSD` - Serbian Dinar + * `CSD` - Serbian Dinar (2002–2006) + * `SCR` - Seychellois Rupee + * `SLL` - Sierra Leonean Leone + * `XAG` - Silver + * `SGD` - Singapore Dollar + * `SKK` - Slovak Koruna + * `SIT` - Slovenian Tolar + * `SBD` - Solomon Islands Dollar + * `SOS` - Somali Shilling + * `ZAR` - South African Rand + * `ZAL` - South African Rand (financial) + * `KRH` - South Korean Hwan (1953–1962) + * `KRW` - South Korean Won + * `KRO` - South Korean Won (1945–1953) + * `SSP` - South Sudanese Pound + * `SUR` - Soviet Rouble + * `ESP` - Spanish Peseta + * `ESA` - Spanish Peseta (A account) + * `ESB` - Spanish Peseta (convertible account) + * `XDR` - Special Drawing Rights + * `LKR` - Sri Lankan Rupee + * `SHP` - St. Helena Pound + * `XSU` - Sucre + * `SDD` - Sudanese Dinar (1992–2007) + * `SDG` - Sudanese Pound + * `SDP` - Sudanese Pound (1957–1998) + * `SRD` - Surinamese Dollar + * `SRG` - Surinamese Guilder + * `SZL` - Swazi Lilangeni + * `SEK` - Swedish Krona + * `CHF` - Swiss Franc + * `SYP` - Syrian Pound + * `STN` - São Tomé & Príncipe Dobra + * `STD` - São Tomé & Príncipe Dobra (1977–2017) + * `TVD` - TVD + * `TJR` - Tajikistani Ruble + * `TJS` - Tajikistani Somoni + * `TZS` - Tanzanian Shilling + * `XTS` - Testing Currency Code + * `THB` - Thai Baht + * `XXX` - The codes assigned for transactions where no currency is involved + * `TPE` - Timorese Escudo + * `TOP` - Tongan Paʻanga + * `TTD` - Trinidad & Tobago Dollar + * `TND` - Tunisian Dinar + * `TRY` - Turkish Lira + * `TRL` - Turkish Lira (1922–2005) + * `TMT` - Turkmenistani Manat + * `TMM` - Turkmenistani Manat (1993–2009) + * `USD` - US Dollar + * `USN` - US Dollar (Next day) + * `USS` - US Dollar (Same day) + * `UGX` - Ugandan Shilling + * `UGS` - Ugandan Shilling (1966–1987) + * `UAH` - Ukrainian Hryvnia + * `UAK` - Ukrainian Karbovanets + * `AED` - United Arab Emirates Dirham + * `UYW` - Uruguayan Nominal Wage Index Unit + * `UYU` - Uruguayan Peso + * `UYP` - Uruguayan Peso (1975–1993) + * `UYI` - Uruguayan Peso (Indexed Units) + * `UZS` - Uzbekistani Som + * `VUV` - Vanuatu Vatu + * `VES` - Venezuelan Bolívar + * `VEB` - Venezuelan Bolívar (1871–2008) + * `VEF` - Venezuelan Bolívar (2008–2018) + * `VND` - Vietnamese Dong + * `VNN` - Vietnamese Dong (1978–1985) + * `CHE` - WIR Euro + * `CHW` - WIR Franc + * `XOF` - West African CFA Franc + * `YDD` - Yemeni Dinar + * `YER` - Yemeni Rial + * `YUN` - Yugoslavian Convertible Dinar (1990–1992) + * `YUD` - Yugoslavian Hard Dinar (1966–1990) + * `YUM` - Yugoslavian New Dinar (1994–2002) + * `YUR` - Yugoslavian Reformed Dinar (1992–1993) + * `ZWN` - ZWN + * `ZRN` - Zairean New Zaire (1993–1998) + * `ZRZ` - Zairean Zaire (1971–1993) + * `ZMW` - Zambian Kwacha + * `ZMK` - Zambian Kwacha (1968–2012) + * `ZWD` - Zimbabwean Dollar (1980–2008) + * `ZWR` - Zimbabwean Dollar (2008) + * `ZWL` - Zimbabwean Dollar (2009) + """ + + exchange_rate: typing.Optional[str] = pydantic.Field(default=None) + """ + Exchange rate used if the line item is in a foreign currency. + """ + + is_billable: typing.Optional[bool] = pydantic.Field(default=None) + """ + Whether the expense line is billable to a client or project. + """ + + tracking_categories: typing.List[str] = pydantic.Field() + """ + The related tracking categories associated with the expense report (Department, Location, Class, Expense Category) + """ + + employee: typing.Optional[ExpenseReportLineRequestEmployee] = pydantic.Field(default=None) + """ + Identifier for the employee who submitted or is associated with the expense report + """ + + project: typing.Optional[ExpenseReportLineRequestProject] = None + company: typing.Optional[ExpenseReportLineRequestCompany] = pydantic.Field(default=None) + """ + The subsidiary that the expense report is created in + """ + + contact: typing.Optional[ExpenseReportLineRequestContact] = None + quantity: typing.Optional[float] = pydantic.Field(default=None) + """ + Quantity for the expense line (e.g., miles driven, items purchased). + """ + + unit_price: typing.Optional[float] = pydantic.Field(default=None) + """ + Price per unit for the expense line (if applicable). + """ + + non_reimbursable: typing.Optional[bool] = pydantic.Field(default=None) + """ + Whether the expense line is non-reimbursable (e.g., paid via company card). + """ + + tax_amount: typing.Optional[float] = pydantic.Field(default=None) + """ + Tax amount applicable for the line item. + """ + + inclusive_of_tax: typing.Optional[bool] = pydantic.Field(default=None) + """ + Whether the amount is inclusive of tax. + """ + + tax_rate: typing.Optional[ExpenseReportLineRequestTaxRate] = None + integration_params: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None + linked_account_params: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None + remote_fields: typing.Optional[typing.List[RemoteFieldRequest]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/merge/resources/accounting/types/expense_report_line_request_account.py b/src/merge/resources/accounting/types/expense_report_line_request_account.py new file mode 100644 index 00000000..dc8d9687 --- /dev/null +++ b/src/merge/resources/accounting/types/expense_report_line_request_account.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .account import Account + +ExpenseReportLineRequestAccount = typing.Union[str, Account] diff --git a/src/merge/resources/accounting/types/expense_report_line_request_company.py b/src/merge/resources/accounting/types/expense_report_line_request_company.py new file mode 100644 index 00000000..3c611820 --- /dev/null +++ b/src/merge/resources/accounting/types/expense_report_line_request_company.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .company_info import CompanyInfo + +ExpenseReportLineRequestCompany = typing.Union[str, CompanyInfo] diff --git a/src/merge/resources/accounting/types/expense_report_line_request_contact.py b/src/merge/resources/accounting/types/expense_report_line_request_contact.py new file mode 100644 index 00000000..f6ed150e --- /dev/null +++ b/src/merge/resources/accounting/types/expense_report_line_request_contact.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .contact import Contact + +ExpenseReportLineRequestContact = typing.Union[str, Contact] diff --git a/src/merge/resources/accounting/types/expense_report_line_request_employee.py b/src/merge/resources/accounting/types/expense_report_line_request_employee.py new file mode 100644 index 00000000..22cc3988 --- /dev/null +++ b/src/merge/resources/accounting/types/expense_report_line_request_employee.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .employee import Employee + +ExpenseReportLineRequestEmployee = typing.Union[str, Employee] diff --git a/src/merge/resources/accounting/types/expense_report_line_request_project.py b/src/merge/resources/accounting/types/expense_report_line_request_project.py new file mode 100644 index 00000000..47636a9e --- /dev/null +++ b/src/merge/resources/accounting/types/expense_report_line_request_project.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .project import Project + +ExpenseReportLineRequestProject = typing.Union[str, Project] diff --git a/src/merge/resources/accounting/types/expense_report_line_request_tax_rate.py b/src/merge/resources/accounting/types/expense_report_line_request_tax_rate.py new file mode 100644 index 00000000..3c045256 --- /dev/null +++ b/src/merge/resources/accounting/types/expense_report_line_request_tax_rate.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .tax_rate import TaxRate + +ExpenseReportLineRequestTaxRate = typing.Union[str, TaxRate] diff --git a/src/merge/resources/accounting/types/expense_report_line_tax_rate.py b/src/merge/resources/accounting/types/expense_report_line_tax_rate.py new file mode 100644 index 00000000..aff1780e --- /dev/null +++ b/src/merge/resources/accounting/types/expense_report_line_tax_rate.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .tax_rate import TaxRate + +ExpenseReportLineTaxRate = typing.Union[str, TaxRate] diff --git a/src/merge/resources/accounting/types/expense_report_request.py b/src/merge/resources/accounting/types/expense_report_request.py new file mode 100644 index 00000000..00243adf --- /dev/null +++ b/src/merge/resources/accounting/types/expense_report_request.py @@ -0,0 +1,401 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ....core.unchecked_base_model import UncheckedBaseModel +from .expense_report_request_accounting_period import ExpenseReportRequestAccountingPeriod +from .expense_report_request_company import ExpenseReportRequestCompany +from .expense_report_request_employee import ExpenseReportRequestEmployee +from .expense_report_status_enum import ExpenseReportStatusEnum +from .remote_field_request import RemoteFieldRequest +from .transaction_currency_enum import TransactionCurrencyEnum + + +class ExpenseReportRequest(UncheckedBaseModel): + """ + # The ExpenseReport Object + ### Description + The `ExpenseReport` object represents a collection of expenses submitted for review and reimbursement. + It includes details about the submitter, status, amounts, and associated metadata. + + ### Usage Example + Fetch from the `GET ExpenseReport` endpoint to view details of expense reports and their line items. + """ + + report_date: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The date of the expense report. + """ + + report_identifier: typing.Optional[str] = pydantic.Field(default=None) + """ + Human-readable expense report identifier. + """ + + employee: typing.Optional[ExpenseReportRequestEmployee] = pydantic.Field(default=None) + """ + Identifier for the employee who submitted or is associated with the expense report + """ + + status: typing.Optional[ExpenseReportStatusEnum] = pydantic.Field(default=None) + """ + Overall status of the expense report. One of DRAFT, SUBMITTED, APPROVED, REJECTED + + * `DRAFT` - DRAFT + * `SUBMITTED` - SUBMITTED + * `APPROVED` - APPROVED + * `REJECTED` - REJECTED + """ + + total_amount: typing.Optional[float] = pydantic.Field(default=None) + """ + Total amount of the expense report + """ + + currency: typing.Optional[TransactionCurrencyEnum] = pydantic.Field(default=None) + """ + Currency code for the expense report + + * `XUA` - ADB Unit of Account + * `AFN` - Afghan Afghani + * `AFA` - Afghan Afghani (1927–2002) + * `ALL` - Albanian Lek + * `ALK` - Albanian Lek (1946–1965) + * `DZD` - Algerian Dinar + * `ADP` - Andorran Peseta + * `AOA` - Angolan Kwanza + * `AOK` - Angolan Kwanza (1977–1991) + * `AON` - Angolan New Kwanza (1990–2000) + * `AOR` - Angolan Readjusted Kwanza (1995–1999) + * `ARA` - Argentine Austral + * `ARS` - Argentine Peso + * `ARM` - Argentine Peso (1881–1970) + * `ARP` - Argentine Peso (1983–1985) + * `ARL` - Argentine Peso Ley (1970–1983) + * `AMD` - Armenian Dram + * `AWG` - Aruban Florin + * `AUD` - Australian Dollar + * `ATS` - Austrian Schilling + * `AZN` - Azerbaijani Manat + * `AZM` - Azerbaijani Manat (1993–2006) + * `BSD` - Bahamian Dollar + * `BHD` - Bahraini Dinar + * `BDT` - Bangladeshi Taka + * `BBD` - Barbadian Dollar + * `BYN` - Belarusian Ruble + * `BYB` - Belarusian Ruble (1994–1999) + * `BYR` - Belarusian Ruble (2000–2016) + * `BEF` - Belgian Franc + * `BEC` - Belgian Franc (convertible) + * `BEL` - Belgian Franc (financial) + * `BZD` - Belize Dollar + * `BMD` - Bermudan Dollar + * `BTN` - Bhutanese Ngultrum + * `BOB` - Bolivian Boliviano + * `BOL` - Bolivian Boliviano (1863–1963) + * `BOV` - Bolivian Mvdol + * `BOP` - Bolivian Peso + * `BAM` - Bosnia-Herzegovina Convertible Mark + * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) + * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) + * `BWP` - Botswanan Pula + * `BRC` - Brazilian Cruzado (1986–1989) + * `BRZ` - Brazilian Cruzeiro (1942–1967) + * `BRE` - Brazilian Cruzeiro (1990–1993) + * `BRR` - Brazilian Cruzeiro (1993–1994) + * `BRN` - Brazilian New Cruzado (1989–1990) + * `BRB` - Brazilian New Cruzeiro (1967–1986) + * `BRL` - Brazilian Real + * `GBP` - British Pound + * `BND` - Brunei Dollar + * `BGL` - Bulgarian Hard Lev + * `BGN` - Bulgarian Lev + * `BGO` - Bulgarian Lev (1879–1952) + * `BGM` - Bulgarian Socialist Lev + * `BUK` - Burmese Kyat + * `BIF` - Burundian Franc + * `XPF` - CFP Franc + * `KHR` - Cambodian Riel + * `CAD` - Canadian Dollar + * `CVE` - Cape Verdean Escudo + * `KYD` - Cayman Islands Dollar + * `XAF` - Central African CFA Franc + * `CLE` - Chilean Escudo + * `CLP` - Chilean Peso + * `CLF` - Chilean Unit of Account (UF) + * `CNX` - Chinese People’s Bank Dollar + * `CNY` - Chinese Yuan + * `CNH` - Chinese Yuan (offshore) + * `COP` - Colombian Peso + * `COU` - Colombian Real Value Unit + * `KMF` - Comorian Franc + * `CDF` - Congolese Franc + * `CRC` - Costa Rican Colón + * `HRD` - Croatian Dinar + * `HRK` - Croatian Kuna + * `CUC` - Cuban Convertible Peso + * `CUP` - Cuban Peso + * `CYP` - Cypriot Pound + * `CZK` - Czech Koruna + * `CSK` - Czechoslovak Hard Koruna + * `DKK` - Danish Krone + * `DJF` - Djiboutian Franc + * `DOP` - Dominican Peso + * `NLG` - Dutch Guilder + * `XCD` - East Caribbean Dollar + * `DDM` - East German Mark + * `ECS` - Ecuadorian Sucre + * `ECV` - Ecuadorian Unit of Constant Value + * `EGP` - Egyptian Pound + * `GQE` - Equatorial Guinean Ekwele + * `ERN` - Eritrean Nakfa + * `EEK` - Estonian Kroon + * `ETB` - Ethiopian Birr + * `EUR` - Euro + * `XBA` - European Composite Unit + * `XEU` - European Currency Unit + * `XBB` - European Monetary Unit + * `XBC` - European Unit of Account (XBC) + * `XBD` - European Unit of Account (XBD) + * `FKP` - Falkland Islands Pound + * `FJD` - Fijian Dollar + * `FIM` - Finnish Markka + * `FRF` - French Franc + * `XFO` - French Gold Franc + * `XFU` - French UIC-Franc + * `GMD` - Gambian Dalasi + * `GEK` - Georgian Kupon Larit + * `GEL` - Georgian Lari + * `DEM` - German Mark + * `GHS` - Ghanaian Cedi + * `GHC` - Ghanaian Cedi (1979–2007) + * `GIP` - Gibraltar Pound + * `XAU` - Gold + * `GRD` - Greek Drachma + * `GTQ` - Guatemalan Quetzal + * `GWP` - Guinea-Bissau Peso + * `GNF` - Guinean Franc + * `GNS` - Guinean Syli + * `GYD` - Guyanaese Dollar + * `HTG` - Haitian Gourde + * `HNL` - Honduran Lempira + * `HKD` - Hong Kong Dollar + * `HUF` - Hungarian Forint + * `IMP` - IMP + * `ISK` - Icelandic Króna + * `ISJ` - Icelandic Króna (1918–1981) + * `INR` - Indian Rupee + * `IDR` - Indonesian Rupiah + * `IRR` - Iranian Rial + * `IQD` - Iraqi Dinar + * `IEP` - Irish Pound + * `ILS` - Israeli New Shekel + * `ILP` - Israeli Pound + * `ILR` - Israeli Shekel (1980–1985) + * `ITL` - Italian Lira + * `JMD` - Jamaican Dollar + * `JPY` - Japanese Yen + * `JOD` - Jordanian Dinar + * `KZT` - Kazakhstani Tenge + * `KES` - Kenyan Shilling + * `KWD` - Kuwaiti Dinar + * `KGS` - Kyrgystani Som + * `LAK` - Laotian Kip + * `LVL` - Latvian Lats + * `LVR` - Latvian Ruble + * `LBP` - Lebanese Pound + * `LSL` - Lesotho Loti + * `LRD` - Liberian Dollar + * `LYD` - Libyan Dinar + * `LTL` - Lithuanian Litas + * `LTT` - Lithuanian Talonas + * `LUL` - Luxembourg Financial Franc + * `LUC` - Luxembourgian Convertible Franc + * `LUF` - Luxembourgian Franc + * `MOP` - Macanese Pataca + * `MKD` - Macedonian Denar + * `MKN` - Macedonian Denar (1992–1993) + * `MGA` - Malagasy Ariary + * `MGF` - Malagasy Franc + * `MWK` - Malawian Kwacha + * `MYR` - Malaysian Ringgit + * `MVR` - Maldivian Rufiyaa + * `MVP` - Maldivian Rupee (1947–1981) + * `MLF` - Malian Franc + * `MTL` - Maltese Lira + * `MTP` - Maltese Pound + * `MRU` - Mauritanian Ouguiya + * `MRO` - Mauritanian Ouguiya (1973–2017) + * `MUR` - Mauritian Rupee + * `MXV` - Mexican Investment Unit + * `MXN` - Mexican Peso + * `MXP` - Mexican Silver Peso (1861–1992) + * `MDC` - Moldovan Cupon + * `MDL` - Moldovan Leu + * `MCF` - Monegasque Franc + * `MNT` - Mongolian Tugrik + * `MAD` - Moroccan Dirham + * `MAF` - Moroccan Franc + * `MZE` - Mozambican Escudo + * `MZN` - Mozambican Metical + * `MZM` - Mozambican Metical (1980–2006) + * `MMK` - Myanmar Kyat + * `NAD` - Namibian Dollar + * `NPR` - Nepalese Rupee + * `ANG` - Netherlands Antillean Guilder + * `TWD` - New Taiwan Dollar + * `NZD` - New Zealand Dollar + * `NIO` - Nicaraguan Córdoba + * `NIC` - Nicaraguan Córdoba (1988–1991) + * `NGN` - Nigerian Naira + * `KPW` - North Korean Won + * `NOK` - Norwegian Krone + * `OMR` - Omani Rial + * `PKR` - Pakistani Rupee + * `XPD` - Palladium + * `PAB` - Panamanian Balboa + * `PGK` - Papua New Guinean Kina + * `PYG` - Paraguayan Guarani + * `PEI` - Peruvian Inti + * `PEN` - Peruvian Sol + * `PES` - Peruvian Sol (1863–1965) + * `PHP` - Philippine Peso + * `XPT` - Platinum + * `PLN` - Polish Zloty + * `PLZ` - Polish Zloty (1950–1995) + * `PTE` - Portuguese Escudo + * `GWE` - Portuguese Guinea Escudo + * `QAR` - Qatari Rial + * `XRE` - RINET Funds + * `RHD` - Rhodesian Dollar + * `RON` - Romanian Leu + * `ROL` - Romanian Leu (1952–2006) + * `RUB` - Russian Ruble + * `RUR` - Russian Ruble (1991–1998) + * `RWF` - Rwandan Franc + * `SVC` - Salvadoran Colón + * `WST` - Samoan Tala + * `SAR` - Saudi Riyal + * `RSD` - Serbian Dinar + * `CSD` - Serbian Dinar (2002–2006) + * `SCR` - Seychellois Rupee + * `SLL` - Sierra Leonean Leone + * `XAG` - Silver + * `SGD` - Singapore Dollar + * `SKK` - Slovak Koruna + * `SIT` - Slovenian Tolar + * `SBD` - Solomon Islands Dollar + * `SOS` - Somali Shilling + * `ZAR` - South African Rand + * `ZAL` - South African Rand (financial) + * `KRH` - South Korean Hwan (1953–1962) + * `KRW` - South Korean Won + * `KRO` - South Korean Won (1945–1953) + * `SSP` - South Sudanese Pound + * `SUR` - Soviet Rouble + * `ESP` - Spanish Peseta + * `ESA` - Spanish Peseta (A account) + * `ESB` - Spanish Peseta (convertible account) + * `XDR` - Special Drawing Rights + * `LKR` - Sri Lankan Rupee + * `SHP` - St. Helena Pound + * `XSU` - Sucre + * `SDD` - Sudanese Dinar (1992–2007) + * `SDG` - Sudanese Pound + * `SDP` - Sudanese Pound (1957–1998) + * `SRD` - Surinamese Dollar + * `SRG` - Surinamese Guilder + * `SZL` - Swazi Lilangeni + * `SEK` - Swedish Krona + * `CHF` - Swiss Franc + * `SYP` - Syrian Pound + * `STN` - São Tomé & Príncipe Dobra + * `STD` - São Tomé & Príncipe Dobra (1977–2017) + * `TVD` - TVD + * `TJR` - Tajikistani Ruble + * `TJS` - Tajikistani Somoni + * `TZS` - Tanzanian Shilling + * `XTS` - Testing Currency Code + * `THB` - Thai Baht + * `XXX` - The codes assigned for transactions where no currency is involved + * `TPE` - Timorese Escudo + * `TOP` - Tongan Paʻanga + * `TTD` - Trinidad & Tobago Dollar + * `TND` - Tunisian Dinar + * `TRY` - Turkish Lira + * `TRL` - Turkish Lira (1922–2005) + * `TMT` - Turkmenistani Manat + * `TMM` - Turkmenistani Manat (1993–2009) + * `USD` - US Dollar + * `USN` - US Dollar (Next day) + * `USS` - US Dollar (Same day) + * `UGX` - Ugandan Shilling + * `UGS` - Ugandan Shilling (1966–1987) + * `UAH` - Ukrainian Hryvnia + * `UAK` - Ukrainian Karbovanets + * `AED` - United Arab Emirates Dirham + * `UYW` - Uruguayan Nominal Wage Index Unit + * `UYU` - Uruguayan Peso + * `UYP` - Uruguayan Peso (1975–1993) + * `UYI` - Uruguayan Peso (Indexed Units) + * `UZS` - Uzbekistani Som + * `VUV` - Vanuatu Vatu + * `VES` - Venezuelan Bolívar + * `VEB` - Venezuelan Bolívar (1871–2008) + * `VEF` - Venezuelan Bolívar (2008–2018) + * `VND` - Vietnamese Dong + * `VNN` - Vietnamese Dong (1978–1985) + * `CHE` - WIR Euro + * `CHW` - WIR Franc + * `XOF` - West African CFA Franc + * `YDD` - Yemeni Dinar + * `YER` - Yemeni Rial + * `YUN` - Yugoslavian Convertible Dinar (1990–1992) + * `YUD` - Yugoslavian Hard Dinar (1966–1990) + * `YUM` - Yugoslavian New Dinar (1994–2002) + * `YUR` - Yugoslavian Reformed Dinar (1992–1993) + * `ZWN` - ZWN + * `ZRN` - Zairean New Zaire (1993–1998) + * `ZRZ` - Zairean Zaire (1971–1993) + * `ZMW` - Zambian Kwacha + * `ZMK` - Zambian Kwacha (1968–2012) + * `ZWD` - Zimbabwean Dollar (1980–2008) + * `ZWR` - Zimbabwean Dollar (2008) + * `ZWL` - Zimbabwean Dollar (2009) + """ + + description: typing.Optional[str] = pydantic.Field(default=None) + """ + A brief description or purpose for the expense report + """ + + accounting_period: typing.Optional[ExpenseReportRequestAccountingPeriod] = pydantic.Field(default=None) + """ + The accounting period the report was posted in + """ + + company: typing.Optional[ExpenseReportRequestCompany] = pydantic.Field(default=None) + """ + The subsidiary that the expense report is created in + """ + + tracking_categories: typing.List[str] = pydantic.Field() + """ + The related tracking categories associated with the expense report + """ + + integration_params: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None + linked_account_params: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None + remote_fields: typing.Optional[typing.List[RemoteFieldRequest]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/merge/resources/accounting/types/expense_report_request_accounting_period.py b/src/merge/resources/accounting/types/expense_report_request_accounting_period.py new file mode 100644 index 00000000..b789b0cc --- /dev/null +++ b/src/merge/resources/accounting/types/expense_report_request_accounting_period.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .accounting_period import AccountingPeriod + +ExpenseReportRequestAccountingPeriod = typing.Union[str, AccountingPeriod] diff --git a/src/merge/resources/accounting/types/expense_report_request_company.py b/src/merge/resources/accounting/types/expense_report_request_company.py new file mode 100644 index 00000000..d2062a72 --- /dev/null +++ b/src/merge/resources/accounting/types/expense_report_request_company.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .company_info import CompanyInfo + +ExpenseReportRequestCompany = typing.Union[str, CompanyInfo] diff --git a/src/merge/resources/accounting/types/expense_report_request_employee.py b/src/merge/resources/accounting/types/expense_report_request_employee.py new file mode 100644 index 00000000..7139be1a --- /dev/null +++ b/src/merge/resources/accounting/types/expense_report_request_employee.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .employee import Employee + +ExpenseReportRequestEmployee = typing.Union[str, Employee] diff --git a/src/merge/resources/accounting/types/expense_report_response.py b/src/merge/resources/accounting/types/expense_report_response.py new file mode 100644 index 00000000..9d0523de --- /dev/null +++ b/src/merge/resources/accounting/types/expense_report_response.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ....core.unchecked_base_model import UncheckedBaseModel +from .debug_mode_log import DebugModeLog +from .error_validation_problem import ErrorValidationProblem +from .expense_report import ExpenseReport +from .warning_validation_problem import WarningValidationProblem + + +class ExpenseReportResponse(UncheckedBaseModel): + model: ExpenseReport + warnings: typing.List[WarningValidationProblem] + errors: typing.List[ErrorValidationProblem] + logs: typing.Optional[typing.List[DebugModeLog]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/merge/resources/accounting/types/expense_report_status.py b/src/merge/resources/accounting/types/expense_report_status.py new file mode 100644 index 00000000..5a590228 --- /dev/null +++ b/src/merge/resources/accounting/types/expense_report_status.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .expense_report_status_enum import ExpenseReportStatusEnum + +ExpenseReportStatus = typing.Union[ExpenseReportStatusEnum, str] diff --git a/src/merge/resources/accounting/types/expense_report_status_enum.py b/src/merge/resources/accounting/types/expense_report_status_enum.py new file mode 100644 index 00000000..79e72fd5 --- /dev/null +++ b/src/merge/resources/accounting/types/expense_report_status_enum.py @@ -0,0 +1,36 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class ExpenseReportStatusEnum(str, enum.Enum): + """ + * `DRAFT` - DRAFT + * `SUBMITTED` - SUBMITTED + * `APPROVED` - APPROVED + * `REJECTED` - REJECTED + """ + + DRAFT = "DRAFT" + SUBMITTED = "SUBMITTED" + APPROVED = "APPROVED" + REJECTED = "REJECTED" + + def visit( + self, + draft: typing.Callable[[], T_Result], + submitted: typing.Callable[[], T_Result], + approved: typing.Callable[[], T_Result], + rejected: typing.Callable[[], T_Result], + ) -> T_Result: + if self is ExpenseReportStatusEnum.DRAFT: + return draft() + if self is ExpenseReportStatusEnum.SUBMITTED: + return submitted() + if self is ExpenseReportStatusEnum.APPROVED: + return approved() + if self is ExpenseReportStatusEnum.REJECTED: + return rejected() diff --git a/src/merge/resources/accounting/types/external_target_field_api_response.py b/src/merge/resources/accounting/types/external_target_field_api_response.py index a053d2d2..6e7dbf94 100644 --- a/src/merge/resources/accounting/types/external_target_field_api_response.py +++ b/src/merge/resources/accounting/types/external_target_field_api_response.py @@ -31,6 +31,9 @@ class ExternalTargetFieldApiResponse(UncheckedBaseModel): purchase_order: typing.Optional[typing.List[ExternalTargetFieldApi]] = pydantic.Field( alias="PurchaseOrder", default=None ) + expense_report: typing.Optional[typing.List[ExternalTargetFieldApi]] = pydantic.Field( + alias="ExpenseReport", default=None + ) tracking_category: typing.Optional[typing.List[ExternalTargetFieldApi]] = pydantic.Field( alias="TrackingCategory", default=None ) diff --git a/src/merge/resources/accounting/types/field_mapping_api_instance_response.py b/src/merge/resources/accounting/types/field_mapping_api_instance_response.py index e03dc1bf..dceac32c 100644 --- a/src/merge/resources/accounting/types/field_mapping_api_instance_response.py +++ b/src/merge/resources/accounting/types/field_mapping_api_instance_response.py @@ -33,6 +33,9 @@ class FieldMappingApiInstanceResponse(UncheckedBaseModel): purchase_order: typing.Optional[typing.List[FieldMappingApiInstance]] = pydantic.Field( alias="PurchaseOrder", default=None ) + expense_report: typing.Optional[typing.List[FieldMappingApiInstance]] = pydantic.Field( + alias="ExpenseReport", default=None + ) tracking_category: typing.Optional[typing.List[FieldMappingApiInstance]] = pydantic.Field( alias="TrackingCategory", default=None ) diff --git a/src/merge/resources/accounting/types/item.py b/src/merge/resources/accounting/types/item.py index 3d030eaa..f42e396e 100644 --- a/src/merge/resources/accounting/types/item.py +++ b/src/merge/resources/accounting/types/item.py @@ -12,6 +12,7 @@ from .item_sales_account import ItemSalesAccount from .item_sales_tax_rate import ItemSalesTaxRate from .item_status import ItemStatus +from .item_type import ItemType from .remote_data import RemoteData @@ -54,6 +55,16 @@ class Item(UncheckedBaseModel): * `ARCHIVED` - ARCHIVED """ + type: typing.Optional[ItemType] = pydantic.Field(default=None) + """ + The item's type. + + * `INVENTORY` - INVENTORY + * `NON_INVENTORY` - NON_INVENTORY + * `SERVICE` - SERVICE + * `UNKNOWN` - UNKNOWN + """ + unit_price: typing.Optional[float] = pydantic.Field(default=None) """ The item's unit price. diff --git a/src/merge/resources/accounting/types/item_type.py b/src/merge/resources/accounting/types/item_type.py new file mode 100644 index 00000000..fbb13fee --- /dev/null +++ b/src/merge/resources/accounting/types/item_type.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .type_2_bb_enum import Type2BbEnum + +ItemType = typing.Union[Type2BbEnum, str] diff --git a/src/merge/resources/accounting/types/paginated_expense_report_line_list.py b/src/merge/resources/accounting/types/paginated_expense_report_line_list.py new file mode 100644 index 00000000..6b2f2057 --- /dev/null +++ b/src/merge/resources/accounting/types/paginated_expense_report_line_list.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ....core.unchecked_base_model import UncheckedBaseModel +from .expense_report_line import ExpenseReportLine + + +class PaginatedExpenseReportLineList(UncheckedBaseModel): + next: typing.Optional[str] = None + previous: typing.Optional[str] = None + results: typing.Optional[typing.List[ExpenseReportLine]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/merge/resources/accounting/types/paginated_expense_report_list.py b/src/merge/resources/accounting/types/paginated_expense_report_list.py new file mode 100644 index 00000000..c75ff556 --- /dev/null +++ b/src/merge/resources/accounting/types/paginated_expense_report_list.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ....core.unchecked_base_model import UncheckedBaseModel +from .expense_report import ExpenseReport + + +class PaginatedExpenseReportList(UncheckedBaseModel): + next: typing.Optional[str] = None + previous: typing.Optional[str] = None + results: typing.Optional[typing.List[ExpenseReport]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow