Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions files/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ pip install codat-files
## SDK Example Usage
<!-- Start SDK Example Usage -->
```python
import codat
from codat.models import operations, shared
import codatfiles
from codatfiles.models import operations, shared

s = codat.Codat(
s = codatfiles.CodatFiles(
security=shared.Security(
auth_header="YOUR_API_KEY_HERE",
),
Expand Down
34 changes: 33 additions & 1 deletion files/RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,36 @@ Based on:
- OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml
- Speakeasy CLI 1.19.3 (2.16.7) https://github.com/speakeasy-api/speakeasy
### Releases
- [PyPI v0.8.4] https://pypi.org/project/codat-files/0.8.4 - files
- [PyPI v0.8.4] https://pypi.org/project/codat-files/0.8.4 - files

## 2023-04-06 00:01:11
### Changes
Based on:
- OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml
- Speakeasy CLI 1.19.6 (2.17.8) https://github.com/speakeasy-api/speakeasy
### Releases
- [PyPI v0.9.0] https://pypi.org/project/codat-files/0.9.0 - files

## 2023-04-12 00:00:58
### Changes
Based on:
- OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml
- Speakeasy CLI 1.19.7 (2.17.9) https://github.com/speakeasy-api/speakeasy
### Releases
- [PyPI v0.9.1] https://pypi.org/project/codat-files/0.9.1 - files

## 2023-04-14 00:00:57
### Changes
Based on:
- OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml
- Speakeasy CLI 1.20.0 (2.18.0) https://github.com/speakeasy-api/speakeasy
### Releases
- [PyPI v0.10.0] https://pypi.org/project/codat-files/0.10.0 - files

## 2023-04-18 00:00:51
### Changes
Based on:
- OpenAPI Doc 2.1.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Files.yaml
- Speakeasy CLI 1.20.1 (2.18.1) https://github.com/speakeasy-api/speakeasy
### Releases
- [PyPI v0.10.1] https://pypi.org/project/codat-files/0.10.1 - files
6 changes: 3 additions & 3 deletions files/USAGE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!-- Start SDK Example Usage -->
```python
import codat
from codat.models import operations, shared
import codatfiles
from codatfiles.models import operations, shared

