Skip to content

Commit c70f855

Browse files
Merge pull request #15 from codatio/speakeasy-sdk-regen-1677684839
chore: speakeasy sdk regeneration - Generate Assess SDK
2 parents 849fd67 + 55b1ec4 commit c70f855

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+5159
-1
lines changed

assess/README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# codat-assess
2+
3+
<!-- Start SDK Installation -->
4+
## SDK Installation
5+
6+
```bash
7+
pip install codat-assess
8+
```
9+
<!-- End SDK Installation -->
10+
11+
## SDK Example Usage
12+
<!-- Start SDK Example Usage -->
13+
```python
14+
import codat
15+
from codat.models import operations, shared
16+
17+
s = codat.Codat()
18+
s.config_security(
19+
security=shared.Security(
20+
api_key="YOUR_API_KEY_HERE",
21+
)
22+
)
23+
24+
req = operations.GetAccountCategoryRequest(
25+
path_params=operations.GetAccountCategoryPathParams(
26+
account_id="unde",
27+
company_id="deserunt",
28+
connection_id="porro",
29+
),
30+
)
31+
32+
res = s.categories.get_account_category(req)
33+
34+
if res.categorised_account is not None:
35+
# handle response
36+
```
37+
<!-- End SDK Example Usage -->
38+
39+
<!-- Start SDK Available Operations -->
40+
## SDK Available Operations
41+
42+
43+
### categories
44+
45+
* `get_account_category` - Get suggested and/or confirmed category for a specific account
46+
* `list_accounts_categories` - List suggested and confirmed account categories
47+
* `list_available_account_categories` - List account categories
48+
* `update_account_category` - Patch account categories
49+
* `update_accounts_categories` - Confirm categories for accounts
50+
51+
### data_integrity
52+
53+
* `get_data_integrity_details` - Lists data integrity details for date type
54+
* `get_data_integrity_status` - Get data integrity status
55+
* `get_data_integrity_summaries` - Get data integrity summary
56+
57+
### excel_reports
58+
59+
* `get_accounting_marketing_metrics` - Get the marketing metrics from an accounting source for a given company.
60+
* `get_excel_report` - Download generated excel report
61+
* `make_request_to_download_excel_report` - Request an Excel report for download
62+
* `request_excel_report_for_download` - Request an Excel report for download
63+
64+
### reports
65+
66+
* `get_accounts_for_enhanced_balance_sheet` - Enhanced Balance Sheet Accounts
67+
* `get_accounts_for_enhanced_profit_and_loss` - Enhanced Profit and Loss Accounts
68+
* `get_commerce_customer_retention_metrics` - Get the customer retention metrics for a specific company.
69+
* `get_commerce_lifetime_value_metrics` - Get the lifetime value metric for a specific company.
70+
* `get_commerce_orders_metrics` - Get order information for a specific company
71+
* `get_commerce_refunds_metrics` - Get the refunds information for a specific company
72+
* `get_commerce_revenue_metrics` - Commerce Revenue Metrics
73+
* `get_enhanced_balance_sheet` - Enhanced Balance Sheet
74+
* `get_enhanced_cash_flow_transactions` - Get enhanced cash flow report
75+
* `get_enhanced_financial_metrics` - List finanicial metrics
76+
* `get_enhanced_profit_and_loss` - Enhanced Profit and Loss
77+
* `get_recurring_revenue_metrics` - Get key metrics for subscription revenue
78+
* `request_recurring_revenue_metrics` - Request production of key subscription revenue metrics
79+
<!-- End SDK Available Operations -->
80+
81+
### SDK Generated by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks)

