Skip to content

Commit f76233b

Browse files
Merge pull request #23 from codatio/speakeasy-sdk-regen-1677684871
chore: speakeasy sdk regeneration - Generate Sync Commerce SDK
2 parents c456444 + 64033f7 commit f76233b

38 files changed

+3798
-1
lines changed

synccommerce/README.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# codat-synccommerce
2+
3+
<!-- Start SDK Installation -->
4+
## SDK Installation
5+
6+
```bash
7+
pip install codat-synccommerce
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.AddDataConnectionRequest(
25+
path_params=operations.AddDataConnectionPathParams(
26+
company_id="unde",
27+
),
28+
request="deserunt",
29+
)
30+
31+
res = s.company_management.add_data_connection(req)
32+
33+
if res.add_data_connection_200_application_json_object is not None:
34+
# handle response
35+
```
36+
<!-- End SDK Example Usage -->
37+
38+
<!-- Start SDK Available Operations -->
39+
## SDK Available Operations
40+
41+
42+
### company_management
43+
44+
* `add_data_connection` - Create data connection
45+
* `companies` - List companies
46+
* `get_dataconnections` - List connections
47+
* `post_companies` - Create a Sync for commerce company
48+
* `update_data_connection` - Update data connection
49+
50+
### integrations
51+
52+
* `get_integration_branding` - Get branding for an integration
53+
* `get_integrations` - List Codat's integrations
54+
55+
### sync
56+
57+
* `post_sync_latest` - Sync commerce data
58+
59+
### sync_configuration
60+
61+
* `configure_sync` - Update Sync for Commerce settings
62+
* `get_company_commerce_sync_status` - Get Sync for Commerce status
63+
* `get_sync_flow_url` - Get Sync Flow Url
64+
* `get_sync_options` - List options for Sync for Commerce settings
65+
66+
### sync_data
67+
68+
* `check_data_status` - Get dataset status
69+
* `send_orders_data` - Create orders dataset
70+
* `send_payments_data` - Create payments dataset
71+
* `send_transactions_data` - Create transactions dataset
72+
<!-- End SDK Available Operations -->
73+
74+
### SDK Generated by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks)

synccommerce/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:34:30
4+
### Changes
5+
Based on:
6+
- OpenAPI Doc 1.1 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Sync-Commerce.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-synccommerce/0.1.0 - synccommerce
10+
11+
## 2023-03-02 00:09:27
12+
### Changes
13+
Based on:
14+
- OpenAPI Doc 1.1 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Sync-Commerce.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-synccommerce/0.1.1 - synccommerce

