Skip to content

Commit 5a47eee

Browse files
authored
Merge pull request #56 from codatio/speakeasy-sdk-regen-1679097628
chore: speakeasy sdk regeneration - Generate Files SDK
2 parents 77df54c + 07c029d commit 5a47eee

File tree

21 files changed

+235
-72
lines changed

21 files changed

+235
-72
lines changed

files/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ s = codat.Codat(
2222

2323

2424
req = operations.DownloadFilesRequest(
25-
company_id="unde",
26-
date_="2022-08-12T20:13:28.710Z",
25+
company_id="8a210b68-6988-11ed-a1eb-0242ac120002",
26+
date_="2022-10-23T00:00:00Z",
2727
)
2828

2929
res = s.files.download_files(req)
3030

31-
if res.status_code == 200:
31+
if res.data is not None:
3232
# handle response
3333
```
3434
<!-- End SDK Example Usage -->
3535

3636
<!-- Start SDK Available Operations -->
37-
## SDK Available Operations
37+
## Available Resources and Operations
3838

3939

4040
### files

files/RELEASES.md

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,84 @@ Based on:
9494
- OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml
9595
- Speakeasy CLI 1.12.1 https://github.com/speakeasy-api/speakeasy
9696
### Releases
97-
- [PyPI v0.5.1] https://pypi.org/project/codat-files/0.5.1 - files
97+
- [PyPI v0.5.1] https://pypi.org/project/codat-files/0.5.1 - files
98+
99+
## 2023-03-18 00:00:27
100+
### Changes
101+
Based on:
102+
- OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml
103+
- Speakeasy CLI 1.12.3 https://github.com/speakeasy-api/speakeasy
104+
### Releases
105+
- [PyPI v0.5.2] https://pypi.org/project/codat-files/0.5.2 - files
106+
107+
## 2023-03-21 00:00:30
108+
### Changes
109+
Based on:
110+
- OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml
111+
- Speakeasy CLI 1.12.4 https://github.com/speakeasy-api/speakeasy
112+
### Releases
113+
- [PyPI v0.5.3] https://pypi.org/project/codat-files/0.5.3 - files
114+
115+
## 2023-03-22 00:00:39
116+
### Changes
117+
Based on:
118+
- OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml
119+
- Speakeasy CLI 1.13.0 https://github.com/speakeasy-api/speakeasy
120+
### Releases
121+
- [PyPI v0.6.0] https://pypi.org/project/codat-files/0.6.0 - files
122+
123+
## 2023-03-23 00:00:23
124+
### Changes
125+
Based on:
126+
- OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml
127+
- Speakeasy CLI 1.15.0 (2.13.1) https://github.com/speakeasy-api/speakeasy
128+
### Releases
129+
- [PyPI v0.6.1] https://pypi.org/project/codat-files/0.6.1 - files
130+
131+
## 2023-03-24 00:00:36
132+
### Changes
133+
Based on:
134+
- OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml
135+
- Speakeasy CLI 1.17.0 (2.15.0) https://github.com/speakeasy-api/speakeasy
136+
### Releases
137+
- [PyPI v0.7.0] https://pypi.org/project/codat-files/0.7.0 - files
138+
139+
## 2023-03-25 00:00:44
140+
### Changes
141+
Based on:
142+
- OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml
143+
- Speakeasy CLI 1.18.7 (2.16.1) https://github.com/speakeasy-api/speakeasy
144+
### Releases
145+
- [PyPI v0.8.0] https://pypi.org/project/codat-files/0.8.0 - files
146+
147+
## 2023-03-28 00:00:34
148+
### Changes
149+
Based on:
150+
- OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml
151+
- Speakeasy CLI 1.18.9 (2.16.4) https://github.com/speakeasy-api/speakeasy
152+
### Releases
153+
- [PyPI v0.8.1] https://pypi.org/project/codat-files/0.8.1 - files
154+
155+
## 2023-03-29 00:00:49
156+
### Changes
157+
Based on:
158+
- OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml
159+
- Speakeasy CLI 1.19.2 (2.16.5) https://github.com/speakeasy-api/speakeasy
160+
### Releases
161+
- [PyPI v0.8.2] https://pypi.org/project/codat-files/0.8.2 - files
162+
163+
## 2023-03-30 00:00:50
164+
### Changes
165+
Based on:
166+
- OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml
167+
- Speakeasy CLI 1.19.2 (2.16.5) https://github.com/speakeasy-api/speakeasy
168+
### Releases
169+
- [PyPI v0.8.3] https://pypi.org/project/codat-files/0.8.3 - files
170+
171+
## 2023-04-01 00:01:05
172+
### Changes
173+
Based on:
174+
- OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml
175+
- Speakeasy CLI 1.19.3 (2.16.7) https://github.com/speakeasy-api/speakeasy
176+
### Releases
177+
- [PyPI v0.8.4] https://pypi.org/project/codat-files/0.8.4 - files

files/USAGE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ s = codat.Codat(
1111

1212

1313
req = operations.DownloadFilesRequest(
14-
company_id="unde",
15-
date_="2022-08-12T20:13:28.710Z",
14+
company_id="8a210b68-6988-11ed-a1eb-0242ac120002",
15+
date_="2022-10-23T00:00:00Z",
1616
)
1717

1818
res = s.files.download_files(req)
1919

20-
if res.status_code == 200:
20+
if res.data is not None:
2121
# handle response
2222
```
2323
<!-- End SDK Example Usage -->

files/files.gen

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ src/codat/models/operations/download_files.py
1111
src/codat/models/operations/list_files.py
1212
src/codat/models/operations/upload_files.py
1313
src/codat/models/operations/__init__.py
14+
src/codat/models/shared/file.py
1415
src/codat/models/shared/security.py
1516
src/codat/models/shared/__init__.py
1617
USAGE.md

files/gen.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
configVersion: 1.0.0
22
management:
3-
docChecksum: 4bb6506e47b59a3c0e9b865f5442867a
3+
docChecksum: 0448d3fa262ad61467ee7c9557114cb4
44
docVersion: 2.1.0
5-
speakeasyVersion: 1.12.1
5+
speakeasyVersion: 1.19.3
6+
generationVersion: 2.16.7
67
generation:
78
telemetryEnabled: false
89
sdkClassName: codat
910
sdkFlattening: true
11+
singleTagPerOp: false
1012
python:
11-
version: 0.5.1
13+
version: 0.8.4
1214
author: Speakeasy
1315
description: Python Client SDK Generated by Speakeasy
1416
packageName: codat-files

files/pylintrc

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,7 @@ attr-naming-style=snake_case
124124
#attr-rgx=
125125

126126
# Bad variable names which should always be refused, separated by a comma.
127-
bad-names=foo,
128-
bar,
129-
baz,
130-
toto,
131-
tutu,
132-
tata
127+
bad-names=
133128

134129
# Bad variable names regexes, separated by a comma. If names match any regex,
135130
# they will always be refused
@@ -437,7 +432,11 @@ disable=raw-checker-failed,
437432
duplicate-code,
438433
trailing-newlines,
439434
too-many-public-methods,
440-
too-many-locals
435+
too-many-locals,
436+
too-many-lines,
437+
using-constant-test,
438+
too-many-statements,
439+
cyclic-import,
441440

442441
# Enable the message, report, category or checker with the given id(s). You can
443442
# either give multiple identifier separated by comma (,) or put this option

files/setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""
2+
13
import setuptools
24

35
try:
@@ -8,7 +10,7 @@
810

911
setuptools.setup(
1012
name="codat-files",
11-
version="0.5.1",
13+
version="0.8.4",
1214
author="Speakeasy",
1315
description="Python Client SDK Generated by Speakeasy",
1416
long_description=long_description,

files/src/codat/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""
2+
13
from .sdk import *

files/src/codat/files.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""
2+
13
import requests as requests_http
24
from . import utils
3-
from codat.models import operations
5+
from codat.models import operations, shared
46
from typing import Optional
57

68
class Files:
9+
r"""Endpoints to manage uploaded files."""
710
_client: requests_http.Session
811
_security_client: requests_http.Session
912
_server_url: str
@@ -23,7 +26,6 @@ def download_files(self, request: operations.DownloadFilesRequest) -> operations
2326
r"""Download all files for a company
2427
You can specify a date to download specific files for.
2528
"""
26-
2729
base_url = self._server_url
2830

2931
url = utils.generate_url(operations.DownloadFilesRequest, base_url, '/companies/{companyId}/files/download', request)
@@ -38,15 +40,15 @@ def download_files(self, request: operations.DownloadFilesRequest) -> operations
3840
res = operations.DownloadFilesResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res)
3941

4042
if http_res.status_code == 200:
41-
pass
43+
if utils.match_content_type(content_type, 'application/octet-stream'):
44+
res.data = http_res.content
4245

4346
return res
4447

4548
def list_files(self, request: operations.ListFilesRequest) -> operations.ListFilesResponse:
4649
r"""List all files uploaded by a company
4750
Returns an array of files that have been uploaded for a given company.
4851
"""
49-
5052
base_url = self._server_url
5153

5254
url = utils.generate_url(operations.ListFilesRequest, base_url, '/companies/{companyId}/files', request)
@@ -61,7 +63,7 @@ def list_files(self, request: operations.ListFilesRequest) -> operations.ListFil
6163

6264
if http_res.status_code == 200:
6365
if utils.match_content_type(content_type, 'application/json'):
64-
out = utils.unmarshal_json(http_res.text, Optional[list[operations.ListFilesFile]])
66+
out = utils.unmarshal_json(http_res.text, Optional[list[shared.File]])
6567
res.files = out
6668

6769
return res
@@ -70,21 +72,22 @@ def upload_files(self, request: operations.UploadFilesRequest) -> operations.Upl
7072
r"""Upload files for a company
7173
Upload files
7274
"""
73-
7475
base_url = self._server_url
7576

7677
url = utils.generate_url(operations.UploadFilesRequest, base_url, '/companies/{companyId}/connections/{connectionId}/files', request)
7778

79+
headers = {}
80+
req_content_type, data, form = utils.serialize_request_body(request, "request_body", 'multipart')
81+
if req_content_type not in ('multipart/form-data', 'multipart/mixed'):
82+
headers['content-type'] = req_content_type
7883

7984
client = self._security_client
8085

81-
http_res = client.request('POST', url)
86+
http_res = client.request('POST', url, data=data, files=form, headers=headers)
8287
content_type = http_res.headers.get('Content-Type')
8388

8489
res = operations.UploadFilesResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res)
8590

86-
if http_res.status_code == 200:
87-
pass
8891

8992
return res
9093

files/src/codat/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""
2+

0 commit comments

Comments
 (0)