assess/RELEASES.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
3+
## 2023-03-01 15:33:58
4+
### Changes
5+
Based on:
6+
- OpenAPI Doc 1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Assess.yaml
7+
- Speakeasy CLI 1.7.0 https://github.com/speakeasy-api/speakeasy
8+
### Releases
9+
- [PyPI v0.1.0] https://pypi.org/project/codat-assess/0.1.0 - assess
10+
11+
## 2023-03-02 00:14:41
12+
### Changes
13+
Based on:
14+
- OpenAPI Doc 1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Assess.yaml
15+
- Speakeasy CLI 1.7.1 https://github.com/speakeasy-api/speakeasy
16+
### Releases
17+
- [PyPI v0.1.1] https://pypi.org/project/codat-assess/0.1.1 - assess

assess/USAGE.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!-- Start SDK Example Usage -->
2+
```python
3+
import codat
4+
from codat.models import operations, shared
5+
6+
s = codat.Codat()
7+
s.config_security(
8+
security=shared.Security(
9+
api_key="YOUR_API_KEY_HERE",
10+
)
11+
)
12+
13+
req = operations.GetAccountCategoryRequest(
14+
path_params=operations.GetAccountCategoryPathParams(
15+
account_id="unde",
16+
company_id="deserunt",
17+
connection_id="porro",
18+
),
19+
)
20+
21+
res = s.categories.get_account_category(req)
22+
23+
if res.categorised_account is not None:
24+
# handle response
25+
```
26+
<!-- End SDK Example Usage -->

assess/files.gen

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
src/codat/categories.py
2+
src/codat/data_integrity.py
3+
src/codat/excel_reports.py
4+
src/codat/reports.py
5+
src/codat/sdk.py
6+
setup.py
7+
src/codat/__init__.py
8+
src/codat/models/__init__.py
9+
src/codat/utils/__init__.py
10+
src/codat/utils/retries.py
11+
src/codat/utils/utils.py
12+
src/codat/models/operations/get_account_category.py
13+
src/codat/models/operations/list_accounts_categories.py
14+
src/codat/models/operations/list_available_account_categories.py
15+
src/codat/models/operations/update_account_category.py
16+
src/codat/models/operations/update_accounts_categories.py
17+
src/codat/models/operations/get_data_integrity_details.py
18+
src/codat/models/operations/get_data_integrity_status.py
19+
src/codat/models/operations/get_data_integrity_summaries.py
20+
src/codat/models/operations/get_accounting_marketing_metrics.py
21+
src/codat/models/operations/get_excel_report.py
22+
src/codat/models/operations/make_request_to_download_excel_report.py
23+
src/codat/models/operations/request_excel_report_for_download.py
24+
src/codat/models/operations/get_accounts_for_enhanced_balance_sheet.py
25+
src/codat/models/operations/get_accounts_for_enhanced_profit_and_loss.py
26+
src/codat/models/operations/get_commerce_customer_retention_metrics.py
27+
src/codat/models/operations/get_commerce_lifetime_value_metrics.py
28+
src/codat/models/operations/get_commerce_orders_metrics.py
29+
src/codat/models/operations/get_commerce_refunds_metrics.py
30+
src/codat/models/operations/get_commerce_revenue_metrics.py
31+
src/codat/models/operations/get_enhanced_balance_sheet.py
32+
src/codat/models/operations/get_enhanced_cash_flow_transactions.py
33+
src/codat/models/operations/get_enhanced_financial_metrics.py
34+
src/codat/models/operations/get_enhanced_profit_and_loss.py
35+
src/codat/models/operations/get_recurring_revenue_metrics.py
36+
src/codat/models/operations/request_recurring_revenue_metrics.py
37+
src/codat/models/operations/__init__.py
38+
src/codat/models/shared/security.py
39+
src/codat/models/shared/__init__.py
40+
src/codat/models/webhooks/account_categories_updated.py
41+
src/codat/models/webhooks/__init__.py
42+
USAGE.md

assess/gen.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
configVersion: 1.0.0
2+
management:
3+
docChecksum: 6d179ad7da9b36519e181c4b97caba36
4+
docVersion: "1.0"
5+
speakeasyVersion: 1.7.1
26
generation:
7+
telemetryEnabled: false
38
sdkClassName: codat
49
sdkFlattening: true
510
python:
6-
version: 0.0.1
11+
version: 0.1.1
12+
author: Speakeasy
13+
description: Python Client SDK Generated by Speakeasy
714
packageName: codat-assess

