diff --git a/sync-for-payroll/README.md b/sync-for-payroll/README.md index 0922c0aa7..27493579e 100644 --- a/sync-for-payroll/README.md +++ b/sync-for-payroll/README.md @@ -3,15 +3,126 @@ -replace me +## SDK Installation + +```bash +pip install codat-sync-for-payroll +``` ## Example Usage -replace me + + +```python +import codatsyncpayroll +from codatsyncpayroll.models import operations, shared +from decimal import Decimal + +s = codatsyncpayroll.CodatSyncPayroll( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.CreateAccountRequest( + account=shared.Account( + currency='USD', + current_balance=Decimal('0'), + description='Invoices the business has issued but has not yet collected payment on.', + fully_qualified_category='Asset.Current', + fully_qualified_name='Fixed Asset', + id='1b6266d1-1e44-46c5-8eb5-a8f98e03124e', + is_bank_account=False, + metadata=shared.AccountMetadata( + is_deleted=False, + ), + modified_date='2022-10-23T00:00:00.000Z', + name='Accounts Receivable', + nominal_code='610', + source_modified_date='2022-10-23T00:00:00.000Z', + status=shared.AccountStatus.ACTIVE, + type=shared.AccountType.ASSET, + valid_datatype_links=[ + shared.AccountValidDataTypeLinks( + links=[ + 'unde', + ], + property='nulla', + ), + ], + ), + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', + timeout_in_minutes=544883, +) + +res = s.accounts.create(req) + +if res.create_account_response is not None: + # handle response +``` -replace me +## Available Resources and Operations + + +### [accounts](docs/sdks/accounts/README.md) + +* [create](docs/sdks/accounts/README.md#create) - Create account +* [get](docs/sdks/accounts/README.md#get) - Get account +* [get_create_model](docs/sdks/accounts/README.md#get_create_model) - Get create account model +* [list](docs/sdks/accounts/README.md#list) - List accounts + +### [companies](docs/sdks/companies/README.md) + +* [create](docs/sdks/companies/README.md#create) - Create company +* [delete](docs/sdks/companies/README.md#delete) - Delete a company +* [get](docs/sdks/companies/README.md#get) - Get company +* [list](docs/sdks/companies/README.md#list) - List companies +* [update](docs/sdks/companies/README.md#update) - Update company + +### [company_info](docs/sdks/companyinfo/README.md) + +* [get_accounting_profile](docs/sdks/companyinfo/README.md#get_accounting_profile) - Get company accounting profile + +### [connections](docs/sdks/connections/README.md) + +* [create](docs/sdks/connections/README.md#create) - Create connection +* [delete](docs/sdks/connections/README.md#delete) - Delete connection +* [get](docs/sdks/connections/README.md#get) - Get connection +* [list](docs/sdks/connections/README.md#list) - List connections +* [unlink](docs/sdks/connections/README.md#unlink) - Unlink connection + +### [journal_entries](docs/sdks/journalentries/README.md) + +* [create](docs/sdks/journalentries/README.md#create) - Create journal entry +* [delete](docs/sdks/journalentries/README.md#delete) - Delete journal entry +* [get](docs/sdks/journalentries/README.md#get) - Get journal entry +* [get_create_model](docs/sdks/journalentries/README.md#get_create_model) - Get create journal entry model +* [list](docs/sdks/journalentries/README.md#list) - List journal entries + +### [journals](docs/sdks/journals/README.md) + +* [create](docs/sdks/journals/README.md#create) - Create journal +* [get](docs/sdks/journals/README.md#get) - Get journal +* [get_create_model](docs/sdks/journals/README.md#get_create_model) - Get create journal model +* [list](docs/sdks/journals/README.md#list) - List journals + +### [manage_data](docs/sdks/managedata/README.md) + +* [get_data_status](docs/sdks/managedata/README.md#get_data_status) - Get data status +* [get_pull_operation](docs/sdks/managedata/README.md#get_pull_operation) - Get pull operation +* [get_push_operation](docs/sdks/managedata/README.md#get_push_operation) - Get push operation +* [list](docs/sdks/managedata/README.md#list) - List push operations +* [list_pull_operations](docs/sdks/managedata/README.md#list_pull_operations) - List pull operations +* [refresh_all_data_types](docs/sdks/managedata/README.md#refresh_all_data_types) - Refresh all data +* [refresh_data_type](docs/sdks/managedata/README.md#refresh_data_type) - Refresh data type + +### [tracking_categories](docs/sdks/trackingcategories/README.md) + +* [get](docs/sdks/trackingcategories/README.md#get) - Get tracking categories +* [list](docs/sdks/trackingcategories/README.md#list) - List tracking categories ### Library generated by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks) diff --git a/sync-for-payroll/RELEASES.md b/sync-for-payroll/RELEASES.md index 39cd2a292..0f2ba0dd7 100644 --- a/sync-for-payroll/RELEASES.md +++ b/sync-for-payroll/RELEASES.md @@ -8,4 +8,14 @@ Based on: ### Generated - [python v0.1.0] sync-for-payroll ### Releases -- [PyPI v0.1.0] https://pypi.org/project/codat-sync-for-payroll/0.1.0 - sync-for-payroll \ No newline at end of file +- [PyPI v0.1.0] https://pypi.org/project/codat-sync-for-payroll/0.1.0 - sync-for-payroll + +## 2023-09-13 11:41:56 +### Changes +Based on: +- OpenAPI Doc 3.0.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Sync-Payroll.yaml +- Speakeasy CLI 1.82.5 (2.108.3) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.2.0] sync-for-payroll +### Releases +- [PyPI v0.2.0] https://pypi.org/project/codat-sync-for-payroll/0.2.0 - sync-for-payroll \ No newline at end of file diff --git a/sync-for-payroll/USAGE.md b/sync-for-payroll/USAGE.md index 990b3bda9..f35648874 100755 --- a/sync-for-payroll/USAGE.md +++ b/sync-for-payroll/USAGE.md @@ -4,6 +4,7 @@ ```python import codatsyncpayroll from codatsyncpayroll.models import operations, shared +from decimal import Decimal s = codatsyncpayroll.CodatSyncPayroll( security=shared.Security( @@ -14,7 +15,7 @@ s = codatsyncpayroll.CodatSyncPayroll( req = operations.CreateAccountRequest( account=shared.Account( currency='USD', - current_balance=0, + current_balance=Decimal('0'), description='Invoices the business has issued but has not yet collected payment on.', fully_qualified_category='Asset.Current', fully_qualified_name='Fixed Asset', @@ -32,31 +33,15 @@ req = operations.CreateAccountRequest( valid_datatype_links=[ shared.AccountValidDataTypeLinks( links=[ - 'corrupti', - 'illum', - 'vel', - 'error', + 'unde', ], - property='deserunt', - ), - shared.AccountValidDataTypeLinks( - links=[ - 'iure', - 'magnam', - ], - property='debitis', - ), - shared.AccountValidDataTypeLinks( - links=[ - 'delectus', - ], - property='tempora', + property='nulla', ), ], ), company_id='8a210b68-6988-11ed-a1eb-0242ac120002', connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', - timeout_in_minutes=383441, + timeout_in_minutes=544883, ) res = s.accounts.create(req) diff --git a/sync-for-payroll/docs/models/operations/deletejournalentryrequest.md b/sync-for-payroll/docs/models/operations/deletejournalentryrequest.md new file mode 100755 index 000000000..f86c6d65e --- /dev/null +++ b/sync-for-payroll/docs/models/operations/deletejournalentryrequest.md @@ -0,0 +1,9 @@ +# DeleteJournalEntryRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `journal_entry_id` | *str* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/sync-for-payroll/docs/models/operations/deletejournalentryresponse.md b/sync-for-payroll/docs/models/operations/deletejournalentryresponse.md new file mode 100755 index 000000000..7710e623e --- /dev/null +++ b/sync-for-payroll/docs/models/operations/deletejournalentryresponse.md @@ -0,0 +1,12 @@ +# DeleteJournalEntryResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `push_operation` | [Optional[shared.PushOperation]](../../models/shared/pushoperation.md) | :heavy_minus_sign: | OK | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payroll/docs/models/shared/pushoperationsummary.md b/sync-for-payroll/docs/models/operations/getaccountingprofilecompanyinformation.md similarity index 90% rename from sync-for-payroll/docs/models/shared/pushoperationsummary.md rename to sync-for-payroll/docs/models/operations/getaccountingprofilecompanyinformation.md index d84387756..685380660 100755 --- a/sync-for-payroll/docs/models/shared/pushoperationsummary.md +++ b/sync-for-payroll/docs/models/operations/getaccountingprofilecompanyinformation.md @@ -1,20 +1,28 @@ -# PushOperationSummary +# GetAccountingProfileCompanyInformation + +> View the coverage for company info in the Data coverage explorer. + +Company info provides standard details about a linked company such as their address, phone number, and company registration. + +> **Company information or companies?** +> +> Company information is standard information that is held in the accounting platform about a company. `Companies` is an endpoint that lists businesses in the Codat system that have linked and shared their data sources. ## Fields | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `changes` | list[[PushOperationChange](../../models/shared/pushoperationchange.md)] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | -| `company_id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `completed_on_utc` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | -| `data_connection_key` | *str* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `data_type` | [Optional[DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | -| `error_message` | *Optional[str]* | :heavy_minus_sign: | N/A | | -| `push_operation_key` | *str* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | -| `requested_on_utc` | *str* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | -| `status` | [PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The status of the push operation. | | -| `status_code` | *int* | :heavy_check_mark: | N/A | | -| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | N/A | | -| ~~`timeout_in_seconds`~~ | *Optional[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | -| `validation` | [Optional[Validation]](../../models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file +| `accounting_platform_ref` | *Optional[str]* | :heavy_minus_sign: | Identifier or reference for the company in the accounting platform. | | +| `addresses` | list[[GetAccountingProfileCompanyInformationAccountingAddress](../../models/operations/getaccountingprofilecompanyinformationaccountingaddress.md)] | :heavy_minus_sign: | An array of Addresses. | | +| `base_currency` | *Optional[str]* | :heavy_minus_sign: | Currency set in the accounting platform of the linked company. Used by the currency rate. | | +| `company_legal_name` | *Optional[str]* | :heavy_minus_sign: | Registered legal name of the linked company. | | +| `company_name` | *Optional[str]* | :heavy_minus_sign: | Name of the linked company. | | +| `created_date` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | +| `financial_year_start_date` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | +| `ledger_lock_date` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | +| `phone_numbers` | list[[GetAccountingProfileCompanyInformationPhone](../../models/operations/getaccountingprofilecompanyinformationphone.md)] | :heavy_minus_sign: | An array of phone numbers. | | +| `registration_number` | *Optional[str]* | :heavy_minus_sign: | Registration number given to the linked company by the companies authority in the country of origin. In the UK this is Companies House. | | +| `source_urls` | dict[str, *str*] | :heavy_minus_sign: | URL addresses for the accounting source.

