Skip to content

Commit f176e03

Browse files
authored
Merge pull request #74 from codatio/speakeasy-sdk-regen-1680739274
chore: speakeasy sdk regeneration - Generate Files SDK
2 parents d6b9008 + 4500d5f commit f176e03

File tree

21 files changed

+180
-96
lines changed

21 files changed

+180
-96
lines changed

files/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ pip install codat-files
1313
## SDK Example Usage
1414
<!-- Start SDK Example Usage -->
1515
```python
16-
import codat
17-
from codat.models import operations, shared
16+
import codatfiles
17+
from codatfiles.models import operations, shared
1818

19-
s = codat.Codat(
19+
s = codatfiles.CodatFiles(
2020
security=shared.Security(
2121
auth_header="YOUR_API_KEY_HERE",
2222
),

files/RELEASES.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,4 +174,36 @@ Based on:
174174
- OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml
175175
- Speakeasy CLI 1.19.3 (2.16.7) https://github.com/speakeasy-api/speakeasy
176176
### Releases
177-
- [PyPI v0.8.4] https://pypi.org/project/codat-files/0.8.4 - files
177+
- [PyPI v0.8.4] https://pypi.org/project/codat-files/0.8.4 - files
178+
179+
## 2023-04-06 00:01:11
180+
### Changes
181+
Based on:
182+
- OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml
183+
- Speakeasy CLI 1.19.6 (2.17.8) https://github.com/speakeasy-api/speakeasy
184+
### Releases
185+
- [PyPI v0.9.0] https://pypi.org/project/codat-files/0.9.0 - files
186+
187+
## 2023-04-12 00:00:58
188+
### Changes
189+
Based on:
190+
- OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml
191+
- Speakeasy CLI 1.19.7 (2.17.9) https://github.com/speakeasy-api/speakeasy
192+
### Releases
193+
- [PyPI v0.9.1] https://pypi.org/project/codat-files/0.9.1 - files
194+
195+
## 2023-04-14 00:00:57
196+
### Changes
197+
Based on:
198+
- OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml
199+
- Speakeasy CLI 1.20.0 (2.18.0) https://github.com/speakeasy-api/speakeasy
200+
### Releases
201+
- [PyPI v0.10.0] https://pypi.org/project/codat-files/0.10.0 - files
202+
203+
## 2023-04-18 00:00:51
204+
### Changes
205+
Based on:
206+
- OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml
207+
- Speakeasy CLI 1.20.1 (2.18.1) https://github.com/speakeasy-api/speakeasy
208+
### Releases
209+
- [PyPI v0.10.1] https://pypi.org/project/codat-files/0.10.1 - files

files/USAGE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<!-- Start SDK Example Usage -->
22
```python
3-
import codat
4-
from codat.models import operations, shared
3+
import codatfiles
4+
from codatfiles.models import operations, shared
55