synccommerce/USAGE.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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.AddDataConnectionRequest(
14+
path_params=operations.AddDataConnectionPathParams(
15+
company_id="unde",
16+
),
17+
request="deserunt",
18+
)
19+
20+
res = s.company_management.add_data_connection(req)
21+
22+
if res.add_data_connection_200_application_json_object is not None:
23+
# handle response
24+
```
25+
<!-- End SDK Example Usage -->

synccommerce/files.gen

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
src/codat/company_management.py
2+
src/codat/integrations.py
3+
src/codat/sync.py
4+
src/codat/sync_configuration.py
5+
src/codat/sync_data.py
6+
src/codat/sdk.py
7+
setup.py
8+
src/codat/__init__.py
9+
src/codat/models/__init__.py
10+
src/codat/utils/__init__.py
11+
src/codat/utils/retries.py
12+
src/codat/utils/utils.py
13+
src/codat/models/operations/add_data_connection.py
14+
src/codat/models/operations/companies.py
15+
src/codat/models/operations/get_dataconnections.py
16+
src/codat/models/operations/post_companies.py
17+
src/codat/models/operations/update_data_connection.py
18+
src/codat/models/operations/get_integration_branding.py
19+
src/codat/models/operations/get_integrations.py
20+
src/codat/models/operations/post_sync_latest.py
21+
src/codat/models/operations/configure_sync.py
22+
src/codat/models/operations/get_company_commerce_sync_status.py
23+
src/codat/models/operations/get_sync_flow_url.py
24+
src/codat/models/operations/get_sync_options.py
25+
src/codat/models/operations/check_data_status.py
26+
src/codat/models/operations/send_orders_data.py
27+
src/codat/models/operations/send_payments_data.py
28+
src/codat/models/operations/send_transactions_data.py
29+
src/codat/models/operations/__init__.py
30+
src/codat/models/shared/security.py
31+
src/codat/models/shared/__init__.py
32+
src/codat/models/webhooks/sync_connection_deleted.py
33+
src/codat/models/webhooks/__init__.py
34+
USAGE.md

synccommerce/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: 61f4faedb5cff207a308dde1b4192a48
4+
docVersion: "1.1"
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-synccommerce

synccommerce/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-synccommerce",
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+
)

synccommerce/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 *
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
import requests
2+
from . import utils
3+
from codat.models import operations
4+
from typing import Optional
5+
6+
class CompanyManagement:
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 add_data_connection(self, request: operations.AddDataConnectionRequest) -> operations.AddDataConnectionResponse:
24+
r"""Create data connection
25+
Create a data connection.
26+
"""
27+
28+
base_url = self._server_url
29+
30+
url = utils.generate_url(base_url, "/meta/companies/{companyId}/connections", request.path_params)
31+
32+
headers = {}
33+
req_content_type, data, form = utils.serialize_request_body(request)
34+
if req_content_type != "multipart/form-data" and req_content_type != "multipart/mixed":
35+
headers["content-type"] = req_content_type
36+
37+
client = self._security_client
38+
39+
r = client.request("POST", url, data=data, files=form, headers=headers)
40+
content_type = r.headers.get("Content-Type")
41+
42+
res = operations.AddDataConnectionResponse(status_code=r.status_code, content_type=content_type)
43+
44+
if r.status_code == 200:
45+
if utils.match_content_type(content_type, "application/json"):
46+
out = utils.unmarshal_json(r.text, Optional[operations.AddDataConnection200ApplicationJSON])
47+
res.add_data_connection_200_application_json_object = out
48+
49+
return res
50+
51+
52+
def companies(self, request: operations.CompaniesRequest) -> operations.CompaniesResponse:
53+
r"""List companies
54+
Retrieve a list of all companies the client has created.
55+
"""
56+
57+
base_url = self._server_url
58+
59+
url = base_url.removesuffix("/") + "/meta/companies"
60+
61+
query_params = utils.get_query_params(request.query_params)
62+
63+
client = self._security_client
64+
65+
r = client.request("GET", url, params=query_params)
66+
content_type = r.headers.get("Content-Type")
67+
68+
res = operations.CompaniesResponse(status_code=r.status_code, content_type=content_type)
69+
70+
if r.status_code == 200:
71+
if utils.match_content_type(content_type, "application/json"):
72+
out = utils.unmarshal_json(r.text, Optional[operations.Companies200ApplicationJSON])
73+
res.companies_200_application_json_object = out
74+
75+
return res
76+
77+
78+
def get_dataconnections(self, request: operations.GetDataconnectionsRequest) -> operations.GetDataconnectionsResponse:
79+
r"""List connections
80+
Retrieve previously created data connections.
81+
"""
82+
83+
base_url = self._server_url
84+
85+
url = utils.generate_url(base_url, "/meta/companies/{companyId}/connections", request.path_params)
86+
87+
query_params = utils.get_query_params(request.query_params)
88+
89+
client = self._security_client
90+
91+
r = client.request("GET", url, params=query_params)
92+
content_type = r.headers.get("Content-Type")
93+
94+
res = operations.GetDataconnectionsResponse(status_code=r.status_code, content_type=content_type)
95+
96+
if r.status_code == 200:
97+
if utils.match_content_type(content_type, "application/json"):
98+
out = utils.unmarshal_json(r.text, Optional[operations.GetDataconnections200ApplicationJSON])
99+
res.get_dataconnections_200_application_json_object = out
100+
101+
return res
102+
103+
104+
def post_companies(self, request: operations.PostCompaniesRequest) -> operations.PostCompaniesResponse:
105+
r"""Create a Sync for commerce company
106+
Creates a Codat company with a commerce partner data connection.
107+
"""
108+
109+
base_url = self._server_url
110+
111+
url = base_url.removesuffix("/") + "/meta/companies/sync"
112+
113+
headers = {}
114+
req_content_type, data, form = utils.serialize_request_body(request)
115+
if req_content_type != "multipart/form-data" and req_content_type != "multipart/mixed":
116+
headers["content-type"] = req_content_type
117+
118+
client = self._security_client
119+
120+
r = client.request("POST", url, data=data, files=form, headers=headers)
121+
content_type = r.headers.get("Content-Type")
122+
123+
res = operations.PostCompaniesResponse(status_code=r.status_code, content_type=content_type)
124+
125+
if r.status_code == 200:
126+
if utils.match_content_type(content_type, "application/json"):
127+
out = utils.unmarshal_json(r.text, Optional[operations.PostCompanies200ApplicationJSON])
128+
res.post_companies_200_application_json_object = out
129+
130+
return res
131+
132+
133+
def update_data_connection(self, request: operations.UpdateDataConnectionRequest) -> operations.UpdateDataConnectionResponse:
134+
r"""Update data connection
135+
Update a data connection
136+
"""
137+
138+
base_url = self._server_url
139+
140+
url = utils.generate_url(base_url, "/meta/companies/{companyId}/connections/{connectionId}", request.path_params)
141+
142+
headers = {}
143+
req_content_type, data, form = utils.serialize_request_body(request)
144+
if req_content_type != "multipart/form-data" and req_content_type != "multipart/mixed":
145+
headers["content-type"] = req_content_type
146+
147+
client = self._security_client
148+
149+
r = client.request("PATCH", url, data=data, files=form, headers=headers)
150+
content_type = r.headers.get("Content-Type")
151+
152+
res = operations.UpdateDataConnectionResponse(status_code=r.status_code, content_type=content_type)
153+
154+
if r.status_code == 200:
155+
if utils.match_content_type(content_type, "application/json"):
156+
out = utils.unmarshal_json(r.text, Optional[operations.UpdateDataConnection200ApplicationJSON])
157+
res.update_data_connection_200_application_json_object = out
158+
159+
return res
160+
161+

0 commit comments

Comments
 (0)