For example, for Xero integrations two URLs are returned. These have many potential use cases, such as [deep linking](https://developer.xero.com/documentation/api-guides/deep-link-xero). | | +| `tax_number` | *Optional[str]* | :heavy_minus_sign: | Company tax number. | | +| `web_links` | list[[GetAccountingProfileCompanyInformationWeblink](../../models/operations/getaccountingprofilecompanyinformationweblink.md)] | :heavy_minus_sign: | An array of weblinks. | | \ No newline at end of file diff --git a/sync-for-payroll/docs/models/operations/getaccountingprofilecompanyinformationaccountingaddress.md b/sync-for-payroll/docs/models/operations/getaccountingprofilecompanyinformationaccountingaddress.md new file mode 100755 index 000000000..ba39df505 --- /dev/null +++ b/sync-for-payroll/docs/models/operations/getaccountingprofilecompanyinformationaccountingaddress.md @@ -0,0 +1,14 @@ +# GetAccountingProfileCompanyInformationAccountingAddress + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `city` | *Optional[str]* | :heavy_minus_sign: | City of the customer address. | +| `country` | *Optional[str]* | :heavy_minus_sign: | Country of the customer address. | +| `line1` | *Optional[str]* | :heavy_minus_sign: | Line 1 of the customer address. | +| `line2` | *Optional[str]* | :heavy_minus_sign: | Line 2 of the customer address. | +| `postal_code` | *Optional[str]* | :heavy_minus_sign: | Postal code or zip code. | +| `region` | *Optional[str]* | :heavy_minus_sign: | Region of the customer address. | +| `type` | [shared.Onecompanies1Percent7BcompanyIDPercent7D1data1infoGetResponses200ContentApplication1jsonSchemaPropertiesAddressesItemsDefinitionsAccountingAddressType](../../models/shared/onecompanies1percent7bcompanyidpercent7d1data1infogetresponses200contentapplication1jsonschemapropertiesaddressesitemsdefinitionsaccountingaddresstype.md) | :heavy_check_mark: | The type of the address | \ No newline at end of file diff --git a/sync-for-payroll/docs/models/operations/getaccountingprofilecompanyinformationphone.md b/sync-for-payroll/docs/models/operations/getaccountingprofilecompanyinformationphone.md new file mode 100755 index 000000000..a3da44cb8 --- /dev/null +++ b/sync-for-payroll/docs/models/operations/getaccountingprofilecompanyinformationphone.md @@ -0,0 +1,9 @@ +# GetAccountingProfileCompanyInformationPhone + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `number` | *str* | :heavy_check_mark: | A phone number. | +44 25691 154789 | +| `type` | [shared.Onecompanies1Percent7BcompanyIDPercent7D1data1infoGetResponses200ContentApplication1jsonSchemaPropertiesPhoneNumbersItemsDefinitionsPhoneNumberType](../../models/shared/onecompanies1percent7bcompanyidpercent7d1data1infogetresponses200contentapplication1jsonschemapropertiesphonenumbersitemsdefinitionsphonenumbertype.md) | :heavy_check_mark: | The type of phone number | | \ No newline at end of file diff --git a/sync-for-payroll/docs/models/operations/getaccountingprofilecompanyinformationweblink.md b/sync-for-payroll/docs/models/operations/getaccountingprofilecompanyinformationweblink.md new file mode 100755 index 000000000..ee089aa16 --- /dev/null +++ b/sync-for-payroll/docs/models/operations/getaccountingprofilecompanyinformationweblink.md @@ -0,0 +1,11 @@ +# GetAccountingProfileCompanyInformationWeblink + +Weblink associated with the company. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | [Optional[GetAccountingProfileCompanyInformationWeblinkType]](../../models/operations/getaccountingprofilecompanyinformationweblinktype.md) | :heavy_minus_sign: | The type of the weblink. | +| `url` | *Optional[str]* | :heavy_minus_sign: | The full URL for the weblink. | \ No newline at end of file diff --git a/sync-for-payroll/docs/models/operations/getaccountingprofilecompanyinformationweblinktype.md b/sync-for-payroll/docs/models/operations/getaccountingprofilecompanyinformationweblinktype.md new file mode 100755 index 000000000..37222edd8 --- /dev/null +++ b/sync-for-payroll/docs/models/operations/getaccountingprofilecompanyinformationweblinktype.md @@ -0,0 +1,12 @@ +# GetAccountingProfileCompanyInformationWeblinkType + +The type of the weblink. + + +## Values + +| Name | Value | +| --------- | --------- | +| `WEBSITE` | Website | +| `SOCIAL` | Social | +| `UNKNOWN` | Unknown | \ No newline at end of file diff --git a/sync-for-payroll/docs/models/operations/getaccountingprofilerequest.md b/sync-for-payroll/docs/models/operations/getaccountingprofilerequest.md new file mode 100755 index 000000000..563353fc3 --- /dev/null +++ b/sync-for-payroll/docs/models/operations/getaccountingprofilerequest.md @@ -0,0 +1,8 @@ +# GetAccountingProfileRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/sync-for-payroll/docs/models/operations/getaccountingprofileresponse.md b/sync-for-payroll/docs/models/operations/getaccountingprofileresponse.md new file mode 100755 index 000000000..136bff4e5 --- /dev/null +++ b/sync-for-payroll/docs/models/operations/getaccountingprofileresponse.md @@ -0,0 +1,12 @@ +# GetAccountingProfileResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `company_information` | [Optional[GetAccountingProfileCompanyInformation]](../../models/operations/getaccountingprofilecompanyinformation.md) | :heavy_minus_sign: | Success | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payroll/docs/models/operations/listpulloperationsresponse.md b/sync-for-payroll/docs/models/operations/listpulloperationsresponse.md index 74c62e23a..23240bd20 100755 --- a/sync-for-payroll/docs/models/operations/listpulloperationsresponse.md +++ b/sync-for-payroll/docs/models/operations/listpulloperationsresponse.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | N/A | -| `data_connection_history` | [Optional[shared.DataConnectionHistory]](../../models/shared/dataconnectionhistory.md) | :heavy_minus_sign: | OK | -| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | -| `status_code` | *int* | :heavy_check_mark: | N/A | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `pull_operations` | [Optional[shared.PullOperations]](../../models/shared/pulloperations.md) | :heavy_minus_sign: | OK | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payroll/docs/models/operations/listpushoperationsresponse.md b/sync-for-payroll/docs/models/operations/listpushoperationsresponse.md index 5a4d7859f..db6720eea 100755 --- a/sync-for-payroll/docs/models/operations/listpushoperationsresponse.md +++ b/sync-for-payroll/docs/models/operations/listpushoperationsresponse.md @@ -7,6 +7,6 @@ | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | | `content_type` | *str* | :heavy_check_mark: | N/A | | `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | -| `push_history_response` | [Optional[shared.PushHistoryResponse]](../../models/shared/pushhistoryresponse.md) | :heavy_minus_sign: | OK | +| `push_operations` | [Optional[shared.PushOperations]](../../models/shared/pushoperations.md) | :heavy_minus_sign: | OK | | `status_code` | *int* | :heavy_check_mark: | N/A | | `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payroll/docs/models/operations/unlinkconnectionrequest.md b/sync-for-payroll/docs/models/operations/unlinkconnectionrequest.md index 2ed1d78dc..d20863dce 100755 --- a/sync-for-payroll/docs/models/operations/unlinkconnectionrequest.md +++ b/sync-for-payroll/docs/models/operations/unlinkconnectionrequest.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `request_body` | [Optional[UnlinkConnectionRequestBody]](../../models/operations/unlinkconnectionrequestbody.md) | :heavy_minus_sign: | N/A | | -| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `request_body` | [Optional[UnlinkConnectionUpdateConnection]](../../models/operations/unlinkconnectionupdateconnection.md) | :heavy_minus_sign: | N/A | | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/sync-for-payroll/docs/models/operations/unlinkconnectionrequestbody.md b/sync-for-payroll/docs/models/operations/unlinkconnectionrequestbody.md deleted file mode 100755 index 276bf1330..000000000 --- a/sync-for-payroll/docs/models/operations/unlinkconnectionrequestbody.md +++ /dev/null @@ -1,8 +0,0 @@ -# UnlinkConnectionRequestBody - - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `status` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payroll/docs/models/operations/unlinkconnectionupdateconnection.md b/sync-for-payroll/docs/models/operations/unlinkconnectionupdateconnection.md new file mode 100755 index 000000000..5a5f2911b --- /dev/null +++ b/sync-for-payroll/docs/models/operations/unlinkconnectionupdateconnection.md @@ -0,0 +1,8 @@ +# UnlinkConnectionUpdateConnection + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `status` | [Optional[shared.DataConnectionStatus]](../../models/shared/dataconnectionstatus.md) | :heavy_minus_sign: | The current authorization status of the data connection. | \ No newline at end of file diff --git a/sync-for-payroll/docs/models/shared/account.md b/sync-for-payroll/docs/models/shared/account.md index bb1d27e3d..c11ac46f7 100755 --- a/sync-for-payroll/docs/models/shared/account.md +++ b/sync-for-payroll/docs/models/shared/account.md @@ -35,7 +35,7 @@ To determine the list of allowed categories for a specific integration, you can: | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `currency` | *Optional[str]* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | -| `current_balance` | *Optional[float]* | :heavy_minus_sign: | Current balance in the account. | 0 | +| `current_balance` | *Optional[Decimal]* | :heavy_minus_sign: | Current balance in the account. | 0 | | `description` | *Optional[str]* | :heavy_minus_sign: | Description for the account. | Invoices the business has issued but has not yet collected payment on. | | `fully_qualified_category` | *Optional[str]* | :heavy_minus_sign: | Full category of the account.

For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. | Asset.Current | | `fully_qualified_name` | *Optional[str]* | :heavy_minus_sign: | Full name of the account, for example:
- `Cash On Hand`
- `Rents Held In Trust`
- `Fixed Asset` | Cash On Hand | diff --git a/sync-for-payroll/docs/models/shared/accounts.md b/sync-for-payroll/docs/models/shared/accounts.md index b75102877..c1e6401bd 100755 --- a/sync-for-payroll/docs/models/shared/accounts.md +++ b/sync-for-payroll/docs/models/shared/accounts.md @@ -1,7 +1,5 @@ # Accounts -Success - ## Fields diff --git a/sync-for-payroll/docs/models/shared/companies.md b/sync-for-payroll/docs/models/shared/companies.md index 621899fbb..c4c6e0399 100755 --- a/sync-for-payroll/docs/models/shared/companies.md +++ b/sync-for-payroll/docs/models/shared/companies.md @@ -1,7 +1,5 @@ # Companies -OK - ## Fields diff --git a/sync-for-payroll/docs/models/shared/connections.md b/sync-for-payroll/docs/models/shared/connections.md index ba1135508..d9a1a748e 100755 --- a/sync-for-payroll/docs/models/shared/connections.md +++ b/sync-for-payroll/docs/models/shared/connections.md @@ -1,7 +1,5 @@ # Connections -OK - ## Fields diff --git a/sync-for-payroll/docs/models/shared/createaccountresponse.md b/sync-for-payroll/docs/models/shared/createaccountresponse.md index 5c85a35eb..0b96d3a90 100755 --- a/sync-for-payroll/docs/models/shared/createaccountresponse.md +++ b/sync-for-payroll/docs/models/shared/createaccountresponse.md @@ -1,7 +1,5 @@ # CreateAccountResponse -Success - ## Fields diff --git a/sync-for-payroll/docs/models/shared/createjournalentryresponse.md b/sync-for-payroll/docs/models/shared/createjournalentryresponse.md index 0f460fa78..dee0841df 100755 --- a/sync-for-payroll/docs/models/shared/createjournalentryresponse.md +++ b/sync-for-payroll/docs/models/shared/createjournalentryresponse.md @@ -1,7 +1,5 @@ # CreateJournalEntryResponse -Success - ## Fields diff --git a/sync-for-payroll/docs/models/shared/createjournalresponse.md b/sync-for-payroll/docs/models/shared/createjournalresponse.md index aef3a0122..67ee8f368 100755 --- a/sync-for-payroll/docs/models/shared/createjournalresponse.md +++ b/sync-for-payroll/docs/models/shared/createjournalresponse.md @@ -1,7 +1,5 @@ # CreateJournalResponse -Success - ## Fields diff --git a/sync-for-payroll/docs/models/shared/errormessage.md b/sync-for-payroll/docs/models/shared/errormessage.md index b32400646..4f34c9a64 100755 --- a/sync-for-payroll/docs/models/shared/errormessage.md +++ b/sync-for-payroll/docs/models/shared/errormessage.md @@ -1,7 +1,5 @@ # ErrorMessage -Your `query` parameter was not correctly formed - ## Fields diff --git a/sync-for-payroll/docs/models/shared/journalentries.md b/sync-for-payroll/docs/models/shared/journalentries.md index 8da6895b4..3e4ad1eed 100755 --- a/sync-for-payroll/docs/models/shared/journalentries.md +++ b/sync-for-payroll/docs/models/shared/journalentries.md @@ -1,7 +1,5 @@ # JournalEntries -Success - ## Fields diff --git a/sync-for-payroll/docs/models/shared/journalentry.md b/sync-for-payroll/docs/models/shared/journalentry.md index b01be1d59..b2d384529 100755 --- a/sync-for-payroll/docs/models/shared/journalentry.md +++ b/sync-for-payroll/docs/models/shared/journalentry.md @@ -38,5 +38,5 @@ In Codat a journal entry contains details of: | `posted_on` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | | `record_ref` | [Optional[JournalEntryRecordReference]](../../models/shared/journalentryrecordreference.md) | :heavy_minus_sign: | Links the current record to the underlying record or data type that created it.

For example, if a journal entry is generated based on an invoice, this property allows you to connect the journal entry to the underlying invoice in our data model. | | | `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | -| `supplemental_data` | [Optional[JournalEntrySupplementalData]](../../models/shared/journalentrysupplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/additional-data) about supplemental data. | | +| `supplemental_data` | [Optional[JournalEntrySupplementalData]](../../models/shared/journalentrysupplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | | `updated_on` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | \ No newline at end of file diff --git a/sync-for-payroll/docs/models/shared/journalentrysupplementaldata.md b/sync-for-payroll/docs/models/shared/journalentrysupplementaldata.md index 49ac7fd1c..4e1a2c76e 100755 --- a/sync-for-payroll/docs/models/shared/journalentrysupplementaldata.md +++ b/sync-for-payroll/docs/models/shared/journalentrysupplementaldata.md @@ -2,7 +2,7 @@ Supplemental data is additional data you can include in our standard data types. -It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/additional-data) about supplemental data. +It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. ## Fields diff --git a/sync-for-payroll/docs/models/shared/journalline.md b/sync-for-payroll/docs/models/shared/journalline.md index 383211ebb..689da407c 100755 --- a/sync-for-payroll/docs/models/shared/journalline.md +++ b/sync-for-payroll/docs/models/shared/journalline.md @@ -8,5 +8,5 @@ | `account_ref` | [Optional[AccountRef]](../../models/shared/accountref.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | | `currency` | *Optional[str]* | :heavy_minus_sign: | Currency for the journal line item. | | `description` | *Optional[str]* | :heavy_minus_sign: | Description of the journal line item. | -| `net_amount` | *float* | :heavy_check_mark: | Amount for the journal line. Debit entries are considered positive, and credit entries are considered negative. | +| `net_amount` | *Decimal* | :heavy_check_mark: | Amount for the journal line. Debit entries are considered positive, and credit entries are considered negative. | | `tracking` | [Optional[JournalLineTracking]](../../models/shared/journallinetracking.md) | :heavy_minus_sign: | List of record refs associated with the tracking information for the line (eg to a Tracking Category, or customer etc.) | \ No newline at end of file diff --git a/sync-for-payroll/docs/models/shared/journals.md b/sync-for-payroll/docs/models/shared/journals.md index 281db1f21..b6b1f628a 100755 --- a/sync-for-payroll/docs/models/shared/journals.md +++ b/sync-for-payroll/docs/models/shared/journals.md @@ -1,7 +1,5 @@ # Journals -Success - ## Fields diff --git a/sync-for-payroll/docs/models/shared/onecompanies1percent7bcompanyidpercent7d1data1infogetresponses200contentapplication1jsonschemapropertiesaddressesitemsdefinitionsaccountingaddresstype.md b/sync-for-payroll/docs/models/shared/onecompanies1percent7bcompanyidpercent7d1data1infogetresponses200contentapplication1jsonschemapropertiesaddressesitemsdefinitionsaccountingaddresstype.md new file mode 100755 index 000000000..70e4393c7 --- /dev/null +++ b/sync-for-payroll/docs/models/shared/onecompanies1percent7bcompanyidpercent7d1data1infogetresponses200contentapplication1jsonschemapropertiesaddressesitemsdefinitionsaccountingaddresstype.md @@ -0,0 +1,12 @@ +# Onecompanies1Percent7BcompanyIDPercent7D1data1infoGetResponses200ContentApplication1jsonSchemaPropertiesAddressesItemsDefinitionsAccountingAddressType + +The type of the address + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `UNKNOWN` | Unknown | +| `BILLING` | Billing | +| `DELIVERY` | Delivery | \ No newline at end of file diff --git a/sync-for-payroll/docs/models/shared/onecompanies1percent7bcompanyidpercent7d1data1infogetresponses200contentapplication1jsonschemapropertiesphonenumbersitemsdefinitionsphonenumbertype.md b/sync-for-payroll/docs/models/shared/onecompanies1percent7bcompanyidpercent7d1data1infogetresponses200contentapplication1jsonschemapropertiesphonenumbersitemsdefinitionsphonenumbertype.md new file mode 100755 index 000000000..af9635e0e --- /dev/null +++ b/sync-for-payroll/docs/models/shared/onecompanies1percent7bcompanyidpercent7d1data1infogetresponses200contentapplication1jsonschemapropertiesphonenumbersitemsdefinitionsphonenumbertype.md @@ -0,0 +1,14 @@ +# Onecompanies1Percent7BcompanyIDPercent7D1data1infoGetResponses200ContentApplication1jsonSchemaPropertiesPhoneNumbersItemsDefinitionsPhoneNumberType + +The type of phone number + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `PRIMARY` | Primary | +| `LANDLINE` | Landline | +| `MOBILE` | Mobile | +| `FAX` | Fax | +| `UNKNOWN` | Unknown | \ No newline at end of file diff --git a/sync-for-payroll/docs/models/shared/dataconnectionhistory.md b/sync-for-payroll/docs/models/shared/pulloperations.md similarity index 98% rename from sync-for-payroll/docs/models/shared/dataconnectionhistory.md rename to sync-for-payroll/docs/models/shared/pulloperations.md index 5e9372578..afe4f6f90 100755 --- a/sync-for-payroll/docs/models/shared/dataconnectionhistory.md +++ b/sync-for-payroll/docs/models/shared/pulloperations.md @@ -1,6 +1,4 @@ -# DataConnectionHistory - -OK +# PullOperations ## Fields diff --git a/sync-for-payroll/docs/models/shared/pushhistoryresponse.md b/sync-for-payroll/docs/models/shared/pushhistoryresponse.md deleted file mode 100755 index abc66948d..000000000 --- a/sync-for-payroll/docs/models/shared/pushhistoryresponse.md +++ /dev/null @@ -1,14 +0,0 @@ -# PushHistoryResponse - -OK - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `links` | [Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | -| `page_number` | *int* | :heavy_check_mark: | N/A | -| `page_size` | *int* | :heavy_check_mark: | N/A | -| `results` | list[[PushOperationSummary](../../models/shared/pushoperationsummary.md)] | :heavy_minus_sign: | N/A | -| `total_results` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sync-for-payroll/docs/models/shared/pushoperation.md b/sync-for-payroll/docs/models/shared/pushoperation.md index fb7684108..8537a2c10 100755 --- a/sync-for-payroll/docs/models/shared/pushoperation.md +++ b/sync-for-payroll/docs/models/shared/pushoperation.md @@ -1,7 +1,5 @@ # PushOperation -OK - ## Fields @@ -10,7 +8,6 @@ OK | `changes` | list[[PushOperationChange](../../models/shared/pushoperationchange.md)] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | | `company_id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `completed_on_utc` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | -| `data` | dict[str, *Any*] | :heavy_minus_sign: | Object submitted in push operation. | | | `data_connection_key` | *str* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `data_type` | [Optional[DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | | `error_message` | *Optional[str]* | :heavy_minus_sign: | N/A | | diff --git a/sync-for-payroll/docs/models/shared/pushoperations.md b/sync-for-payroll/docs/models/shared/pushoperations.md new file mode 100755 index 000000000..83fd674fe --- /dev/null +++ b/sync-for-payroll/docs/models/shared/pushoperations.md @@ -0,0 +1,12 @@ +# PushOperations + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `links` | [Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | +| `page_number` | *int* | :heavy_check_mark: | N/A | +| `page_size` | *int* | :heavy_check_mark: | N/A | +| `results` | list[[PushOperation](../../models/shared/pushoperation.md)] | :heavy_minus_sign: | N/A | +| `total_results` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sync-for-payroll/docs/models/shared/pushoption.md b/sync-for-payroll/docs/models/shared/pushoption.md index 5a6b4939e..a9a0e479a 100755 --- a/sync-for-payroll/docs/models/shared/pushoption.md +++ b/sync-for-payroll/docs/models/shared/pushoption.md @@ -1,7 +1,5 @@ # PushOption -OK - ## Fields diff --git a/sync-for-payroll/docs/models/shared/trackingcategories.md b/sync-for-payroll/docs/models/shared/trackingcategories.md index 091e6623c..f328dbae4 100755 --- a/sync-for-payroll/docs/models/shared/trackingcategories.md +++ b/sync-for-payroll/docs/models/shared/trackingcategories.md @@ -1,7 +1,5 @@ # TrackingCategories -Success - ## Fields diff --git a/sync-for-payroll/docs/sdks/accounts/README.md b/sync-for-payroll/docs/sdks/accounts/README.md index 174ae14b7..aeacf34dc 100755 --- a/sync-for-payroll/docs/sdks/accounts/README.md +++ b/sync-for-payroll/docs/sdks/accounts/README.md @@ -29,6 +29,7 @@ Check out our [coverage explorer](https://knowledge.codat.io/supported-features/ ```python import codatsyncpayroll from codatsyncpayroll.models import operations, shared +from decimal import Decimal s = codatsyncpayroll.CodatSyncPayroll( security=shared.Security( @@ -38,11 +39,11 @@ s = codatsyncpayroll.CodatSyncPayroll( req = operations.CreateAccountRequest( account=shared.Account( - currency='USD', - current_balance=0, + currency='EUR', + current_balance=Decimal('0'), description='Invoices the business has issued but has not yet collected payment on.', fully_qualified_category='Asset.Current', - fully_qualified_name='Fixed Asset', + fully_qualified_name='Cash On Hand', id='1b6266d1-1e44-46c5-8eb5-a8f98e03124e', is_bank_account=False, metadata=shared.AccountMetadata( @@ -57,24 +58,15 @@ req = operations.CreateAccountRequest( valid_datatype_links=[ shared.AccountValidDataTypeLinks( links=[ - 'nisi', - 'recusandae', - 'temporibus', + 'suscipit', ], - property='ab', - ), - shared.AccountValidDataTypeLinks( - links=[ - 'veritatis', - 'deserunt', - ], - property='perferendis', + property='iure', ), ], ), company_id='8a210b68-6988-11ed-a1eb-0242ac120002', connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', - timeout_in_minutes=368241, + timeout_in_minutes=297534, ) res = s.accounts.create(req) @@ -217,7 +209,7 @@ req = operations.ListAccountsRequest( order_by='-modifiedDate', page=1, page_size=100, - query='sapiente', + query='ipsa', ) res = s.accounts.list(req) diff --git a/sync-for-payroll/docs/sdks/codatsyncpayroll/README.md b/sync-for-payroll/docs/sdks/codatsyncpayroll/README.md index fd38ec307..8e32358bf 100755 --- a/sync-for-payroll/docs/sdks/codatsyncpayroll/README.md +++ b/sync-for-payroll/docs/sdks/codatsyncpayroll/README.md @@ -6,7 +6,22 @@ Sync for Payroll: The API for Sync for Payroll. Sync for Payroll is an API and a set of supporting tools built to help integrate your customers' payroll data from their HR and payroll platforms into their accounting platforms and to support its reconciliation. -[Read More...](https://docs.codat.io/payroll/overview) +[Explore product](https://docs.codat.io/payroll/overview) | [See OpenAPI spec](https://github.com/codatio/oas) + +--- + +## Endpoints + +| Endpoints | Description | +|:---------------------|:-----------------------------------------------------------------------------------------------------------| +| Companies | Create and manage your SMB users' companies. | +| Connections | Create new and manage existing data connections for a company. | +| Accounts | Get, create, and update Accounts. | +| Journal entries | Get, create, and update Journal entries. | +| Journals | Get, create, and update Journals. | +| Tracking categories | Get, create, and update Tracking Categories for additional categorization of payroll components. | +| Company info | View company profile from the source platform. | +| Manage data | Control how data is retrieved from an integration. | ### Available Operations diff --git a/sync-for-payroll/docs/sdks/companies/README.md b/sync-for-payroll/docs/sdks/companies/README.md index 804a30ae1..2244eb91b 100755 --- a/sync-for-payroll/docs/sdks/companies/README.md +++ b/sync-for-payroll/docs/sdks/companies/README.md @@ -155,7 +155,7 @@ req = operations.ListCompaniesRequest( order_by='-modifiedDate', page=1, page_size=100, - query='quo', + query='delectus', ) res = s.companies.list(req) diff --git a/sync-for-payroll/docs/sdks/companyinfo/README.md b/sync-for-payroll/docs/sdks/companyinfo/README.md new file mode 100755 index 000000000..51153e5a7 --- /dev/null +++ b/sync-for-payroll/docs/sdks/companyinfo/README.md @@ -0,0 +1,48 @@ +# company_info + +## Overview + +View company information fetched from the source platform. + +### Available Operations + +* [get_accounting_profile](#get_accounting_profile) - Get company accounting profile + +## get_accounting_profile + +Gets the latest basic info for a company. + +### Example Usage + +```python +import codatsyncpayroll +from codatsyncpayroll.models import operations, shared + +s = codatsyncpayroll.CodatSyncPayroll( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.GetAccountingProfileRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', +) + +res = s.company_info.get_accounting_profile(req) + +if res.company_information is not None: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetAccountingProfileRequest](../../models/operations/getaccountingprofilerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + + +### Response + +**[operations.GetAccountingProfileResponse](../../models/operations/getaccountingprofileresponse.md)** + diff --git a/sync-for-payroll/docs/sdks/connections/README.md b/sync-for-payroll/docs/sdks/connections/README.md index 447d1db16..816bfc44f 100755 --- a/sync-for-payroll/docs/sdks/connections/README.md +++ b/sync-for-payroll/docs/sdks/connections/README.md @@ -32,7 +32,7 @@ s = codatsyncpayroll.CodatSyncPayroll( req = operations.CreateConnectionRequest( request_body=operations.CreateConnectionRequestBody( - platform_key='odit', + platform_key='tempora', ), company_id='8a210b68-6988-11ed-a1eb-0242ac120002', ) @@ -158,7 +158,7 @@ req = operations.ListConnectionsRequest( order_by='-modifiedDate', page=1, page_size=100, - query='at', + query='suscipit', ) res = s.connections.list(req) @@ -197,8 +197,8 @@ s = codatsyncpayroll.CodatSyncPayroll( ) req = operations.UnlinkConnectionRequest( - request_body=operations.UnlinkConnectionRequestBody( - status='at', + request_body=operations.UnlinkConnectionUpdateConnection( + status=shared.DataConnectionStatus.LINKED, ), company_id='8a210b68-6988-11ed-a1eb-0242ac120002', connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', diff --git a/sync-for-payroll/docs/sdks/journalentries/README.md b/sync-for-payroll/docs/sdks/journalentries/README.md index ceece049f..eb492aa3b 100755 --- a/sync-for-payroll/docs/sdks/journalentries/README.md +++ b/sync-for-payroll/docs/sdks/journalentries/README.md @@ -7,6 +7,7 @@ Journal entries ### Available Operations * [create](#create) - Create journal entry +* [delete](#delete) - Delete journal entry * [get](#get) - Get journal entry * [get_create_model](#get_create_model) - Get create journal entry model * [list](#list) - List journal entries @@ -29,6 +30,7 @@ Check out our [coverage explorer](https://knowledge.codat.io/supported-features/ ```python import codatsyncpayroll from codatsyncpayroll.models import operations, shared +from decimal import Decimal s = codatsyncpayroll.CodatSyncPayroll( security=shared.Security( @@ -39,38 +41,30 @@ s = codatsyncpayroll.CodatSyncPayroll( req = operations.CreateJournalEntryRequest( journal_entry=shared.JournalEntry( created_on='2022-10-23T00:00:00.000Z', - description='molestiae', - id='cc78ca1b-a928-4fc8-9674-2cb739205929', + description='placeat', + id='8796ed15-1a05-4dfc-addf-7cc78ca1ba92', journal_lines=[ shared.JournalLine( account_ref=shared.AccountRef( - id='96fea759-6eb1-40fa-aa23-52c5955907af', - name='Juan O'Hara', + id='8fc81674-2cb7-4392-8592-9396fea7596e', + name='Roger Beier', ), - currency='consequuntur', - description='repellat', - net_amount=6531.08, + currency='mollitia', + description='laborum', + net_amount=Decimal('1709.09'), tracking=shared.JournalLineTracking( record_refs=[ shared.RecordRef( - data_type='invoice', - id='67739251-aa52-4c3f-9ad0-19da1ffe78f0', - ), - shared.RecordRef( - data_type='accountTransaction', - id='7b0074f1-5471-4b5e-ae13-b99d488e1e91', - ), - shared.RecordRef( - data_type='transfer', - id='450ad2ab-d442-4698-82d5-02a94bb4f63c', + data_type='journalEntry', + id='52c59559-07af-4f1a-ba2f-a9467739251a', ), ], ), ), ], journal_ref=shared.JournalRef( - id='969e9a3e-fa77-4dfb-94cd-66ae395efb9b', - name='Nelson Lesch', + id='a52c3f5a-d019-4da1-bfe7-8f097b0074f1', + name='Miss Valerie Kshlerin', ), metadata=shared.Metadata( is_deleted=False, @@ -78,14 +72,14 @@ req = operations.CreateJournalEntryRequest( modified_date='2022-10-23T00:00:00.000Z', posted_on='2022-10-23T00:00:00.000Z', record_ref=shared.JournalEntryRecordReference( - data_type='invoice', - id='997074ba-4469-4b6e-a141-959890afa563', + data_type='transfer', + id='13b99d48-8e1e-491e-850a-d2abd4426980', ), source_modified_date='2022-10-23T00:00:00.000Z', supplemental_data=shared.JournalEntrySupplementalData( content={ - "nemo": { - "iure": 'doloribus', + "assumenda": { + "ipsam": 'alias', }, }, ), @@ -93,7 +87,7 @@ req = operations.CreateJournalEntryRequest( ), company_id='8a210b68-6988-11ed-a1eb-0242ac120002', connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', - timeout_in_minutes=260341, + timeout_in_minutes=677817, ) res = s.journal_entries.create(req) @@ -115,6 +109,75 @@ if res.create_journal_entry_response is not None: **[operations.CreateJournalEntryResponse](../../models/operations/createjournalentryresponse.md)** +## delete + +> **Use with caution** +> +>Because journal entries underpin every transaction in an accounting platform, deleting a journal entry can affect every transaction for a given company. +> +> **Before you proceed, make sure you understand the implications of deleting journal entries from an accounting perspective.** + +The *Delete journal entry* endpoint allows you to delete a specified journal entry from an accounting platform. + +[Journal entries](https://docs.codat.io/sync-for-payroll-api#/schemas/JournalEntry) are made in a company's general ledger, or accounts, when transactions are approved. + +### Process +1. Pass the `{journalEntryId}` to the *Delete journal entry* endpoint and store the `pushOperationKey` returned. +2. Check the status of the delete by checking the status of push operation either via + 1. [Push operation webhook](https://docs.codat.io/introduction/webhooks/core-rules-types#push-operation-status-has-changed) (advised), + 2. [Push operation status endpoint](https://docs.codat.io/sync-for-payroll-api#/operations/get-push-operation). + + A `Success` status indicates that the journal entry object was deleted from the accounting platform. +3. (Optional) Check that the journal entry was deleted from the accounting platform. + +### Effect on related objects + +Be aware that deleting a journal entry from an accounting platform might cause related objects to be modified. For example, if you delete the journal entry for a paid invoice in QuickBooks Online, the invoice is deleted but the payment against that invoice is not. The payment is converted to a payment on account. + +## Integration specifics +Integrations that support soft delete do not permanently delete the object in the accounting platform. + +| Integration | Soft Deleted | +|-------------|--------------| +| QuickBooks Online | Yes | + + +### Example Usage + +```python +import codatsyncpayroll +from codatsyncpayroll.models import operations, shared + +s = codatsyncpayroll.CodatSyncPayroll( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.DeleteJournalEntryRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + journal_entry_id='excepturi', +) + +res = s.journal_entries.delete(req) + +if res.push_operation is not None: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `request` | [operations.DeleteJournalEntryRequest](../../models/operations/deletejournalentryrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + + +### Response + +**[operations.DeleteJournalEntryResponse](../../models/operations/deletejournalentryresponse.md)** + + ## get The *Get journal entry* endpoint returns a single journal entry for a given `journalEntryId`. @@ -140,7 +203,7 @@ s = codatsyncpayroll.CodatSyncPayroll( req = operations.GetJournalEntryRequest( company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - journal_entry_id='maxime', + journal_entry_id='tempora', ) res = s.journal_entries.get(req) @@ -237,7 +300,7 @@ req = operations.ListJournalEntriesRequest( order_by='-modifiedDate', page=1, page_size=100, - query='deleniti', + query='facilis', ) res = s.journal_entries.list(req) diff --git a/sync-for-payroll/docs/sdks/journals/README.md b/sync-for-payroll/docs/sdks/journals/README.md index 9a1e0107f..f7a319648 100755 --- a/sync-for-payroll/docs/sdks/journals/README.md +++ b/sync-for-payroll/docs/sdks/journals/README.md @@ -40,21 +40,21 @@ req = operations.CreateJournalRequest( journal=shared.Journal( created_on='2022-10-23T00:00:00.000Z', has_children=False, - id='711e5b7f-d2ed-4028-921c-ddc692601fb5', - journal_code='voluptate', + id='4f63c969-e9a3-4efa-b7df-b14cd66ae395', + journal_code='accusamus', metadata=shared.Metadata( is_deleted=False, ), modified_date='2022-10-23T00:00:00.000Z', - name='Gary Streich', - parent_id='perferendis', + name='Rene Reinger', + parent_id='deleniti', source_modified_date='2022-10-23T00:00:00.000Z', status=shared.JournalStatus.UNKNOWN, - type='aut', + type='deserunt', ), company_id='8a210b68-6988-11ed-a1eb-0242ac120002', connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', - timeout_in_minutes=764912, + timeout_in_minutes=394869, ) res = s.journals.create(req) @@ -101,7 +101,7 @@ s = codatsyncpayroll.CodatSyncPayroll( req = operations.GetJournalRequest( company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - journal_id='corporis', + journal_id='vel', ) res = s.journals.get(req) @@ -198,7 +198,7 @@ req = operations.ListJournalsRequest( order_by='-modifiedDate', page=1, page_size=100, - query='hic', + query='natus', ) res = s.journals.list(req) diff --git a/sync-for-payroll/docs/sdks/managedata/README.md b/sync-for-payroll/docs/sdks/managedata/README.md index 20fa1c2a8..c21f80978 100755 --- a/sync-for-payroll/docs/sdks/managedata/README.md +++ b/sync-for-payroll/docs/sdks/managedata/README.md @@ -6,13 +6,15 @@ Asynchronously retrieve data from an integration to refresh data in Codat. ### Available Operations -* [get](#get) - Get data status +* [get_data_status](#get_data_status) - Get data status * [get_pull_operation](#get_pull_operation) - Get pull operation +* [get_push_operation](#get_push_operation) - Get push operation +* [list](#list) - List push operations * [list_pull_operations](#list_pull_operations) - List pull operations * [refresh_all_data_types](#refresh_all_data_types) - Refresh all data * [refresh_data_type](#refresh_data_type) - Refresh data type -## get +## get_data_status Get the state of each data type for a company @@ -32,7 +34,7 @@ req = operations.GetDataStatusRequest( company_id='8a210b68-6988-11ed-a1eb-0242ac120002', ) -res = s.manage_data.get(req) +res = s.manage_data.get_data_status(req) if res.data_status_response is not None: # handle response @@ -91,6 +93,89 @@ if res.pull_operation is not None: **[operations.GetPullOperationResponse](../../models/operations/getpulloperationresponse.md)** +## get_push_operation + +Retrieve push operation. + +### Example Usage + +```python +import codatsyncpayroll +from codatsyncpayroll.models import operations, shared + +s = codatsyncpayroll.CodatSyncPayroll( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.GetPushOperationRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + push_operation_key='97074ba4-469b-46e2-9419-59890afa563e', +) + +res = s.manage_data.get_push_operation(req) + +if res.push_operation is not None: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `request` | [operations.GetPushOperationRequest](../../models/operations/getpushoperationrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + + +### Response + +**[operations.GetPushOperationResponse](../../models/operations/getpushoperationresponse.md)** + + +## list + +List push operation records. + +### Example Usage + +```python +import codatsyncpayroll +from codatsyncpayroll.models import operations, shared + +s = codatsyncpayroll.CodatSyncPayroll( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.ListPushOperationsRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + order_by='-modifiedDate', + page=1, + page_size=100, + query='odit', +) + +res = s.manage_data.list(req) + +if res.push_operations is not None: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `request` | [operations.ListPushOperationsRequest](../../models/operations/listpushoperationsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + + +### Response + +**[operations.ListPushOperationsResponse](../../models/operations/listpushoperationsresponse.md)** + + ## list_pull_operations Gets the pull operation history (datasets) for a given company. @@ -112,12 +197,12 @@ req = operations.ListPullOperationsRequest( order_by='-modifiedDate', page=1, page_size=100, - query='libero', + query='nemo', ) res = s.manage_data.list_pull_operations(req) -if res.data_connection_history is not None: +if res.pull_operations is not None: # handle response ``` @@ -197,7 +282,7 @@ s = codatsyncpayroll.CodatSyncPayroll( req = operations.RefreshDataTypeRequest( company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - connection_id='b2587053-202c-473d-9fe9-b90c28909b3f', + connection_id='16fe4c8b-711e-45b7-bd2e-d028921cddc6', data_type=shared.DataType.INVOICES, ) diff --git a/sync-for-payroll/docs/sdks/pushoperations/README.md b/sync-for-payroll/docs/sdks/pushoperations/README.md deleted file mode 100755 index 2ec2985ee..000000000 --- a/sync-for-payroll/docs/sdks/pushoperations/README.md +++ /dev/null @@ -1,93 +0,0 @@ -# push_operations - -## Overview - -Access create, update and delete operations made to an SMB's data connection. - -### Available Operations - -* [get](#get) - Get push operation -* [list](#list) - List push operations - -## get - -Retrieve push operation. - -### Example Usage - -```python -import codatsyncpayroll -from codatsyncpayroll.models import operations, shared - -s = codatsyncpayroll.CodatSyncPayroll( - security=shared.Security( - auth_header="Basic BASE_64_ENCODED(API_KEY)", - ), -) - -req = operations.GetPushOperationRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - push_operation_key='e49a8d9c-bf48-4633-b23f-9b77f3a41006', -) - -res = s.push_operations.get(req) - -if res.push_operation is not None: - # handle response -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `request` | [operations.GetPushOperationRequest](../../models/operations/getpushoperationrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - - -### Response - -**[operations.GetPushOperationResponse](../../models/operations/getpushoperationresponse.md)** - - -## list - -List push operation records. - -### Example Usage - -```python -import codatsyncpayroll -from codatsyncpayroll.models import operations, shared - -s = codatsyncpayroll.CodatSyncPayroll( - security=shared.Security( - auth_header="Basic BASE_64_ENCODED(API_KEY)", - ), -) - -req = operations.ListPushOperationsRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - order_by='-modifiedDate', - page=1, - page_size=100, - query='odio', -) - -res = s.push_operations.list(req) - -if res.push_history_response is not None: - # handle response -``` - -### Parameters - -| Parameter | Type | Required | Description | -| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `request` | [operations.ListPushOperationsRequest](../../models/operations/listpushoperationsrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - - -### Response - -**[operations.ListPushOperationsResponse](../../models/operations/listpushoperationsresponse.md)** - diff --git a/sync-for-payroll/docs/sdks/trackingcategories/README.md b/sync-for-payroll/docs/sdks/trackingcategories/README.md index 2776026a4..433a02810 100755 --- a/sync-for-payroll/docs/sdks/trackingcategories/README.md +++ b/sync-for-payroll/docs/sdks/trackingcategories/README.md @@ -34,7 +34,7 @@ s = codatsyncpayroll.CodatSyncPayroll( req = operations.GetTrackingCategoryRequest( company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - tracking_category_id='quaerat', + tracking_category_id='excepturi', ) res = s.tracking_categories.get(req) @@ -82,7 +82,7 @@ req = operations.ListTrackingCategoriesRequest( order_by='-modifiedDate', page=1, page_size=100, - query='accusamus', + query='odit', ) res = s.tracking_categories.list(req) diff --git a/sync-for-payroll/files.gen b/sync-for-payroll/files.gen index 43fb94ac0..ec53d5bdc 100755 --- a/sync-for-payroll/files.gen +++ b/sync-for-payroll/files.gen @@ -1,11 +1,11 @@ src/codatsyncpayroll/sdkconfiguration.py src/codatsyncpayroll/accounts.py src/codatsyncpayroll/companies.py +src/codatsyncpayroll/company_info.py src/codatsyncpayroll/connections.py src/codatsyncpayroll/journal_entries.py src/codatsyncpayroll/journals.py src/codatsyncpayroll/manage_data.py -src/codatsyncpayroll/push_operations.py src/codatsyncpayroll/tracking_categories.py src/codatsyncpayroll/sdk.py pylintrc @@ -25,12 +25,14 @@ src/codatsyncpayroll/models/operations/delete_company.py src/codatsyncpayroll/models/operations/get_company.py src/codatsyncpayroll/models/operations/list_companies.py src/codatsyncpayroll/models/operations/update_company.py +src/codatsyncpayroll/models/operations/get_accounting_profile.py src/codatsyncpayroll/models/operations/create_connection.py src/codatsyncpayroll/models/operations/delete_connection.py src/codatsyncpayroll/models/operations/get_connection.py src/codatsyncpayroll/models/operations/list_connections.py src/codatsyncpayroll/models/operations/unlink_connection.py src/codatsyncpayroll/models/operations/create_journal_entry.py +src/codatsyncpayroll/models/operations/delete_journal_entry.py src/codatsyncpayroll/models/operations/get_journal_entry.py src/codatsyncpayroll/models/operations/get_create_journalentry_model.py src/codatsyncpayroll/models/operations/list_journal_entries.py @@ -40,11 +42,11 @@ src/codatsyncpayroll/models/operations/get_create_journal_model.py src/codatsyncpayroll/models/operations/list_journals.py src/codatsyncpayroll/models/operations/get_data_status.py src/codatsyncpayroll/models/operations/get_pull_operation.py +src/codatsyncpayroll/models/operations/get_push_operation.py +src/codatsyncpayroll/models/operations/list_push_operations.py src/codatsyncpayroll/models/operations/list_pull_operations.py src/codatsyncpayroll/models/operations/refresh_all_data_types.py src/codatsyncpayroll/models/operations/refresh_data_type.py -src/codatsyncpayroll/models/operations/get_push_operation.py -src/codatsyncpayroll/models/operations/list_push_operations.py src/codatsyncpayroll/models/operations/get_tracking_category.py src/codatsyncpayroll/models/operations/list_tracking_categories.py src/codatsyncpayroll/models/operations/__init__.py @@ -75,6 +77,8 @@ src/codatsyncpayroll/models/shared/dataconnectionstatus.py src/codatsyncpayroll/models/shared/dataconnectionerror.py src/codatsyncpayroll/models/shared/companyrequestbody.py src/codatsyncpayroll/models/shared/companies.py +src/codatsyncpayroll/models/shared/onecompanies_1percent_7bcompanyidpercent_7d_1data_1info_get_responses_200_content_application_1json_schema_properties_phonenumbers_items_definitions_phonenumbertype.py +src/codatsyncpayroll/models/shared/onecompanies_1percent_7bcompanyidpercent_7d_1data_1info_get_responses_200_content_application_1json_schema_properties_addresses_items_definitions_accountingaddresstype.py src/codatsyncpayroll/models/shared/connections.py src/codatsyncpayroll/models/shared/createjournalentryresponse.py src/codatsyncpayroll/models/shared/journalentry.py @@ -83,6 +87,7 @@ src/codatsyncpayroll/models/shared/journalref.py src/codatsyncpayroll/models/shared/journalline.py src/codatsyncpayroll/models/shared/recordref.py src/codatsyncpayroll/models/shared/accountref.py +src/codatsyncpayroll/models/shared/pushoperation.py src/codatsyncpayroll/models/shared/journalentries.py src/codatsyncpayroll/models/shared/createjournalresponse.py src/codatsyncpayroll/models/shared/journal.py @@ -90,10 +95,8 @@ src/codatsyncpayroll/models/shared/journalstatus.py src/codatsyncpayroll/models/shared/journals.py src/codatsyncpayroll/models/shared/datastatus.py src/codatsyncpayroll/models/shared/pulloperation.py -src/codatsyncpayroll/models/shared/dataconnectionhistory.py -src/codatsyncpayroll/models/shared/pushoperation.py -src/codatsyncpayroll/models/shared/pushhistoryresponse.py -src/codatsyncpayroll/models/shared/pushoperationsummary.py +src/codatsyncpayroll/models/shared/pushoperations.py +src/codatsyncpayroll/models/shared/pulloperations.py src/codatsyncpayroll/models/shared/trackingcategorytree.py src/codatsyncpayroll/models/shared/status.py src/codatsyncpayroll/models/shared/trackingcategories.py @@ -105,11 +108,11 @@ docs/sdks/codatsyncpayroll/README.md docs/models/utils/retryconfig.md docs/sdks/accounts/README.md docs/sdks/companies/README.md +docs/sdks/companyinfo/README.md docs/sdks/connections/README.md docs/sdks/journalentries/README.md docs/sdks/journals/README.md docs/sdks/managedata/README.md -docs/sdks/pushoperations/README.md docs/sdks/trackingcategories/README.md USAGE.md docs/models/operations/createaccountrequest.md @@ -129,6 +132,13 @@ docs/models/operations/listcompaniesrequest.md docs/models/operations/listcompaniesresponse.md docs/models/operations/updatecompanyrequest.md docs/models/operations/updatecompanyresponse.md +docs/models/operations/getaccountingprofilerequest.md +docs/models/operations/getaccountingprofilecompanyinformationaccountingaddress.md +docs/models/operations/getaccountingprofilecompanyinformationphone.md +docs/models/operations/getaccountingprofilecompanyinformationweblinktype.md +docs/models/operations/getaccountingprofilecompanyinformationweblink.md +docs/models/operations/getaccountingprofilecompanyinformation.md +docs/models/operations/getaccountingprofileresponse.md docs/models/operations/createconnectionrequestbody.md docs/models/operations/createconnectionrequest.md docs/models/operations/createconnectionresponse.md @@ -138,11 +148,13 @@ docs/models/operations/getconnectionrequest.md docs/models/operations/getconnectionresponse.md docs/models/operations/listconnectionsrequest.md docs/models/operations/listconnectionsresponse.md -docs/models/operations/unlinkconnectionrequestbody.md +docs/models/operations/unlinkconnectionupdateconnection.md docs/models/operations/unlinkconnectionrequest.md docs/models/operations/unlinkconnectionresponse.md docs/models/operations/createjournalentryrequest.md docs/models/operations/createjournalentryresponse.md +docs/models/operations/deletejournalentryrequest.md +docs/models/operations/deletejournalentryresponse.md docs/models/operations/getjournalentryrequest.md docs/models/operations/getjournalentryresponse.md docs/models/operations/getcreatejournalentrymodelrequest.md @@ -161,16 +173,16 @@ docs/models/operations/getdatastatusrequest.md docs/models/operations/getdatastatusresponse.md docs/models/operations/getpulloperationrequest.md docs/models/operations/getpulloperationresponse.md +docs/models/operations/getpushoperationrequest.md +docs/models/operations/getpushoperationresponse.md +docs/models/operations/listpushoperationsrequest.md +docs/models/operations/listpushoperationsresponse.md docs/models/operations/listpulloperationsrequest.md docs/models/operations/listpulloperationsresponse.md docs/models/operations/refreshalldatatypesrequest.md docs/models/operations/refreshalldatatypesresponse.md docs/models/operations/refreshdatatyperequest.md docs/models/operations/refreshdatatyperesponse.md -docs/models/operations/getpushoperationrequest.md -docs/models/operations/getpushoperationresponse.md -docs/models/operations/listpushoperationsrequest.md -docs/models/operations/listpushoperationsresponse.md docs/models/operations/gettrackingcategoryrequest.md docs/models/operations/gettrackingcategoryresponse.md docs/models/operations/listtrackingcategoriesrequest.md @@ -205,6 +217,8 @@ docs/models/shared/dataconnectionstatus.md docs/models/shared/dataconnectionerror.md docs/models/shared/companyrequestbody.md docs/models/shared/companies.md +docs/models/shared/onecompanies1percent7bcompanyidpercent7d1data1infogetresponses200contentapplication1jsonschemapropertiesphonenumbersitemsdefinitionsphonenumbertype.md +docs/models/shared/onecompanies1percent7bcompanyidpercent7d1data1infogetresponses200contentapplication1jsonschemapropertiesaddressesitemsdefinitionsaccountingaddresstype.md docs/models/shared/connections.md docs/models/shared/createjournalentryresponse.md docs/models/shared/journalentryrecordreference.md @@ -216,6 +230,7 @@ docs/models/shared/journallinetracking.md docs/models/shared/journalline.md docs/models/shared/recordref.md docs/models/shared/accountref.md +docs/models/shared/pushoperation.md docs/models/shared/journalentries.md docs/models/shared/createjournalresponse.md docs/models/shared/journal.md @@ -224,10 +239,8 @@ docs/models/shared/journals.md docs/models/shared/datastatus.md docs/models/shared/pulloperationstatus.md docs/models/shared/pulloperation.md -docs/models/shared/dataconnectionhistory.md -docs/models/shared/pushoperation.md -docs/models/shared/pushhistoryresponse.md -docs/models/shared/pushoperationsummary.md +docs/models/shared/pushoperations.md +docs/models/shared/pulloperations.md docs/models/shared/trackingcategorytree.md docs/models/shared/status.md docs/models/shared/trackingcategories.md diff --git a/sync-for-payroll/gen.yaml b/sync-for-payroll/gen.yaml index b0b51205f..dff7b705d 100644 --- a/sync-for-payroll/gen.yaml +++ b/sync-for-payroll/gen.yaml @@ -1,15 +1,24 @@ configVersion: 1.0.0 management: - docChecksum: 853aebc76021ec17db9b1abb7a33f340 - docVersion: 2.1.0 - speakeasyVersion: 1.53.0 - generationVersion: 2.58.0 + docChecksum: 1f4eacf69533bb7b4b445eb3b88a6646 + docVersion: 3.0.0 + speakeasyVersion: 1.82.5 + generationVersion: 2.108.3 generation: sdkClassName: CodatSyncPayroll singleTagPerOp: false telemetryEnabled: true +features: + python: + core: 2.85.4 + deprecations: 2.81.1 + examples: 2.81.2 + globalSecurity: 2.81.1 + globalServerURLs: 2.82.0 + nameOverrides: 2.81.1 + retries: 2.82.0 python: - version: 0.1.0 + version: 0.2.0 author: Codat description: Push payroll to accounting platforms. maxMethodParams: 0 diff --git a/sync-for-payroll/setup.py b/sync-for-payroll/setup.py index dc1c52f02..6ef0741cf 100755 --- a/sync-for-payroll/setup.py +++ b/sync-for-payroll/setup.py @@ -10,7 +10,7 @@ setuptools.setup( name="codat-sync-for-payroll", - version="0.1.0", + version="0.2.0", author="Codat", description="Push payroll to accounting platforms.", long_description=long_description, diff --git a/sync-for-payroll/src/codatsyncpayroll/accounts.py b/sync-for-payroll/src/codatsyncpayroll/accounts.py index 1f8b19059..dfefe08fa 100755 --- a/sync-for-payroll/src/codatsyncpayroll/accounts.py +++ b/sync-for-payroll/src/codatsyncpayroll/accounts.py @@ -38,9 +38,13 @@ def create(self, request: operations.CreateAccountRequest, retries: Optional[uti client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('POST', url, params=query_params, data=data, files=form, headers=headers) @@ -89,9 +93,13 @@ def get(self, request: operations.GetAccountRequest, retries: Optional[utils.Ret client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, headers=headers) @@ -142,9 +150,13 @@ def get_create_model(self, request: operations.GetCreateAccountsModelRequest, re client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, headers=headers) @@ -192,9 +204,13 @@ def list(self, request: operations.ListAccountsRequest, retries: Optional[utils. client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, params=query_params, headers=headers) diff --git a/sync-for-payroll/src/codatsyncpayroll/companies.py b/sync-for-payroll/src/codatsyncpayroll/companies.py index 9214f797f..c4a508e2c 100755 --- a/sync-for-payroll/src/codatsyncpayroll/companies.py +++ b/sync-for-payroll/src/codatsyncpayroll/companies.py @@ -31,9 +31,13 @@ def create(self, request: shared.CompanyRequestBody, retries: Optional[utils.Ret client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('POST', url, data=data, files=form, headers=headers) @@ -76,9 +80,13 @@ def delete(self, request: operations.DeleteCompanyRequest, retries: Optional[uti client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('DELETE', url, headers=headers) @@ -117,9 +125,13 @@ def get(self, request: operations.GetCompanyRequest, retries: Optional[utils.Ret client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, headers=headers) @@ -163,9 +175,13 @@ def list(self, request: operations.ListCompaniesRequest, retries: Optional[utils client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, params=query_params, headers=headers) @@ -211,9 +227,13 @@ def update(self, request: operations.UpdateCompanyRequest, retries: Optional[uti client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('PUT', url, data=data, files=form, headers=headers) diff --git a/sync-for-payroll/src/codatsyncpayroll/company_info.py b/sync-for-payroll/src/codatsyncpayroll/company_info.py new file mode 100755 index 000000000..4f51555c2 --- /dev/null +++ b/sync-for-payroll/src/codatsyncpayroll/company_info.py @@ -0,0 +1,64 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from .sdkconfiguration import SDKConfiguration +from codatsyncpayroll import utils +from codatsyncpayroll.models import errors, operations, shared +from typing import Optional + +class CompanyInfo: + r"""View company information fetched from the source platform.""" + sdk_configuration: SDKConfiguration + + def __init__(self, sdk_config: SDKConfiguration) -> None: + self.sdk_configuration = sdk_config + + + def get_accounting_profile(self, request: operations.GetAccountingProfileRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetAccountingProfileResponse: + r"""Get company accounting profile + Gets the latest basic info for a company. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.GetAccountingProfileRequest, base_url, '/companies/{companyId}/data/info', request) + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + global_retry_config = self.sdk_configuration.retry_config + retry_config = retries + if retry_config is None: + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + + def do_request(): + return client.request('GET', url, headers=headers) + + http_res = utils.retry(do_request, utils.Retries(retry_config, [ + '408', + '429', + '5XX' + ])) + content_type = http_res.headers.get('Content-Type') + + res = operations.GetAccountingProfileResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) + + if http_res.status_code == 200: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[operations.GetAccountingProfileCompanyInformation]) + res.company_information = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + elif http_res.status_code in [401, 404, 409, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + \ No newline at end of file diff --git a/sync-for-payroll/src/codatsyncpayroll/connections.py b/sync-for-payroll/src/codatsyncpayroll/connections.py index 2b2e75b01..5e8ce92ad 100755 --- a/sync-for-payroll/src/codatsyncpayroll/connections.py +++ b/sync-for-payroll/src/codatsyncpayroll/connections.py @@ -31,9 +31,13 @@ def create(self, request: operations.CreateConnectionRequest, retries: Optional[ client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('POST', url, data=data, files=form, headers=headers) @@ -77,9 +81,13 @@ def delete(self, request: operations.DeleteConnectionRequest, retries: Optional[ client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('DELETE', url, headers=headers) @@ -118,9 +126,13 @@ def get(self, request: operations.GetConnectionRequest, retries: Optional[utils. client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, headers=headers) @@ -164,9 +176,13 @@ def list(self, request: operations.ListConnectionsRequest, retries: Optional[uti client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, params=query_params, headers=headers) @@ -212,9 +228,13 @@ def unlink(self, request: operations.UnlinkConnectionRequest, retries: Optional[ client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('PATCH', url, data=data, files=form, headers=headers) diff --git a/sync-for-payroll/src/codatsyncpayroll/journal_entries.py b/sync-for-payroll/src/codatsyncpayroll/journal_entries.py index ab311aad7..02d3f1132 100755 --- a/sync-for-payroll/src/codatsyncpayroll/journal_entries.py +++ b/sync-for-payroll/src/codatsyncpayroll/journal_entries.py @@ -38,9 +38,13 @@ def create(self, request: operations.CreateJournalEntryRequest, retries: Optiona client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('POST', url, params=query_params, data=data, files=form, headers=headers) @@ -70,6 +74,83 @@ def do_request(): return res + def delete(self, request: operations.DeleteJournalEntryRequest, retries: Optional[utils.RetryConfig] = None) -> operations.DeleteJournalEntryResponse: + r"""Delete journal entry + > **Use with caution** + > + >Because journal entries underpin every transaction in an accounting platform, deleting a journal entry can affect every transaction for a given company. + > + > **Before you proceed, make sure you understand the implications of deleting journal entries from an accounting perspective.** + + The *Delete journal entry* endpoint allows you to delete a specified journal entry from an accounting platform. + + [Journal entries](https://docs.codat.io/sync-for-payroll-api#/schemas/JournalEntry) are made in a company's general ledger, or accounts, when transactions are approved. + + ### Process + 1. Pass the `{journalEntryId}` to the *Delete journal entry* endpoint and store the `pushOperationKey` returned. + 2. Check the status of the delete by checking the status of push operation either via + 1. [Push operation webhook](https://docs.codat.io/introduction/webhooks/core-rules-types#push-operation-status-has-changed) (advised), + 2. [Push operation status endpoint](https://docs.codat.io/sync-for-payroll-api#/operations/get-push-operation). + + A `Success` status indicates that the journal entry object was deleted from the accounting platform. + 3. (Optional) Check that the journal entry was deleted from the accounting platform. + + ### Effect on related objects + + Be aware that deleting a journal entry from an accounting platform might cause related objects to be modified. For example, if you delete the journal entry for a paid invoice in QuickBooks Online, the invoice is deleted but the payment against that invoice is not. The payment is converted to a payment on account. + + ## Integration specifics + Integrations that support soft delete do not permanently delete the object in the accounting platform. + + | Integration | Soft Deleted | + |-------------|--------------| + | QuickBooks Online | Yes | + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.DeleteJournalEntryRequest, base_url, '/companies/{companyId}/data/journalEntries/{journalEntryId}', request) + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + global_retry_config = self.sdk_configuration.retry_config + retry_config = retries + if retry_config is None: + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + + def do_request(): + return client.request('DELETE', url, headers=headers) + + http_res = utils.retry(do_request, utils.Retries(retry_config, [ + '408', + '429', + '5XX' + ])) + content_type = http_res.headers.get('Content-Type') + + res = operations.DeleteJournalEntryResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) + + if http_res.status_code == 200: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.PushOperation]) + res.push_operation = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + elif http_res.status_code in [401, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + def get(self, request: operations.GetJournalEntryRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetJournalEntryResponse: r"""Get journal entry The *Get journal entry* endpoint returns a single journal entry for a given `journalEntryId`. @@ -89,9 +170,13 @@ def get(self, request: operations.GetJournalEntryRequest, retries: Optional[util client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, headers=headers) @@ -142,9 +227,13 @@ def get_create_model(self, request: operations.GetCreateJournalEntryModelRequest client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, headers=headers) @@ -192,9 +281,13 @@ def list(self, request: operations.ListJournalEntriesRequest, retries: Optional[ client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, params=query_params, headers=headers) diff --git a/sync-for-payroll/src/codatsyncpayroll/journals.py b/sync-for-payroll/src/codatsyncpayroll/journals.py index 4dfc9ace9..0a579c3bf 100755 --- a/sync-for-payroll/src/codatsyncpayroll/journals.py +++ b/sync-for-payroll/src/codatsyncpayroll/journals.py @@ -38,9 +38,13 @@ def create(self, request: operations.CreateJournalRequest, retries: Optional[uti client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('POST', url, params=query_params, data=data, files=form, headers=headers) @@ -89,9 +93,13 @@ def get(self, request: operations.GetJournalRequest, retries: Optional[utils.Ret client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, headers=headers) @@ -142,9 +150,13 @@ def get_create_model(self, request: operations.GetCreateJournalModelRequest, ret client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, headers=headers) @@ -192,9 +204,13 @@ def list(self, request: operations.ListJournalsRequest, retries: Optional[utils. client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, params=query_params, headers=headers) diff --git a/sync-for-payroll/src/codatsyncpayroll/manage_data.py b/sync-for-payroll/src/codatsyncpayroll/manage_data.py index 2b0a417eb..93679245c 100755 --- a/sync-for-payroll/src/codatsyncpayroll/manage_data.py +++ b/sync-for-payroll/src/codatsyncpayroll/manage_data.py @@ -13,7 +13,7 @@ def __init__(self, sdk_config: SDKConfiguration) -> None: self.sdk_configuration = sdk_config - def get(self, request: operations.GetDataStatusRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetDataStatusResponse: + def get_data_status(self, request: operations.GetDataStatusRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetDataStatusResponse: r"""Get data status Get the state of each data type for a company """ @@ -26,9 +26,13 @@ def get(self, request: operations.GetDataStatusRequest, retries: Optional[utils. client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, headers=headers) @@ -71,9 +75,13 @@ def get_pull_operation(self, request: operations.GetPullOperationRequest, retrie client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, headers=headers) @@ -103,6 +111,105 @@ def do_request(): return res + def get_push_operation(self, request: operations.GetPushOperationRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetPushOperationResponse: + r"""Get push operation + Retrieve push operation. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.GetPushOperationRequest, base_url, '/companies/{companyId}/push/{pushOperationKey}', request) + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + global_retry_config = self.sdk_configuration.retry_config + retry_config = retries + if retry_config is None: + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + + def do_request(): + return client.request('GET', url, headers=headers) + + http_res = utils.retry(do_request, utils.Retries(retry_config, [ + '408', + '429', + '5XX' + ])) + content_type = http_res.headers.get('Content-Type') + + res = operations.GetPushOperationResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) + + if http_res.status_code == 200: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.PushOperation]) + res.push_operation = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + elif http_res.status_code in [401, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def list(self, request: operations.ListPushOperationsRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListPushOperationsResponse: + r"""List push operations + List push operation records. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.ListPushOperationsRequest, base_url, '/companies/{companyId}/push', request) + headers = {} + query_params = utils.get_query_params(operations.ListPushOperationsRequest, request) + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + global_retry_config = self.sdk_configuration.retry_config + retry_config = retries + if retry_config is None: + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + + def do_request(): + return client.request('GET', url, params=query_params, headers=headers) + + http_res = utils.retry(do_request, utils.Retries(retry_config, [ + '408', + '429', + '5XX' + ])) + content_type = http_res.headers.get('Content-Type') + + res = operations.ListPushOperationsResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) + + if http_res.status_code == 200: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.PushOperations]) + res.push_operations = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + elif http_res.status_code in [400, 401, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + def list_pull_operations(self, request: operations.ListPullOperationsRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListPullOperationsResponse: r"""List pull operations Gets the pull operation history (datasets) for a given company. @@ -117,9 +224,13 @@ def list_pull_operations(self, request: operations.ListPullOperationsRequest, re client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, params=query_params, headers=headers) @@ -135,8 +246,8 @@ def do_request(): if http_res.status_code == 200: if utils.match_content_type(content_type, 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.DataConnectionHistory]) - res.data_connection_history = out + out = utils.unmarshal_json(http_res.text, Optional[shared.PullOperations]) + res.pull_operations = out else: raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) elif http_res.status_code in [400, 401, 404, 429]: @@ -166,9 +277,13 @@ def refresh_all_data_types(self, request: operations.RefreshAllDataTypesRequest, client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('POST', url, headers=headers) @@ -210,9 +325,13 @@ def refresh_data_type(self, request: operations.RefreshDataTypeRequest, retries: client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('POST', url, params=query_params, headers=headers) diff --git a/sync-for-payroll/src/codatsyncpayroll/models/operations/__init__.py b/sync-for-payroll/src/codatsyncpayroll/models/operations/__init__.py index 7449c813c..c358170ed 100755 --- a/sync-for-payroll/src/codatsyncpayroll/models/operations/__init__.py +++ b/sync-for-payroll/src/codatsyncpayroll/models/operations/__init__.py @@ -7,7 +7,9 @@ from .create_journal_entry import * from .delete_company import * from .delete_connection import * +from .delete_journal_entry import * from .get_account import * +from .get_accounting_profile import * from .get_company import * from .get_connection import * from .get_create_accounts_model import * @@ -32,4 +34,4 @@ from .unlink_connection import * from .update_company import * -__all__ = ["CreateAccountRequest","CreateAccountResponse","CreateCompanyResponse","CreateConnectionRequest","CreateConnectionRequestBody","CreateConnectionResponse","CreateJournalEntryRequest","CreateJournalEntryResponse","CreateJournalRequest","CreateJournalResponse","DeleteCompanyRequest","DeleteCompanyResponse","DeleteConnectionRequest","DeleteConnectionResponse","GetAccountRequest","GetAccountResponse","GetCompanyRequest","GetCompanyResponse","GetConnectionRequest","GetConnectionResponse","GetCreateAccountsModelRequest","GetCreateAccountsModelResponse","GetCreateJournalEntryModelRequest","GetCreateJournalEntryModelResponse","GetCreateJournalModelRequest","GetCreateJournalModelResponse","GetDataStatusRequest","GetDataStatusResponse","GetJournalEntryRequest","GetJournalEntryResponse","GetJournalRequest","GetJournalResponse","GetPullOperationRequest","GetPullOperationResponse","GetPushOperationRequest","GetPushOperationResponse","GetTrackingCategoryRequest","GetTrackingCategoryResponse","ListAccountsRequest","ListAccountsResponse","ListCompaniesRequest","ListCompaniesResponse","ListConnectionsRequest","ListConnectionsResponse","ListJournalEntriesRequest","ListJournalEntriesResponse","ListJournalsRequest","ListJournalsResponse","ListPullOperationsRequest","ListPullOperationsResponse","ListPushOperationsRequest","ListPushOperationsResponse","ListTrackingCategoriesRequest","ListTrackingCategoriesResponse","RefreshAllDataTypesRequest","RefreshAllDataTypesResponse","RefreshDataTypeRequest","RefreshDataTypeResponse","UnlinkConnectionRequest","UnlinkConnectionRequestBody","UnlinkConnectionResponse","UpdateCompanyRequest","UpdateCompanyResponse"] +__all__ = ["CreateAccountRequest","CreateAccountResponse","CreateCompanyResponse","CreateConnectionRequest","CreateConnectionRequestBody","CreateConnectionResponse","CreateJournalEntryRequest","CreateJournalEntryResponse","CreateJournalRequest","CreateJournalResponse","DeleteCompanyRequest","DeleteCompanyResponse","DeleteConnectionRequest","DeleteConnectionResponse","DeleteJournalEntryRequest","DeleteJournalEntryResponse","GetAccountRequest","GetAccountResponse","GetAccountingProfileCompanyInformation","GetAccountingProfileCompanyInformationAccountingAddress","GetAccountingProfileCompanyInformationPhone","GetAccountingProfileCompanyInformationWeblink","GetAccountingProfileCompanyInformationWeblinkType","GetAccountingProfileRequest","GetAccountingProfileResponse","GetCompanyRequest","GetCompanyResponse","GetConnectionRequest","GetConnectionResponse","GetCreateAccountsModelRequest","GetCreateAccountsModelResponse","GetCreateJournalEntryModelRequest","GetCreateJournalEntryModelResponse","GetCreateJournalModelRequest","GetCreateJournalModelResponse","GetDataStatusRequest","GetDataStatusResponse","GetJournalEntryRequest","GetJournalEntryResponse","GetJournalRequest","GetJournalResponse","GetPullOperationRequest","GetPullOperationResponse","GetPushOperationRequest","GetPushOperationResponse","GetTrackingCategoryRequest","GetTrackingCategoryResponse","ListAccountsRequest","ListAccountsResponse","ListCompaniesRequest","ListCompaniesResponse","ListConnectionsRequest","ListConnectionsResponse","ListJournalEntriesRequest","ListJournalEntriesResponse","ListJournalsRequest","ListJournalsResponse","ListPullOperationsRequest","ListPullOperationsResponse","ListPushOperationsRequest","ListPushOperationsResponse","ListTrackingCategoriesRequest","ListTrackingCategoriesResponse","RefreshAllDataTypesRequest","RefreshAllDataTypesResponse","RefreshDataTypeRequest","RefreshDataTypeResponse","UnlinkConnectionRequest","UnlinkConnectionResponse","UnlinkConnectionUpdateConnection","UpdateCompanyRequest","UpdateCompanyResponse"] diff --git a/sync-for-payroll/src/codatsyncpayroll/models/operations/delete_journal_entry.py b/sync-for-payroll/src/codatsyncpayroll/models/operations/delete_journal_entry.py new file mode 100755 index 000000000..59d37796f --- /dev/null +++ b/sync-for-payroll/src/codatsyncpayroll/models/operations/delete_journal_entry.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import errormessage as shared_errormessage +from ..shared import pushoperation as shared_pushoperation +from typing import Optional + + + +@dataclasses.dataclass +class DeleteJournalEntryRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + journal_entry_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'journalEntryId', 'style': 'simple', 'explode': False }}) + + + + + +@dataclasses.dataclass +class DeleteJournalEntryResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + push_operation: Optional[shared_pushoperation.PushOperation] = dataclasses.field(default=None) + r"""OK""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payroll/src/codatsyncpayroll/models/operations/get_accounting_profile.py b/sync-for-payroll/src/codatsyncpayroll/models/operations/get_accounting_profile.py new file mode 100755 index 000000000..fafc46044 --- /dev/null +++ b/sync-for-payroll/src/codatsyncpayroll/models/operations/get_accounting_profile.py @@ -0,0 +1,189 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import errormessage as shared_errormessage +from ..shared import onecompanies_1percent_7bcompanyidpercent_7d_1data_1info_get_responses_200_content_application_1json_schema_properties_addresses_items_definitions_accountingaddresstype as shared_onecompanies_1percent_7bcompanyidpercent_7d_1data_1info_get_responses_200_content_application_1json_schema_properties_addresses_items_definitions_accountingaddresstype +from ..shared import onecompanies_1percent_7bcompanyidpercent_7d_1data_1info_get_responses_200_content_application_1json_schema_properties_phonenumbers_items_definitions_phonenumbertype as shared_onecompanies_1percent_7bcompanyidpercent_7d_1data_1info_get_responses_200_content_application_1json_schema_properties_phonenumbers_items_definitions_phonenumbertype +from codatsyncpayroll import utils +from dataclasses_json import Undefined, dataclass_json +from enum import Enum +from typing import Optional + + + +@dataclasses.dataclass +class GetAccountingProfileRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + + + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class GetAccountingProfileCompanyInformationAccountingAddress: + type: shared_onecompanies_1percent_7bcompanyidpercent_7d_1data_1info_get_responses_200_content_application_1json_schema_properties_addresses_items_definitions_accountingaddresstype.Onecompanies1Percent7BcompanyIDPercent7D1data1infoGetResponses200ContentApplication1jsonSchemaPropertiesAddressesItemsDefinitionsAccountingAddressType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type') }}) + r"""The type of the address""" + city: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('city'), 'exclude': lambda f: f is None }}) + r"""City of the customer address.""" + country: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('country'), 'exclude': lambda f: f is None }}) + r"""Country of the customer address.""" + line1: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('line1'), 'exclude': lambda f: f is None }}) + r"""Line 1 of the customer address.""" + line2: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('line2'), 'exclude': lambda f: f is None }}) + r"""Line 2 of the customer address.""" + postal_code: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('postalCode'), 'exclude': lambda f: f is None }}) + r"""Postal code or zip code.""" + region: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('region'), 'exclude': lambda f: f is None }}) + r"""Region of the customer address.""" + + + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class GetAccountingProfileCompanyInformationPhone: + number: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('number') }}) + r"""A phone number.""" + type: shared_onecompanies_1percent_7bcompanyidpercent_7d_1data_1info_get_responses_200_content_application_1json_schema_properties_phonenumbers_items_definitions_phonenumbertype.Onecompanies1Percent7BcompanyIDPercent7D1data1infoGetResponses200ContentApplication1jsonSchemaPropertiesPhoneNumbersItemsDefinitionsPhoneNumberType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type') }}) + r"""The type of phone number""" + + + +class GetAccountingProfileCompanyInformationWeblinkType(str, Enum): + r"""The type of the weblink.""" + WEBSITE = 'Website' + SOCIAL = 'Social' + UNKNOWN = 'Unknown' + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class GetAccountingProfileCompanyInformationWeblink: + r"""Weblink associated with the company.""" + type: Optional[GetAccountingProfileCompanyInformationWeblinkType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }}) + r"""The type of the weblink.""" + url: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('url'), 'exclude': lambda f: f is None }}) + r"""The full URL for the weblink.""" + + + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class GetAccountingProfileCompanyInformation: + r"""> View the coverage for company info in the Data coverage explorer. + + Company info provides standard details about a linked company such as their address, phone number, and company registration. + + > **Company information or companies?** + > + > Company information is standard information that is held in the accounting platform about a company. `Companies` is an endpoint that lists businesses in the Codat system that have linked and shared their data sources. + """ + accounting_platform_ref: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('accountingPlatformRef'), 'exclude': lambda f: f is None }}) + r"""Identifier or reference for the company in the accounting platform.""" + addresses: Optional[list[GetAccountingProfileCompanyInformationAccountingAddress]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('addresses'), 'exclude': lambda f: f is None }}) + r"""An array of Addresses.""" + base_currency: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('baseCurrency'), 'exclude': lambda f: f is None }}) + r"""Currency set in the accounting platform of the linked company. Used by the currency rate.""" + company_legal_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyLegalName'), 'exclude': lambda f: f is None }}) + r"""Registered legal name of the linked company.""" + company_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyName'), 'exclude': lambda f: f is None }}) + r"""Name of the linked company.""" + created_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('createdDate'), 'exclude': lambda f: f is None }}) + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + financial_year_start_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('financialYearStartDate'), 'exclude': lambda f: f is None }}) + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + ledger_lock_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ledgerLockDate'), 'exclude': lambda f: f is None }}) + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + """ + phone_numbers: Optional[list[GetAccountingProfileCompanyInformationPhone]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('phoneNumbers'), 'exclude': lambda f: f is None }}) + r"""An array of phone numbers.""" + registration_number: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('registrationNumber'), 'exclude': lambda f: f is None }}) + r"""Registration number given to the linked company by the companies authority in the country of origin. In the UK this is Companies House.""" + source_urls: Optional[dict[str, str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceUrls'), 'exclude': lambda f: f is None }}) + r"""URL addresses for the accounting source. + + For example, for Xero integrations two URLs are returned. These have many potential use cases, such as [deep linking](https://developer.xero.com/documentation/api-guides/deep-link-xero). + """ + tax_number: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxNumber'), 'exclude': lambda f: f is None }}) + r"""Company tax number.""" + web_links: Optional[list[GetAccountingProfileCompanyInformationWeblink]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('webLinks'), 'exclude': lambda f: f is None }}) + r"""An array of weblinks.""" + + + + + +@dataclasses.dataclass +class GetAccountingProfileResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + company_information: Optional[GetAccountingProfileCompanyInformation] = dataclasses.field(default=None) + r"""Success""" + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payroll/src/codatsyncpayroll/models/operations/list_pull_operations.py b/sync-for-payroll/src/codatsyncpayroll/models/operations/list_pull_operations.py index bd5246c9c..25f30893d 100755 --- a/sync-for-payroll/src/codatsyncpayroll/models/operations/list_pull_operations.py +++ b/sync-for-payroll/src/codatsyncpayroll/models/operations/list_pull_operations.py @@ -3,8 +3,8 @@ from __future__ import annotations import dataclasses import requests as requests_http -from ..shared import dataconnectionhistory as shared_dataconnectionhistory from ..shared import errormessage as shared_errormessage +from ..shared import pulloperations as shared_pulloperations from typing import Optional @@ -29,10 +29,10 @@ class ListPullOperationsRequest: class ListPullOperationsResponse: content_type: str = dataclasses.field() status_code: int = dataclasses.field() - data_connection_history: Optional[shared_dataconnectionhistory.DataConnectionHistory] = dataclasses.field(default=None) - r"""OK""" error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) r"""Your `query` parameter was not correctly formed""" + pull_operations: Optional[shared_pulloperations.PullOperations] = dataclasses.field(default=None) + r"""OK""" raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) diff --git a/sync-for-payroll/src/codatsyncpayroll/models/operations/list_push_operations.py b/sync-for-payroll/src/codatsyncpayroll/models/operations/list_push_operations.py index 10e80319a..ea18d9769 100755 --- a/sync-for-payroll/src/codatsyncpayroll/models/operations/list_push_operations.py +++ b/sync-for-payroll/src/codatsyncpayroll/models/operations/list_push_operations.py @@ -4,7 +4,7 @@ import dataclasses import requests as requests_http from ..shared import errormessage as shared_errormessage -from ..shared import pushhistoryresponse as shared_pushhistoryresponse +from ..shared import pushoperations as shared_pushoperations from typing import Optional @@ -31,7 +31,7 @@ class ListPushOperationsResponse: status_code: int = dataclasses.field() error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) r"""Your `query` parameter was not correctly formed""" - push_history_response: Optional[shared_pushhistoryresponse.PushHistoryResponse] = dataclasses.field(default=None) + push_operations: Optional[shared_pushoperations.PushOperations] = dataclasses.field(default=None) r"""OK""" raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) diff --git a/sync-for-payroll/src/codatsyncpayroll/models/operations/unlink_connection.py b/sync-for-payroll/src/codatsyncpayroll/models/operations/unlink_connection.py index d0fa7f060..f8e23194c 100755 --- a/sync-for-payroll/src/codatsyncpayroll/models/operations/unlink_connection.py +++ b/sync-for-payroll/src/codatsyncpayroll/models/operations/unlink_connection.py @@ -4,6 +4,7 @@ import dataclasses import requests as requests_http from ..shared import connection as shared_connection +from ..shared import dataconnectionstatus as shared_dataconnectionstatus from ..shared import errormessage as shared_errormessage from codatsyncpayroll import utils from dataclasses_json import Undefined, dataclass_json @@ -13,8 +14,9 @@ @dataclass_json(undefined=Undefined.EXCLUDE) @dataclasses.dataclass -class UnlinkConnectionRequestBody: - status: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status'), 'exclude': lambda f: f is None }}) +class UnlinkConnectionUpdateConnection: + status: Optional[shared_dataconnectionstatus.DataConnectionStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status'), 'exclude': lambda f: f is None }}) + r"""The current authorization status of the data connection.""" @@ -24,7 +26,7 @@ class UnlinkConnectionRequestBody: class UnlinkConnectionRequest: company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) - request_body: Optional[UnlinkConnectionRequestBody] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) + request_body: Optional[UnlinkConnectionUpdateConnection] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) diff --git a/sync-for-payroll/src/codatsyncpayroll/models/shared/__init__.py b/sync-for-payroll/src/codatsyncpayroll/models/shared/__init__.py index b5418e642..6e299b84a 100755 --- a/sync-for-payroll/src/codatsyncpayroll/models/shared/__init__.py +++ b/sync-for-payroll/src/codatsyncpayroll/models/shared/__init__.py @@ -14,7 +14,6 @@ from .createjournalentryresponse import * from .createjournalresponse import * from .dataconnectionerror import * -from .dataconnectionhistory import * from .dataconnectionstatus import * from .datastatus import * from .datatype import * @@ -29,15 +28,17 @@ from .journalstatus import * from .links import * from .metadata import * +from .onecompanies_1percent_7bcompanyidpercent_7d_1data_1info_get_responses_200_content_application_1json_schema_properties_addresses_items_definitions_accountingaddresstype import * +from .onecompanies_1percent_7bcompanyidpercent_7d_1data_1info_get_responses_200_content_application_1json_schema_properties_phonenumbers_items_definitions_phonenumbertype import * from .pulloperation import * +from .pulloperations import * from .pushchangetype import * from .pushfieldvalidation import * -from .pushhistoryresponse import * from .pushoperation import * from .pushoperationchange import * from .pushoperationref import * +from .pushoperations import * from .pushoperationstatus import * -from .pushoperationsummary import * from .pushoption import * from .pushoptionchoice import * from .pushoptionproperty import * @@ -52,4 +53,4 @@ from .validation import * from .validationitem import * -__all__ = ["Account","AccountMetadata","AccountRef","AccountStatus","AccountType","AccountValidDataTypeLinks","Accounts","Companies","Company","CompanyRequestBody","Connection","ConnectionSourceType","Connections","CreateAccountResponse","CreateJournalEntryResponse","CreateJournalResponse","DataConnectionError","DataConnectionHistory","DataConnectionStatus","DataStatus","DataType","ErrorMessage","HalRef","Journal","JournalEntries","JournalEntry","JournalEntryRecordReference","JournalEntrySupplementalData","JournalLine","JournalLineTracking","JournalRef","JournalStatus","Journals","Links","Metadata","PullOperation","PullOperationStatus","PushChangeType","PushFieldValidation","PushHistoryResponse","PushOperation","PushOperationChange","PushOperationRef","PushOperationStatus","PushOperationSummary","PushOption","PushOptionChoice","PushOptionProperty","PushOptionType","PushValidationInfo","RecordRef","Security","Status","TrackingCategories","TrackingCategory","TrackingCategoryTree","Validation","ValidationItem"] +__all__ = ["Account","AccountMetadata","AccountRef","AccountStatus","AccountType","AccountValidDataTypeLinks","Accounts","Companies","Company","CompanyRequestBody","Connection","ConnectionSourceType","Connections","CreateAccountResponse","CreateJournalEntryResponse","CreateJournalResponse","DataConnectionError","DataConnectionStatus","DataStatus","DataType","ErrorMessage","HalRef","Journal","JournalEntries","JournalEntry","JournalEntryRecordReference","JournalEntrySupplementalData","JournalLine","JournalLineTracking","JournalRef","JournalStatus","Journals","Links","Metadata","Onecompanies1Percent7BcompanyIDPercent7D1data1infoGetResponses200ContentApplication1jsonSchemaPropertiesAddressesItemsDefinitionsAccountingAddressType","Onecompanies1Percent7BcompanyIDPercent7D1data1infoGetResponses200ContentApplication1jsonSchemaPropertiesPhoneNumbersItemsDefinitionsPhoneNumberType","PullOperation","PullOperationStatus","PullOperations","PushChangeType","PushFieldValidation","PushOperation","PushOperationChange","PushOperationRef","PushOperationStatus","PushOperations","PushOption","PushOptionChoice","PushOptionProperty","PushOptionType","PushValidationInfo","RecordRef","Security","Status","TrackingCategories","TrackingCategory","TrackingCategoryTree","Validation","ValidationItem"] diff --git a/sync-for-payroll/src/codatsyncpayroll/models/shared/account.py b/sync-for-payroll/src/codatsyncpayroll/models/shared/account.py index 00c64d5a9..73ee1ea3f 100755 --- a/sync-for-payroll/src/codatsyncpayroll/models/shared/account.py +++ b/sync-for-payroll/src/codatsyncpayroll/models/shared/account.py @@ -6,6 +6,7 @@ from ..shared import accounttype as shared_accounttype from codatsyncpayroll import utils from dataclasses_json import Undefined, dataclass_json +from decimal import Decimal from typing import Optional @@ -114,7 +115,7 @@ class Account: There are only a very small number of edge cases where this currency code is returned by the Codat system. """ - current_balance: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currentBalance'), 'exclude': lambda f: f is None }}) + current_balance: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currentBalance'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) r"""Current balance in the account.""" description: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description'), 'exclude': lambda f: f is None }}) r"""Description for the account.""" diff --git a/sync-for-payroll/src/codatsyncpayroll/models/shared/accounts.py b/sync-for-payroll/src/codatsyncpayroll/models/shared/accounts.py index e20bc29fe..419c6ee2e 100755 --- a/sync-for-payroll/src/codatsyncpayroll/models/shared/accounts.py +++ b/sync-for-payroll/src/codatsyncpayroll/models/shared/accounts.py @@ -13,7 +13,6 @@ @dataclasses.dataclass class Accounts: - r"""Success""" links: shared_links.Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) diff --git a/sync-for-payroll/src/codatsyncpayroll/models/shared/companies.py b/sync-for-payroll/src/codatsyncpayroll/models/shared/companies.py index e08b556b7..0b680ceb1 100755 --- a/sync-for-payroll/src/codatsyncpayroll/models/shared/companies.py +++ b/sync-for-payroll/src/codatsyncpayroll/models/shared/companies.py @@ -13,7 +13,6 @@ @dataclasses.dataclass class Companies: - r"""OK""" links: shared_links.Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) diff --git a/sync-for-payroll/src/codatsyncpayroll/models/shared/connections.py b/sync-for-payroll/src/codatsyncpayroll/models/shared/connections.py index 766641e8c..542551d1f 100755 --- a/sync-for-payroll/src/codatsyncpayroll/models/shared/connections.py +++ b/sync-for-payroll/src/codatsyncpayroll/models/shared/connections.py @@ -13,7 +13,6 @@ @dataclasses.dataclass class Connections: - r"""OK""" links: shared_links.Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) diff --git a/sync-for-payroll/src/codatsyncpayroll/models/shared/createaccountresponse.py b/sync-for-payroll/src/codatsyncpayroll/models/shared/createaccountresponse.py index 7f0d52b4d..d3aea0c93 100755 --- a/sync-for-payroll/src/codatsyncpayroll/models/shared/createaccountresponse.py +++ b/sync-for-payroll/src/codatsyncpayroll/models/shared/createaccountresponse.py @@ -16,7 +16,6 @@ @dataclasses.dataclass class CreateAccountResponse: - r"""Success""" company_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId') }}) r"""Unique identifier for your SMB in Codat.""" data_connection_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnectionKey') }}) @@ -103,6 +102,7 @@ class CreateAccountResponse: data_type: Optional[shared_datatype.DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) r"""Available Data types""" error_message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is None }}) + r"""The request made is not valid.""" timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInMinutes'), 'exclude': lambda f: f is None }}) timeout_in_seconds: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInSeconds'), 'exclude': lambda f: f is None }}) r"""Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.""" diff --git a/sync-for-payroll/src/codatsyncpayroll/models/shared/createjournalentryresponse.py b/sync-for-payroll/src/codatsyncpayroll/models/shared/createjournalentryresponse.py index 7f1b25af2..1e675701d 100755 --- a/sync-for-payroll/src/codatsyncpayroll/models/shared/createjournalentryresponse.py +++ b/sync-for-payroll/src/codatsyncpayroll/models/shared/createjournalentryresponse.py @@ -16,7 +16,6 @@ @dataclasses.dataclass class CreateJournalEntryResponse: - r"""Success""" company_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId') }}) r"""Unique identifier for your SMB in Codat.""" data_connection_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnectionKey') }}) @@ -97,6 +96,7 @@ class CreateJournalEntryResponse: data_type: Optional[shared_datatype.DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) r"""Available Data types""" error_message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is None }}) + r"""The request made is not valid.""" timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInMinutes'), 'exclude': lambda f: f is None }}) timeout_in_seconds: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInSeconds'), 'exclude': lambda f: f is None }}) r"""Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.""" diff --git a/sync-for-payroll/src/codatsyncpayroll/models/shared/createjournalresponse.py b/sync-for-payroll/src/codatsyncpayroll/models/shared/createjournalresponse.py index 782daecf3..35e7e7e2f 100755 --- a/sync-for-payroll/src/codatsyncpayroll/models/shared/createjournalresponse.py +++ b/sync-for-payroll/src/codatsyncpayroll/models/shared/createjournalresponse.py @@ -16,7 +16,6 @@ @dataclasses.dataclass class CreateJournalResponse: - r"""Success""" company_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId') }}) r"""Unique identifier for your SMB in Codat.""" data_connection_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnectionKey') }}) @@ -97,6 +96,7 @@ class CreateJournalResponse: data_type: Optional[shared_datatype.DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) r"""Available Data types""" error_message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is None }}) + r"""The request made is not valid.""" timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInMinutes'), 'exclude': lambda f: f is None }}) timeout_in_seconds: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInSeconds'), 'exclude': lambda f: f is None }}) r"""Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.""" diff --git a/sync-for-payroll/src/codatsyncpayroll/models/shared/errormessage.py b/sync-for-payroll/src/codatsyncpayroll/models/shared/errormessage.py index c504d1b5b..6906cf283 100755 --- a/sync-for-payroll/src/codatsyncpayroll/models/shared/errormessage.py +++ b/sync-for-payroll/src/codatsyncpayroll/models/shared/errormessage.py @@ -11,7 +11,6 @@ @dataclasses.dataclass class ErrorMessage: - r"""Your `query` parameter was not correctly formed""" can_be_retried: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('canBeRetried'), 'exclude': lambda f: f is None }}) correlation_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('correlationId'), 'exclude': lambda f: f is None }}) detailed_error_code: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('detailedErrorCode'), 'exclude': lambda f: f is None }}) diff --git a/sync-for-payroll/src/codatsyncpayroll/models/shared/journalentries.py b/sync-for-payroll/src/codatsyncpayroll/models/shared/journalentries.py index 33ec12ab3..fb09c0c23 100755 --- a/sync-for-payroll/src/codatsyncpayroll/models/shared/journalentries.py +++ b/sync-for-payroll/src/codatsyncpayroll/models/shared/journalentries.py @@ -13,7 +13,6 @@ @dataclasses.dataclass class JournalEntries: - r"""Success""" links: shared_links.Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) diff --git a/sync-for-payroll/src/codatsyncpayroll/models/shared/journalentry.py b/sync-for-payroll/src/codatsyncpayroll/models/shared/journalentry.py index f66934565..f6b0dd95a 100755 --- a/sync-for-payroll/src/codatsyncpayroll/models/shared/journalentry.py +++ b/sync-for-payroll/src/codatsyncpayroll/models/shared/journalentry.py @@ -32,7 +32,7 @@ class JournalEntryRecordReference: class JournalEntrySupplementalData: r"""Supplemental data is additional data you can include in our standard data types. - It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/additional-data) about supplemental data. + It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. """ content: Optional[dict[str, dict[str, Any]]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('content'), 'exclude': lambda f: f is None }}) @@ -127,7 +127,7 @@ class JournalEntry: supplemental_data: Optional[JournalEntrySupplementalData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplementalData'), 'exclude': lambda f: f is None }}) r"""Supplemental data is additional data you can include in our standard data types. - It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/additional-data) about supplemental data. + It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. """ updated_on: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('updatedOn'), 'exclude': lambda f: f is None }}) r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: diff --git a/sync-for-payroll/src/codatsyncpayroll/models/shared/journalline.py b/sync-for-payroll/src/codatsyncpayroll/models/shared/journalline.py index 34ea8928f..d64115869 100755 --- a/sync-for-payroll/src/codatsyncpayroll/models/shared/journalline.py +++ b/sync-for-payroll/src/codatsyncpayroll/models/shared/journalline.py @@ -6,6 +6,7 @@ from ..shared import recordref as shared_recordref from codatsyncpayroll import utils from dataclasses_json import Undefined, dataclass_json +from decimal import Decimal from typing import Optional @@ -23,7 +24,7 @@ class JournalLineTracking: @dataclasses.dataclass class JournalLine: - net_amount: float = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('netAmount') }}) + net_amount: Decimal = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('netAmount'), 'encoder': utils.decimalencoder(False, False), 'decoder': utils.decimaldecoder }}) r"""Amount for the journal line. Debit entries are considered positive, and credit entries are considered negative.""" account_ref: Optional[shared_accountref.AccountRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('accountRef'), 'exclude': lambda f: f is None }}) r"""Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account.""" diff --git a/sync-for-payroll/src/codatsyncpayroll/models/shared/journals.py b/sync-for-payroll/src/codatsyncpayroll/models/shared/journals.py index d55d3b0cd..79674bd77 100755 --- a/sync-for-payroll/src/codatsyncpayroll/models/shared/journals.py +++ b/sync-for-payroll/src/codatsyncpayroll/models/shared/journals.py @@ -13,7 +13,6 @@ @dataclasses.dataclass class Journals: - r"""Success""" links: shared_links.Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) diff --git a/sync-for-payroll/src/codatsyncpayroll/models/shared/onecompanies_1percent_7bcompanyidpercent_7d_1data_1info_get_responses_200_content_application_1json_schema_properties_addresses_items_definitions_accountingaddresstype.py b/sync-for-payroll/src/codatsyncpayroll/models/shared/onecompanies_1percent_7bcompanyidpercent_7d_1data_1info_get_responses_200_content_application_1json_schema_properties_addresses_items_definitions_accountingaddresstype.py new file mode 100755 index 000000000..2a39e1f26 --- /dev/null +++ b/sync-for-payroll/src/codatsyncpayroll/models/shared/onecompanies_1percent_7bcompanyidpercent_7d_1data_1info_get_responses_200_content_application_1json_schema_properties_addresses_items_definitions_accountingaddresstype.py @@ -0,0 +1,10 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + +class Onecompanies1Percent7BcompanyIDPercent7D1data1infoGetResponses200ContentApplication1jsonSchemaPropertiesAddressesItemsDefinitionsAccountingAddressType(str, Enum): + r"""The type of the address""" + UNKNOWN = 'Unknown' + BILLING = 'Billing' + DELIVERY = 'Delivery' diff --git a/sync-for-payroll/src/codatsyncpayroll/models/shared/onecompanies_1percent_7bcompanyidpercent_7d_1data_1info_get_responses_200_content_application_1json_schema_properties_phonenumbers_items_definitions_phonenumbertype.py b/sync-for-payroll/src/codatsyncpayroll/models/shared/onecompanies_1percent_7bcompanyidpercent_7d_1data_1info_get_responses_200_content_application_1json_schema_properties_phonenumbers_items_definitions_phonenumbertype.py new file mode 100755 index 000000000..2b6cde771 --- /dev/null +++ b/sync-for-payroll/src/codatsyncpayroll/models/shared/onecompanies_1percent_7bcompanyidpercent_7d_1data_1info_get_responses_200_content_application_1json_schema_properties_phonenumbers_items_definitions_phonenumbertype.py @@ -0,0 +1,12 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + +class Onecompanies1Percent7BcompanyIDPercent7D1data1infoGetResponses200ContentApplication1jsonSchemaPropertiesPhoneNumbersItemsDefinitionsPhoneNumberType(str, Enum): + r"""The type of phone number""" + PRIMARY = 'Primary' + LANDLINE = 'Landline' + MOBILE = 'Mobile' + FAX = 'Fax' + UNKNOWN = 'Unknown' diff --git a/sync-for-payroll/src/codatsyncpayroll/models/shared/dataconnectionhistory.py b/sync-for-payroll/src/codatsyncpayroll/models/shared/pulloperations.py similarity index 96% rename from sync-for-payroll/src/codatsyncpayroll/models/shared/dataconnectionhistory.py rename to sync-for-payroll/src/codatsyncpayroll/models/shared/pulloperations.py index 07663fa66..238e8713e 100755 --- a/sync-for-payroll/src/codatsyncpayroll/models/shared/dataconnectionhistory.py +++ b/sync-for-payroll/src/codatsyncpayroll/models/shared/pulloperations.py @@ -12,8 +12,7 @@ @dataclass_json(undefined=Undefined.EXCLUDE) @dataclasses.dataclass -class DataConnectionHistory: - r"""OK""" +class PullOperations: links: shared_links.Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) diff --git a/sync-for-payroll/src/codatsyncpayroll/models/shared/pushoperation.py b/sync-for-payroll/src/codatsyncpayroll/models/shared/pushoperation.py index 3421b9a76..48c8c9563 100755 --- a/sync-for-payroll/src/codatsyncpayroll/models/shared/pushoperation.py +++ b/sync-for-payroll/src/codatsyncpayroll/models/shared/pushoperation.py @@ -8,14 +8,13 @@ from ..shared import validation as shared_validation from codatsyncpayroll import utils from dataclasses_json import Undefined, dataclass_json -from typing import Any, Optional +from typing import Optional @dataclass_json(undefined=Undefined.EXCLUDE) @dataclasses.dataclass class PushOperation: - r"""OK""" company_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId') }}) r"""Unique identifier for your SMB in Codat.""" data_connection_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnectionKey') }}) @@ -69,8 +68,6 @@ class PushOperation: > Not all dates from Codat will contain information about time zones. > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. """ - data: Optional[dict[str, Any]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('data'), 'exclude': lambda f: f is None }}) - r"""Object submitted in push operation.""" data_type: Optional[shared_datatype.DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) r"""Available Data types""" error_message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is None }}) diff --git a/sync-for-payroll/src/codatsyncpayroll/models/shared/pushhistoryresponse.py b/sync-for-payroll/src/codatsyncpayroll/models/shared/pushoperations.py similarity index 72% rename from sync-for-payroll/src/codatsyncpayroll/models/shared/pushhistoryresponse.py rename to sync-for-payroll/src/codatsyncpayroll/models/shared/pushoperations.py index 0524c22aa..d272cb8c5 100755 --- a/sync-for-payroll/src/codatsyncpayroll/models/shared/pushhistoryresponse.py +++ b/sync-for-payroll/src/codatsyncpayroll/models/shared/pushoperations.py @@ -3,7 +3,7 @@ from __future__ import annotations import dataclasses from ..shared import links as shared_links -from ..shared import pushoperationsummary as shared_pushoperationsummary +from ..shared import pushoperation as shared_pushoperation from codatsyncpayroll import utils from dataclasses_json import Undefined, dataclass_json from typing import Optional @@ -12,12 +12,11 @@ @dataclass_json(undefined=Undefined.EXCLUDE) @dataclasses.dataclass -class PushHistoryResponse: - r"""OK""" +class PushOperations: links: shared_links.Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) - results: Optional[list[shared_pushoperationsummary.PushOperationSummary]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) + results: Optional[list[shared_pushoperation.PushOperation]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) diff --git a/sync-for-payroll/src/codatsyncpayroll/models/shared/pushoperationsummary.py b/sync-for-payroll/src/codatsyncpayroll/models/shared/pushoperationsummary.py deleted file mode 100755 index a2140af49..000000000 --- a/sync-for-payroll/src/codatsyncpayroll/models/shared/pushoperationsummary.py +++ /dev/null @@ -1,80 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from ..shared import datatype as shared_datatype -from ..shared import pushoperationchange as shared_pushoperationchange -from ..shared import pushoperationstatus as shared_pushoperationstatus -from ..shared import validation as shared_validation -from codatsyncpayroll import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) - -@dataclasses.dataclass -class PushOperationSummary: - company_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId') }}) - r"""Unique identifier for your SMB in Codat.""" - data_connection_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnectionKey') }}) - r"""Unique identifier for a company's data connection.""" - push_operation_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pushOperationKey') }}) - r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" - requested_on_utc: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('requestedOnUtc') }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 2020-10-08T22:40:50Z - 2021-01-01T00:00:00 - ``` - - - - When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - - - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - - Unqualified local time: `2021-11-15T01:00:00` - - UTC time offsets: `2021-11-15T01:00:00-05:00` - - > Time zones - > - > Not all dates from Codat will contain information about time zones. - > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - """ - status: shared_pushoperationstatus.PushOperationStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) - r"""The status of the push operation.""" - status_code: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusCode') }}) - changes: Optional[list[shared_pushoperationchange.PushOperationChange]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('changes'), 'exclude': lambda f: f is None }}) - r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" - completed_on_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('completedOnUtc'), 'exclude': lambda f: f is None }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 2020-10-08T22:40:50Z - 2021-01-01T00:00:00 - ``` - - - - When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - - - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - - Unqualified local time: `2021-11-15T01:00:00` - - UTC time offsets: `2021-11-15T01:00:00-05:00` - - > Time zones - > - > Not all dates from Codat will contain information about time zones. - > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - """ - data_type: Optional[shared_datatype.DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) - r"""Available Data types""" - error_message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is None }}) - timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInMinutes'), 'exclude': lambda f: f is None }}) - timeout_in_seconds: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInSeconds'), 'exclude': lambda f: f is None }}) - r"""Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.""" - validation: Optional[shared_validation.Validation] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is None }}) - r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" - - diff --git a/sync-for-payroll/src/codatsyncpayroll/models/shared/pushoption.py b/sync-for-payroll/src/codatsyncpayroll/models/shared/pushoption.py index 90e81e734..40f120380 100755 --- a/sync-for-payroll/src/codatsyncpayroll/models/shared/pushoption.py +++ b/sync-for-payroll/src/codatsyncpayroll/models/shared/pushoption.py @@ -15,7 +15,6 @@ @dataclasses.dataclass class PushOption: - r"""OK""" display_name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('displayName') }}) required: bool = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('required') }}) type: shared_pushoptiontype.PushOptionType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type') }}) diff --git a/sync-for-payroll/src/codatsyncpayroll/models/shared/trackingcategories.py b/sync-for-payroll/src/codatsyncpayroll/models/shared/trackingcategories.py index 7f979dc5e..11191bb0b 100755 --- a/sync-for-payroll/src/codatsyncpayroll/models/shared/trackingcategories.py +++ b/sync-for-payroll/src/codatsyncpayroll/models/shared/trackingcategories.py @@ -13,7 +13,6 @@ @dataclasses.dataclass class TrackingCategories: - r"""Success""" links: shared_links.Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) diff --git a/sync-for-payroll/src/codatsyncpayroll/push_operations.py b/sync-for-payroll/src/codatsyncpayroll/push_operations.py deleted file mode 100755 index 6f4429016..000000000 --- a/sync-for-payroll/src/codatsyncpayroll/push_operations.py +++ /dev/null @@ -1,106 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from .sdkconfiguration import SDKConfiguration -from codatsyncpayroll import utils -from codatsyncpayroll.models import errors, operations, shared -from typing import Optional - -class PushOperations: - r"""Access create, update and delete operations made to an SMB's data connection.""" - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - - def get(self, request: operations.GetPushOperationRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetPushOperationResponse: - r"""Get push operation - Retrieve push operation. - """ - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(operations.GetPushOperationRequest, base_url, '/companies/{companyId}/push/{pushOperationKey}', request) - headers = {} - headers['Accept'] = 'application/json' - headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' - - client = self.sdk_configuration.security_client - - retry_config = retries - if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - def do_request(): - return client.request('GET', url, headers=headers) - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - content_type = http_res.headers.get('Content-Type') - - res = operations.GetPushOperationResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(content_type, 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.PushOperation]) - res.push_operation = out - else: - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [401, 404, 429]: - if utils.match_content_type(content_type, 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) - res.error_message = out - else: - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - - return res - - - def list(self, request: operations.ListPushOperationsRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListPushOperationsResponse: - r"""List push operations - List push operation records. - """ - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(operations.ListPushOperationsRequest, base_url, '/companies/{companyId}/push', request) - headers = {} - query_params = utils.get_query_params(operations.ListPushOperationsRequest, request) - headers['Accept'] = 'application/json' - headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' - - client = self.sdk_configuration.security_client - - retry_config = retries - if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - def do_request(): - return client.request('GET', url, params=query_params, headers=headers) - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - content_type = http_res.headers.get('Content-Type') - - res = operations.ListPushOperationsResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(content_type, 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.PushHistoryResponse]) - res.push_history_response = out - else: - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [400, 401, 404, 429]: - if utils.match_content_type(content_type, 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) - res.error_message = out - else: - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - - return res - - \ No newline at end of file diff --git a/sync-for-payroll/src/codatsyncpayroll/sdk.py b/sync-for-payroll/src/codatsyncpayroll/sdk.py index 97a1080ea..a34ee8afe 100755 --- a/sync-for-payroll/src/codatsyncpayroll/sdk.py +++ b/sync-for-payroll/src/codatsyncpayroll/sdk.py @@ -3,11 +3,11 @@ import requests as requests_http from .accounts import Accounts from .companies import Companies +from .company_info import CompanyInfo from .connections import Connections from .journal_entries import JournalEntries from .journals import Journals from .manage_data import ManageData -from .push_operations import PushOperations from .sdkconfiguration import SDKConfiguration from .tracking_categories import TrackingCategories from codatsyncpayroll import utils @@ -18,12 +18,29 @@ class CodatSyncPayroll: Sync for Payroll is an API and a set of supporting tools built to help integrate your customers' payroll data from their HR and payroll platforms into their accounting platforms and to support its reconciliation. - [Read More...](https://docs.codat.io/payroll/overview) + [Explore product](https://docs.codat.io/payroll/overview) | [See OpenAPI spec](https://github.com/codatio/oas) + + --- + + ## Endpoints + + | Endpoints | Description | + |:---------------------|:-----------------------------------------------------------------------------------------------------------| + | Companies | Create and manage your SMB users' companies. | + | Connections | Create new and manage existing data connections for a company. | + | Accounts | Get, create, and update Accounts. | + | Journal entries | Get, create, and update Journal entries. | + | Journals | Get, create, and update Journals. | + | Tracking categories | Get, create, and update Tracking Categories for additional categorization of payroll components. | + | Company info | View company profile from the source platform. | + | Manage data | Control how data is retrieved from an integration. | """ accounts: Accounts r"""Accounts""" companies: Companies r"""Create and manage your Codat companies.""" + company_info: CompanyInfo + r"""View company information fetched from the source platform.""" connections: Connections r"""Manage your companies' data connections.""" journal_entries: JournalEntries @@ -32,8 +49,6 @@ class CodatSyncPayroll: r"""Journals""" manage_data: ManageData r"""Asynchronously retrieve data from an integration to refresh data in Codat.""" - push_operations: PushOperations - r"""Access create, update and delete operations made to an SMB's data connection.""" tracking_categories: TrackingCategories r"""Tracking categories""" @@ -44,7 +59,8 @@ def __init__(self, server_idx: int = None, server_url: str = None, url_params: dict[str, str] = None, - client: requests_http.Session = None + client: requests_http.Session = None, + retry_config: utils.RetryConfig = None ) -> None: """Instantiates the SDK configuring it with the provided parameters. @@ -57,7 +73,9 @@ def __init__(self, :param url_params: Parameters to optionally template the server URL with :type url_params: dict[str, str] :param client: The requests.Session HTTP client to use for all operations - :type client: requests_http.Session + :type client: requests_http.Session + :param retry_config: The utils.RetryConfig to use globally + :type retry_config: utils.RetryConfig """ if client is None: client = requests_http.Session() @@ -68,17 +86,17 @@ def __init__(self, if url_params is not None: server_url = utils.template_url(server_url, url_params) - self.sdk_configuration = SDKConfiguration(client, security_client, server_url, server_idx) + self.sdk_configuration = SDKConfiguration(client, security_client, server_url, server_idx, retry_config=retry_config) self._init_sdks() def _init_sdks(self): self.accounts = Accounts(self.sdk_configuration) self.companies = Companies(self.sdk_configuration) + self.company_info = CompanyInfo(self.sdk_configuration) self.connections = Connections(self.sdk_configuration) self.journal_entries = JournalEntries(self.sdk_configuration) self.journals = Journals(self.sdk_configuration) self.manage_data = ManageData(self.sdk_configuration) - self.push_operations = PushOperations(self.sdk_configuration) self.tracking_categories = TrackingCategories(self.sdk_configuration) \ No newline at end of file diff --git a/sync-for-payroll/src/codatsyncpayroll/sdkconfiguration.py b/sync-for-payroll/src/codatsyncpayroll/sdkconfiguration.py index b76f7c247..270f22517 100755 --- a/sync-for-payroll/src/codatsyncpayroll/sdkconfiguration.py +++ b/sync-for-payroll/src/codatsyncpayroll/sdkconfiguration.py @@ -3,6 +3,8 @@ import requests from dataclasses import dataclass +from .utils.retries import RetryConfig + SERVERS = [ 'https://api.codat.io', @@ -18,8 +20,9 @@ class SDKConfiguration: server_idx: int = 0 language: str = 'python' openapi_doc_version: str = '3.0.0' - sdk_version: str = '0.1.0' - gen_version: str = '2.91.4' + sdk_version: str = '0.2.0' + gen_version: str = '2.108.3' + retry_config: RetryConfig = None def get_server_details(self) -> tuple[str, dict[str, str]]: if self.server_url: diff --git a/sync-for-payroll/src/codatsyncpayroll/tracking_categories.py b/sync-for-payroll/src/codatsyncpayroll/tracking_categories.py index 3ceb8d38d..3fbf427d3 100755 --- a/sync-for-payroll/src/codatsyncpayroll/tracking_categories.py +++ b/sync-for-payroll/src/codatsyncpayroll/tracking_categories.py @@ -32,9 +32,13 @@ def get(self, request: operations.GetTrackingCategoryRequest, retries: Optional[ client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, headers=headers) @@ -82,9 +86,13 @@ def list(self, request: operations.ListTrackingCategoriesRequest, retries: Optio client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, params=query_params, headers=headers) diff --git a/sync-for-payroll/src/codatsyncpayroll/utils/utils.py b/sync-for-payroll/src/codatsyncpayroll/utils/utils.py index ea9792d0d..05eafba6c 100755 --- a/sync-for-payroll/src/codatsyncpayroll/utils/utils.py +++ b/sync-for-payroll/src/codatsyncpayroll/utils/utils.py @@ -5,6 +5,7 @@ import re from dataclasses import Field, dataclass, fields, is_dataclass, make_dataclass from datetime import date, datetime +from decimal import Decimal from email.message import Message from enum import Enum from typing import Any, Callable, Optional, Tuple, Union, get_args, get_origin @@ -112,7 +113,8 @@ def _parse_security_scheme_value(client: SecurityClient, scheme_metadata: dict, client.client.headers[header_name] = value elif scheme_type == 'http': if sub_type == 'bearer': - client.client.headers[header_name] = value.lower().startswith('bearer ') and value or f'Bearer {value}' + client.client.headers[header_name] = value.lower().startswith( + 'bearer ') and value or f'Bearer {value}' else: raise Exception('not supported') else: @@ -192,7 +194,7 @@ def generate_url(clazz: type, server_url: str, path: str, path_params: dataclass f"{pp_key},{_val_to_string(param[pp_key])}") path = path.replace( '{' + param_metadata.get('field_name', field.name) + '}', ",".join(pp_vals), 1) - elif not isinstance(param, (str, int, float, complex, bool)): + elif not isinstance(param, (str, int, float, complex, bool, Decimal)): pp_vals: list[str] = [] param_fields: Tuple[Field, ...] = fields(param) for param_field in param_fields: @@ -235,7 +237,7 @@ def template_url(url_with_params: str, params: dict[str, str]) -> str: def get_query_params(clazz: type, query_params: dataclass, gbls: dict[str, dict[str, dict[str, Any]]] = None) -> dict[ - str, list[str]]: + str, list[str]]: params: dict[str, list[str]] = {} param_fields: Tuple[Field, ...] = fields(clazz) @@ -377,7 +379,7 @@ def _get_query_param_field_name(obj_field: Field) -> str: def _get_delimited_query_params(metadata: dict, field_name: str, obj: any, delimiter: str) -> dict[ - str, list[str]]: + str, list[str]]: return _populate_form(field_name, metadata.get("explode", True), obj, _get_query_param_field_name, delimiter) @@ -391,9 +393,9 @@ def _get_delimited_query_params(metadata: dict, field_name: str, obj: any, delim def serialize_request_body(request: dataclass, request_field_name: str, serialization_method: str) -> Tuple[ - str, any, any]: + str, any, any]: if request is None: - return None, None, None, None + return None, None, None if not is_dataclass(request) or not hasattr(request, request_field_name): return serialize_content_type(request_field_name, SERIALIZATION_METHOD_TO_CONTENT_TYPE[serialization_method], @@ -486,7 +488,7 @@ def serialize_multipart_form(media_type: str, request: dataclass) -> Tuple[str, def serialize_dict(original: dict, explode: bool, field_name, existing: Optional[dict[str, list[str]]]) -> dict[ - str, list[str]]: + str, list[str]]: if existing is None: existing = [] @@ -604,7 +606,8 @@ def _populate_form(field_name: str, explode: boolean, obj: any, get_field_name_f items.append(_val_to_string(value)) if len(items) > 0: - params[field_name] = [delimiter.join([str(item) for item in items])] + params[field_name] = [delimiter.join( + [str(item) for item in items])] else: params[field_name] = [_val_to_string(obj)] @@ -681,7 +684,8 @@ def unmarshal_json(data, typ): try: out = unmarshal.from_dict({"res": json_dict}) except AttributeError as attr_err: - raise AttributeError(f'unable to unmarshal {data} as {typ}') from attr_err + raise AttributeError( + f'unable to unmarshal {data} as {typ}') from attr_err return out.res @@ -734,6 +738,36 @@ def datefromisoformat(date_str: str): return dateutil.parser.parse(date_str).date() +def bigintencoder(optional: bool): + def bigintencode(val: int): + if optional and val is None: + return None + return str(val) + + return bigintencode + + +def bigintdecoder(val): + return int(val) + + +def decimalencoder(optional: bool, as_str: bool): + def decimalencode(val: Decimal): + if optional and val is None: + return None + + if as_str: + return str(val) + + return float(val) + + return decimalencode + + +def decimaldecoder(val): + return Decimal(str(val)) + + def get_field_name(name): def override(_, _field_name=name): return _field_name