Skip to content

Commit

Permalink
Merge pull request #546 from codatio/speakeasy-sdk-regen-1702562925
Browse files Browse the repository at this point in the history
chore: 🐝 Update SDK - Generate Sync for Expenses version 1 library
  • Loading branch information
dcoplowe authored Dec 14, 2023
2 parents 1d18380 + 925ba6b commit cbe6fcd
Show file tree
Hide file tree
Showing 26 changed files with 100 additions and 75 deletions.
12 changes: 11 additions & 1 deletion previous-versions/sync-for-expenses-version-1/RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,14 @@ Based on:
### Generated
- [python v0.3.0] previous-versions/sync-for-expenses-version-1
### Releases
- [PyPI v0.3.0] https://pypi.org/project/codat-sync-for-expenses-version-1/0.3.0 - previous-versions/sync-for-expenses-version-1
- [PyPI v0.3.0] https://pypi.org/project/codat-sync-for-expenses-version-1/0.3.0 - previous-versions/sync-for-expenses-version-1

## 2023-12-14 14:08:41
### Changes
Based on:
- OpenAPI Doc prealpha https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Sync-Expenses-v1.yaml
- Speakeasy CLI 1.126.3 (2.214.3) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.4.0] previous-versions/sync-for-expenses-version-1
### Releases
- [PyPI v0.4.0] https://pypi.org/project/codat-sync-for-expenses-version-1/0.4.0 - previous-versions/sync-for-expenses-version-1
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
| `currency` | *Optional[str]* | :heavy_minus_sign: | Currency of the account. | GBP |
| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of account. | 6 |
| `name` | *Optional[str]* | :heavy_minus_sign: | Name of the account as it appears in the companies accounting software. | Purchases |
| `valid_transaction_types` | List[[shared.ValidTransactionTypes](../../models/shared/validtransactiontypes.md)] | :heavy_minus_sign: | Supported transaction types for the account. | Payment |
| `valid_transaction_types` | List[[shared.ValidTransactionTypes](../../models/shared/validtransactiontypes.md)] | :heavy_minus_sign: | Supported transaction types for the account. | |

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of tax rate. | 59_Bills |
| `name` | *Optional[str]* | :heavy_minus_sign: | Name of the tax rate in the accounting platform. | UK Standard Rate (Bills) Bills |
| `total_tax_rate` | *Optional[Decimal]* | :heavy_minus_sign: | Total (not compounded) sum of the components of a tax rate. | 20 |
| `valid_transaction_types` | List[[shared.TaxRateMappingInfoValidTransactionTypes](../../models/shared/taxratemappinginfovalidtransactiontypes.md)] | :heavy_minus_sign: | Supported transaction types for the account. | Payment |
| `valid_transaction_types` | List[[shared.TaxRateMappingInfoValidTransactionTypes](../../models/shared/taxratemappinginfovalidtransactiontypes.md)] | :heavy_minus_sign: | Supported transaction types for the account. | |

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ req = operations.CreateExpenseDatasetRequest(
),
currency='GBP',
id='4d7c6929-7770-412b-91bb-44d3bc71d111',
issue_date='2022-10-23T00:00:00.000Z',
issue_date='2022-10-23T00:00:00Z',
lines=[
shared.ExpenseTransactionLine(
account_ref=shared.RecordRef(
Expand Down
13 changes: 6 additions & 7 deletions previous-versions/sync-for-expenses-version-1/gen.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
configVersion: 1.0.0
management:
docChecksum: 9401f9bc573bd24555ed14ed9a9edb17
docChecksum: e6266a383661405eed15ff8196288875
docVersion: prealpha
speakeasyVersion: 1.125.2
generationVersion: 2.210.6
speakeasyVersion: 1.126.3
generationVersion: 2.214.3
generation:
comments: {}
sdkClassName: CodatSyncExpenses
repoURL: https://github.com/codatio/client-sdk-python.git
usageSnippets:
optionalPropertyRendering: withExample
telemetryEnabled: true
singleTagPerOp: false
features:
python:
core: 4.1.6
core: 4.3.0
deprecations: 2.81.1
examples: 2.81.3
globalSecurity: 2.83.0
globalSecurity: 2.83.1
globalServerURLs: 2.82.1
nameOverrides: 2.81.1
retries: 2.82.0
python:
version: 0.3.0
version: 0.4.0
author: Codat
clientServerStatusCodesAsErrors: true
description: Push expenses to accounting platforms.
Expand Down
2 changes: 1 addition & 1 deletion previous-versions/sync-for-expenses-version-1/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setuptools.setup(
name="codat-sync-for-expenses-version-1",
version="0.3.0",
version="0.4.0",
author="Codat",
description="Push expenses to accounting platforms.",
long_description=long_description,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def __init__(self, sdk_config: SDKConfiguration) -> None:



def create_company(self, request: shared.CompanyRequestBody, retries: Optional[utils.RetryConfig] = None) -> operations.CreateCompanyResponse:
def create_company(self, request: Optional[shared.CompanyRequestBody], retries: Optional[utils.RetryConfig] = None) -> operations.CreateCompanyResponse:
r"""Create company
Creates a new company that can be used to assign connections to.
Expand All @@ -24,7 +24,7 @@ def create_company(self, request: shared.CompanyRequestBody, retries: Optional[u

url = base_url + '/companies'
headers = {}
req_content_type, data, form = utils.serialize_request_body(request, "request", False, True, 'json')
req_content_type, data, form = utils.serialize_request_body(request, Optional[shared.CompanyRequestBody], "request", False, True, 'json')
if req_content_type not in ('multipart/form-data', 'multipart/mixed'):
headers['content-type'] = req_content_type
headers['Accept'] = 'application/json'
Expand Down Expand Up @@ -248,7 +248,7 @@ def update_company(self, request: operations.UpdateCompanyRequest, retries: Opti

url = utils.generate_url(operations.UpdateCompanyRequest, base_url, '/companies/{companyId}', request)
headers = {}
req_content_type, data, form = utils.serialize_request_body(request, "company_request_body", False, True, 'json')
req_content_type, data, form = utils.serialize_request_body(request, operations.UpdateCompanyRequest, "company_request_body", False, True, 'json')
if req_content_type not in ('multipart/form-data', 'multipart/mixed'):
headers['content-type'] = req_content_type
headers['Accept'] = 'application/json'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def save_company_configuration(self, request: operations.SaveCompanyConfiguratio

url = utils.generate_url(operations.SaveCompanyConfigurationRequest, base_url, '/companies/{companyId}/sync/expenses/config', request)
headers = {}
req_content_type, data, form = utils.serialize_request_body(request, "company_configuration", False, True, 'json')
req_content_type, data, form = utils.serialize_request_body(request, operations.SaveCompanyConfigurationRequest, "company_configuration", False, True, 'json')
if req_content_type not in ('multipart/form-data', 'multipart/mixed'):
headers['content-type'] = req_content_type
headers['Accept'] = 'application/json'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def create_connection(self, request: operations.CreateConnectionRequest, retries

url = utils.generate_url(operations.CreateConnectionRequest, base_url, '/companies/{companyId}/connections', request)
headers = {}
req_content_type, data, form = utils.serialize_request_body(request, "request_body", False, True, 'json')
req_content_type, data, form = utils.serialize_request_body(request, operations.CreateConnectionRequest, "request_body", False, True, 'json')
if req_content_type not in ('multipart/form-data', 'multipart/mixed'):
headers['content-type'] = req_content_type
headers['Accept'] = 'application/json'
Expand Down Expand Up @@ -305,7 +305,7 @@ def unlink(self, request: operations.UnlinkConnectionRequest, retries: Optional[

url = utils.generate_url(operations.UnlinkConnectionRequest, base_url, '/companies/{companyId}/connections/{connectionId}', request)
headers = {}
req_content_type, data, form = utils.serialize_request_body(request, "request_body", False, True, 'json')
req_content_type, data, form = utils.serialize_request_body(request, operations.UnlinkConnectionRequest, "request_body", False, True, 'json')
if req_content_type not in ('multipart/form-data', 'multipart/mixed'):
headers['content-type'] = req_content_type
headers['Accept'] = 'application/json'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def create_expense_dataset(self, request: operations.CreateExpenseDatasetRequest

url = utils.generate_url(operations.CreateExpenseDatasetRequest, base_url, '/companies/{companyId}/sync/expenses/data/expense-transactions', request)
headers = {}
req_content_type, data, form = utils.serialize_request_body(request, "create_expense_request", False, True, 'json')
req_content_type, data, form = utils.serialize_request_body(request, operations.CreateExpenseDatasetRequest, "create_expense_request", False, True, 'json')
if req_content_type not in ('multipart/form-data', 'multipart/mixed'):
headers['content-type'] = req_content_type
headers['Accept'] = 'application/json'
Expand Down Expand Up @@ -81,7 +81,7 @@ def update_expense_dataset(self, request: operations.UpdateExpenseDatasetRequest

url = utils.generate_url(operations.UpdateExpenseDatasetRequest, base_url, '/companies/{companyId}/sync/expenses/expense-transactions/{transactionId}', request)
headers = {}
req_content_type, data, form = utils.serialize_request_body(request, "update_expense_request", False, True, 'json')
req_content_type, data, form = utils.serialize_request_body(request, operations.UpdateExpenseDatasetRequest, "update_expense_request", False, True, 'json')
if req_content_type not in ('multipart/form-data', 'multipart/mixed'):
headers['content-type'] = req_content_type
headers['Accept'] = 'application/json'
Expand Down Expand Up @@ -140,7 +140,7 @@ def upload_attachment(self, request: operations.UploadAttachmentRequest, retries

url = utils.generate_url(operations.UploadAttachmentRequest, base_url, '/companies/{companyId}/sync/expenses/syncs/{syncId}/transactions/{transactionId}/attachments', request)
headers = {}
req_content_type, data, form = utils.serialize_request_body(request, "attachment_upload", False, True, 'multipart')
req_content_type, data, form = utils.serialize_request_body(request, operations.UploadAttachmentRequest, "attachment_upload", False, True, 'multipart')
if req_content_type not in ('multipart/form-data', 'multipart/mixed'):
headers['content-type'] = req_content_type
headers['Accept'] = 'application/json'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ class ErrorMessage(Exception):


def __str__(self) -> str:
return utils.marshal_json(self)
return utils.marshal_json(self, type(self))
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ class ExpenseTransaction:
| **GBP** | £20 | 1.277 | $25.54 |
| **EUR** | €20 | 1.134 | $22.68 |
| **RUB** | ₽20 | 0.015 | $0.30 |
### Integration-specific details
| Integration | Scenario | System behavior |
|-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. |
"""
lines: Optional[List[ExpenseTransactionLine]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('lines'), 'exclude': lambda f: f is None }})
r"""Array of transaction lines."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ class UpdateExpenseRequest:
| **GBP** | £20 | 1.277 | $25.54 |
| **EUR** | €20 | 1.134 | $22.68 |
| **RUB** | ₽20 | 0.015 | $0.30 |
### Integration-specific details
| Integration | Scenario | System behavior |
|-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. |
"""
lines: Optional[List[ExpenseTransactionLine]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('lines'), 'exclude': lambda f: f is None }})
r"""Array of transaction lines."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ class SDKConfiguration:
server_idx: int = 0
language: str = 'python'
openapi_doc_version: str = 'prealpha'
sdk_version: str = '0.3.0'
gen_version: str = '2.210.6'
user_agent: str = 'speakeasy-sdk/python 0.3.0 2.210.6 prealpha codat-sync-for-expenses-version-1'
sdk_version: str = '0.4.0'
gen_version: str = '2.214.3'
user_agent: str = 'speakeasy-sdk/python 0.4.0 2.214.3 prealpha codat-sync-for-expenses-version-1'
retry_config: RetryConfig = None

def get_server_details(self) -> Tuple[str, Dict[str, str]]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def initiate_sync(self, request: operations.InitiateSyncRequest, retries: Option

url = utils.generate_url(operations.InitiateSyncRequest, base_url, '/companies/{companyId}/sync/expenses/syncs', request)
headers = {}
req_content_type, data, form = utils.serialize_request_body(request, "post_sync", False, True, 'json')
req_content_type, data, form = utils.serialize_request_body(request, operations.InitiateSyncRequest, "post_sync", False, True, 'json')
if req_content_type not in ('multipart/form-data', 'multipart/mixed'):
headers['content-type'] = req_content_type
headers['Accept'] = 'application/json'
Expand Down
Loading

0 comments on commit cbe6fcd

Please sign in to comment.