assess/setup.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import setuptools
2+
3+
try:
4+
with open("README.md", "r") as fh:
5+
long_description = fh.read()
6+
except FileNotFoundError:
7+
long_description = ""
8+
9+
setuptools.setup(
10+
name="codat-assess",
11+
version="0.1.1",
12+
author="Speakeasy",
13+
description="Python Client SDK Generated by Speakeasy",
14+
long_description=long_description,
15+
long_description_content_type="text/markdown",
16+
packages=setuptools.find_packages(where="src"),
17+
install_requires=[
18+
"certifi==2022.12.07",
19+
"charset-normalizer==2.1.1",
20+
"dataclasses-json-speakeasy==0.5.8",
21+
"idna==3.3",
22+
"marshmallow==3.17.1",
23+
"marshmallow-enum==1.5.1",
24+
"mypy-extensions==0.4.3",
25+
"packaging==21.3",
26+
"pyparsing==3.0.9",
27+
"python-dateutil==2.8.2",
28+
"requests==2.28.1",
29+
"six==1.16.0",
30+
"typing-inspect==0.8.0",
31+
"typing_extensions==4.3.0",
32+
"urllib3==1.26.12",
33+
],
34+
package_dir={'': 'src'},
35+
python_requires='>=3.9'
36+
)

assess/src/codat/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .sdk import *