s = codat.Codat(
s = codatfiles.CodatFiles(
security=shared.Security(
auth_header="YOUR_API_KEY_HERE",
),
Expand Down
28 changes: 14 additions & 14 deletions files/files.gen
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
src/codat/files.py
src/codat/sdk.py
src/codatfiles/files.py
src/codatfiles/sdk.py
pylintrc
setup.py
src/codat/__init__.py
src/codat/models/__init__.py
src/codat/utils/__init__.py
src/codat/utils/retries.py
src/codat/utils/utils.py
src/codat/models/operations/download_files.py
src/codat/models/operations/list_files.py
src/codat/models/operations/upload_files.py
src/codat/models/operations/__init__.py
src/codat/models/shared/file.py
src/codat/models/shared/security.py
src/codat/models/shared/__init__.py
src/codatfiles/__init__.py
src/codatfiles/models/__init__.py
src/codatfiles/utils/__init__.py
src/codatfiles/utils/retries.py
src/codatfiles/utils/utils.py
src/codatfiles/models/operations/download_files.py
src/codatfiles/models/operations/list_files.py
src/codatfiles/models/operations/upload_files.py
src/codatfiles/models/operations/__init__.py
src/codatfiles/models/shared/file.py
src/codatfiles/models/shared/security.py
src/codatfiles/models/shared/__init__.py
USAGE.md
9 changes: 4 additions & 5 deletions files/gen.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
configVersion: 1.0.0
management:
docChecksum: 0448d3fa262ad61467ee7c9557114cb4
docChecksum: 3cf265fb28f03ccb976cee9c56372470
docVersion: 2.1.0
speakeasyVersion: 1.19.3
generationVersion: 2.16.7
speakeasyVersion: 1.20.1
generationVersion: 2.18.1
generation:
telemetryEnabled: false
sdkClassName: CodatFiles
sdkFlattening: true
singleTagPerOp: false
python:
version: 0.8.4
version: 0.10.1
author: Speakeasy
description: Python Client SDK Generated by Speakeasy
packageName: codat-files
1 change: 1 addition & 0 deletions files/pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ disable=raw-checker-failed,
using-constant-test,
too-many-statements,
cyclic-import,
too-many-nested-blocks

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
2 changes: 1 addition & 1 deletion files/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setuptools.setup(
name="codat-files",
version="0.8.4",
version="0.10.1",
author="Speakeasy",
description="Python Client SDK Generated by Speakeasy",
long_description=long_description,
Expand Down
File renamed without changes.
53 changes: 46 additions & 7 deletions files/src/codat/files.py → files/src/codatfiles/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import requests as requests_http
from . import utils
from codat.models import operations, shared
from codatfiles.models import operations, shared
from typing import Optional

class Files:
Expand All @@ -22,7 +22,7 @@ def __init__(self, client: requests_http.Session, security_client: requests_http
self._sdk_version = sdk_version
self._gen_version = gen_version

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

client = self._security_client

http_res = client.request('GET', url, params=query_params)
retry_config = retries
if retry_config is None:
retry_config = utils.RetryConfig('backoff', True)
retry_config.backoff = utils.BackoffStrategy(500, 60000, 1.5, 3600000)


def do_request():
return client.request('GET', url, params=query_params)

http_res = utils.retry(do_request, utils.Retries(retry_config, [
'408',
'429',
'5XX'
]))
content_type = http_res.headers.get('Content-Type')

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

return res

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

client = self._security_client

http_res = client.request('GET', url)
retry_config = retries
if retry_config is None:
retry_config = utils.RetryConfig('backoff', True)
retry_config.backoff = utils.BackoffStrategy(500, 60000, 1.5, 3600000)


def do_request():
return client.request('GET', url)

http_res = utils.retry(do_request, utils.Retries(retry_config, [
'408',
'429',
'5XX'
]))
content_type = http_res.headers.get('Content-Type')

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

return res

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

client = self._security_client

http_res = client.request('POST', url, data=data, files=form, headers=headers)
retry_config = retries
if retry_config is None:
retry_config = utils.RetryConfig('backoff', True)
retry_config.backoff = utils.BackoffStrategy(500, 60000, 1.5, 3600000)


def do_request():
return client.request('POST', url, data=data, files=form, headers=headers)

http_res = utils.retry(do_request, utils.Retries(retry_config, [
'408',
'429',
'5XX'
]))
content_type = http_res.headers.get('Content-Type')

res = operations.UploadFilesResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations
import dataclasses
from codat import utils
from codatfiles import utils
from dataclasses_json import Undefined, dataclass_json
from typing import Optional

Expand Down
8 changes: 4 additions & 4 deletions files/src/codat/sdk.py → files/src/codatfiles/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
import requests as requests_http
from . import utils
from .files import Files
from codat.models import shared
from codatfiles.models import shared

SERVERS = [
"https://api.codat.io",
r"""Production"""
]
"""Contains the list of servers available to the SDK"""

class Codat:
class CodatFiles:
r"""An API for uploading and downloading files from 'File Upload' Integrations.

The Accounting file upload, Banking file upload, and Business documents file upload integrations provide simple file upload functionality.
Expand All @@ -27,8 +27,8 @@ class Codat:
_security_client: requests_http.Session
_server_url: str = SERVERS[0]
_language: str = "python"
_sdk_version: str = "0.8.4"
_gen_version: str = "2.16.7"
_sdk_version: str = "0.10.1"
_gen_version: str = "2.18.1"

def __init__(self,
security: shared.Security = None,
Expand Down
File renamed without changes.
Loading