6-
s = codat.Codat(
6+
s = codatfiles.CodatFiles(
77
security=shared.Security(
88
auth_header="YOUR_API_KEY_HERE",
99
),

files/files.gen

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
src/codat/files.py
2-
src/codat/sdk.py
1+
src/codatfiles/files.py
2+
src/codatfiles/sdk.py
33
pylintrc
44
setup.py
5-
src/codat/__init__.py
6-
src/codat/models/__init__.py
7-
src/codat/utils/__init__.py
8-
src/codat/utils/retries.py
9-
src/codat/utils/utils.py
10-
src/codat/models/operations/download_files.py
11-
src/codat/models/operations/list_files.py
12-
src/codat/models/operations/upload_files.py
13-
src/codat/models/operations/__init__.py
14-
src/codat/models/shared/file.py
15-
src/codat/models/shared/security.py
16-
src/codat/models/shared/__init__.py
5+
src/codatfiles/__init__.py
6+
src/codatfiles/models/__init__.py
7+
src/codatfiles/utils/__init__.py
8+
src/codatfiles/utils/retries.py
9+
src/codatfiles/utils/utils.py
10+
src/codatfiles/models/operations/download_files.py
11+
src/codatfiles/models/operations/list_files.py
12+
src/codatfiles/models/operations/upload_files.py
13+
src/codatfiles/models/operations/__init__.py
14+
src/codatfiles/models/shared/file.py
15+
src/codatfiles/models/shared/security.py
16+
src/codatfiles/models/shared/__init__.py
1717
USAGE.md

files/gen.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
configVersion: 1.0.0
22
management:
3-
docChecksum: 0448d3fa262ad61467ee7c9557114cb4
3+
docChecksum: 3cf265fb28f03ccb976cee9c56372470
44
docVersion: 2.1.0
5-
speakeasyVersion: 1.19.3
6-
generationVersion: 2.16.7
5+
speakeasyVersion: 1.20.1
6+
generationVersion: 2.18.1
77
generation:
88
telemetryEnabled: false
99
sdkClassName: CodatFiles
10-
sdkFlattening: true
1110
singleTagPerOp: false
1211
python:
13-
version: 0.8.4
12+
version: 0.10.1
1413
author: Speakeasy
1514
description: Python Client SDK Generated by Speakeasy
1615
packageName: codat-files

files/pylintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ disable=raw-checker-failed,
437437
using-constant-test,
438438
too-many-statements,
439439
cyclic-import,
440+
too-many-nested-blocks
440441

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

files/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
setuptools.setup(
1212
name="codat-files",
13-
version="0.8.4",
13+
version="0.10.1",
1414
author="Speakeasy",
1515
description="Python Client SDK Generated by Speakeasy",
1616
long_description=long_description,
Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import requests as requests_http
44
from . import utils
5-
from codat.models import operations, shared
5+
from codatfiles.models import operations, shared
66
from typing import Optional
77

88
class Files:
@@ -22,7 +22,7 @@ def __init__(self, client: requests_http.Session, security_client: requests_http
2222
self._sdk_version = sdk_version
2323
self._gen_version = gen_version
2424

25-
def download_files(self, request: operations.DownloadFilesRequest) -> operations.DownloadFilesResponse:
25+
def download_files(self, request: operations.DownloadFilesRequest, retries: Optional[utils.RetryConfig] = None) -> operations.DownloadFilesResponse:
2626
r"""Download all files for a company
2727
You can specify a date to download specific files for.
2828
"""
@@ -34,7 +34,20 @@ def download_files(self, request: operations.DownloadFilesRequest) -> operations
3434

3535
client = self._security_client
3636

37-
http_res = client.request('GET', url, params=query_params)
37+
retry_config = retries
38+
if retry_config is None:
39+
retry_config = utils.RetryConfig('backoff', True)
40+
retry_config.backoff = utils.BackoffStrategy(500, 60000, 1.5, 3600000)
41+
42+
43+
def do_request():
44+
return client.request('GET', url, params=query_params)
45+
46+
http_res = utils.retry(do_request, utils.Retries(retry_config, [
47+
'408',
48+
'429',
49+
'5XX'
50+
]))
3851
content_type = http_res.headers.get('Content-Type')
3952

4053
res = operations.DownloadFilesResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res)
@@ -45,7 +58,7 @@ def download_files(self, request: operations.DownloadFilesRequest) -> operations
4558

4659
return res
4760

48-
def list_files(self, request: operations.ListFilesRequest) -> operations.ListFilesResponse:
61+
def list_files(self, request: operations.ListFilesRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListFilesResponse:
4962
r"""List all files uploaded by a company
5063
Returns an array of files that have been uploaded for a given company.
5164
"""
@@ -56,7 +69,20 @@ def list_files(self, request: operations.ListFilesRequest) -> operations.ListFil
5669

5770
client = self._security_client
5871

59-
http_res = client.request('GET', url)
72+
retry_config = retries
73+
if retry_config is None:
74+
retry_config = utils.RetryConfig('backoff', True)
75+
retry_config.backoff = utils.BackoffStrategy(500, 60000, 1.5, 3600000)
76+
77+
78+
def do_request():
79+
return client.request('GET', url)
80+
81+
http_res = utils.retry(do_request, utils.Retries(retry_config, [
82+
'408',
83+
'429',
84+
'5XX'
85+
]))
6086
content_type = http_res.headers.get('Content-Type')
6187

6288
res = operations.ListFilesResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res)
@@ -68,7 +94,7 @@ def list_files(self, request: operations.ListFilesRequest) -> operations.ListFil
6894

6995
return res
7096

71-
def upload_files(self, request: operations.UploadFilesRequest) -> operations.UploadFilesResponse:
97+
def upload_files(self, request: operations.UploadFilesRequest, retries: Optional[utils.RetryConfig] = None) -> operations.UploadFilesResponse:
7298
r"""Upload files for a company
7399
Upload files
74100
"""
@@ -83,7 +109,20 @@ def upload_files(self, request: operations.UploadFilesRequest) -> operations.Upl
83109

84110
client = self._security_client
85111

86-
http_res = client.request('POST', url, data=data, files=form, headers=headers)
112+
retry_config = retries
113+
if retry_config is None:
114+
retry_config = utils.RetryConfig('backoff', True)
115+
retry_config.backoff = utils.BackoffStrategy(500, 60000, 1.5, 3600000)
116+
117+
118+
def do_request():
119+
return client.request('POST', url, data=data, files=form, headers=headers)
120+
121+
http_res = utils.retry(do_request, utils.Retries(retry_config, [
122+
'408',
123+
'429',
124+
'5XX'
125+
]))
87126
content_type = http_res.headers.get('Content-Type')
88127

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

0 commit comments

Comments
 (0)