assess/src/codat/categories.py

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
import requests
2+
from . import utils
3+
from codat.models import operations
4+
from typing import Optional
5+
6+
class Categories:
7+
_client: requests.Session
8+
_security_client: requests.Session
9+
_server_url: str
10+
_language: str
11+
_sdk_version: str
12+
_gen_version: str
13+
14+
def __init__(self, client: requests.Session, security_client: requests.Session, server_url: str, language: str, sdk_version: str, gen_version: str) -> None:
15+
self._client = client
16+
self._security_client = security_client
17+
self._server_url = server_url
18+
self._language = language
19+
self._sdk_version = sdk_version
20+
self._gen_version = gen_version
21+
22+
23+
def get_account_category(self, request: operations.GetAccountCategoryRequest) -> operations.GetAccountCategoryResponse:
24+
r"""Get suggested and/or confirmed category for a specific account
25+
Get category for specific nominal account.
26+
"""
27+
28+
base_url = self._server_url
29+
30+
url = utils.generate_url(base_url, "/data/companies/{companyId}/connections/{connectionId}/assess/accounts/{accountId}/categories", request.path_params)
31+
32+
33+
client = self._security_client
34+
35+
r = client.request("GET", url)
36+
content_type = r.headers.get("Content-Type")
37+
38+
res = operations.GetAccountCategoryResponse(status_code=r.status_code, content_type=content_type)
39+
40+
if r.status_code == 200:
41+
if utils.match_content_type(content_type, "application/json"):
42+
out = utils.unmarshal_json(r.text, Optional[operations.GetAccountCategoryCategorisedAccount])
43+
res.categorised_account = out
44+
45+
return res
46+
47+
48+
def list_accounts_categories(self, request: operations.ListAccountsCategoriesRequest) -> operations.ListAccountsCategoriesResponse:
49+
r"""List suggested and confirmed account categories
50+
Lists suggested and confirmed chart of account categories for the given company and data connection.
51+
"""
52+
53+
base_url = self._server_url
54+
55+
url = utils.generate_url(base_url, "/data/companies/{companyId}/connections/{connectionId}/assess/accounts/categories", request.path_params)
56+
57+
query_params = utils.get_query_params(request.query_params)
58+
59+
client = self._security_client
60+
61+
r = client.request("GET", url, params=query_params)
62+
content_type = r.headers.get("Content-Type")
63+
64+
res = operations.ListAccountsCategoriesResponse(status_code=r.status_code, content_type=content_type)
65+
66+
if r.status_code == 200:
67+
if utils.match_content_type(content_type, "application/json"):
68+
out = utils.unmarshal_json(r.text, Optional[operations.ListAccountsCategoriesLinks])
69+
res.links = out
70+
71+
return res
72+
73+
74+
def list_available_account_categories(self) -> operations.ListAvailableAccountCategoriesResponse:
75+
r"""List account categories
76+
Lists available account categories Codat's categorisation engine can provide.
77+
"""
78+
79+
base_url = self._server_url
80+
81+
url = base_url.removesuffix("/") + "/data/assess/accounts/categories"
82+
83+
84+
client = self._security_client
85+
86+
r = client.request("GET", url)
87+
content_type = r.headers.get("Content-Type")
88+
89+
res = operations.ListAvailableAccountCategoriesResponse(status_code=r.status_code, content_type=content_type)
90+
91+
if r.status_code == 200:
92+
if utils.match_content_type(content_type, "application/json"):
93+
out = utils.unmarshal_json(r.text, Optional[list[operations.ListAvailableAccountCategoriesChartOfAccountCategory]])
94+
res.list_available_account_categories_chart_of_account_category_all_ofs = out
95+
96+
return res
97+
98+
99+
def update_account_category(self, request: operations.UpdateAccountCategoryRequest) -> operations.UpdateAccountCategoryResponse:
100+
r"""Patch account categories
101+
Update category for a specific nominal account
102+
"""
103+
104+
base_url = self._server_url
105+
106+
url = utils.generate_url(base_url, "/data/companies/{companyId}/connections/{connectionId}/assess/accounts/{accountId}/categories", request.path_params)
107+
108+
headers = {}
109+
req_content_type, data, form = utils.serialize_request_body(request)
110+
if req_content_type != "multipart/form-data" and req_content_type != "multipart/mixed":
111+
headers["content-type"] = req_content_type
112+
113+
client = self._security_client
114+
115+
r = client.request("PATCH", url, data=data, files=form, headers=headers)
116+
content_type = r.headers.get("Content-Type")
117+
118+
res = operations.UpdateAccountCategoryResponse(status_code=r.status_code, content_type=content_type)
119+
120+
if r.status_code == 200:
121+
if utils.match_content_type(content_type, "application/json"):
122+
out = utils.unmarshal_json(r.text, Optional[operations.UpdateAccountCategoryCategorisedAccount])
123+
res.categorised_account = out
124+
125+
return res
126+
127+
128+
def update_accounts_categories(self, request: operations.UpdateAccountsCategoriesRequest) -> operations.UpdateAccountsCategoriesResponse:
129+
r"""Confirm categories for accounts
130+
Comfirms the categories for all or a batch of accounts for a specific connection.
131+
"""
132+
133+
base_url = self._server_url
134+
135+
url = utils.generate_url(base_url, "/data/companies/{companyId}/connections/{connectionId}/assess/accounts/categories", request.path_params)
136+
137+
headers = {}
138+
req_content_type, data, form = utils.serialize_request_body(request)
139+
if req_content_type != "multipart/form-data" and req_content_type != "multipart/mixed":
140+
headers["content-type"] = req_content_type
141+
142+
client = self._security_client
143+
144+
r = client.request("PATCH", url, data=data, files=form, headers=headers)
145+
content_type = r.headers.get("Content-Type")
146+
147+
res = operations.UpdateAccountsCategoriesResponse(status_code=r.status_code, content_type=content_type)
148+
149+
if r.status_code == 200:
150+
if utils.match_content_type(content_type, "application/json"):
151+
out = utils.unmarshal_json(r.text, Optional[list[operations.UpdateAccountsCategoriesCategorisedAccount]])
152+
res.categorised_accounts = out
153+
154+
return res
155+
156+

0 commit comments

Comments
 (0)