Skip to content

Commit

Permalink
Merge pull request #555 from codatio/speakeasy-sdk-regen-1703085282
Browse files Browse the repository at this point in the history
chore: 🐝 Update SDK - Generate Platform library
  • Loading branch information
dcoplowe authored Dec 20, 2023
2 parents 46923dd + 9439e66 commit 0f71e6f
Show file tree
Hide file tree
Showing 346 changed files with 3,613 additions and 1,235 deletions.
Empty file modified platform/.gitattributes
100755 β†’ 100644
Empty file.
270 changes: 244 additions & 26 deletions platform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,54 @@
Manage the building blocks of Codat, including companies, connections, and more.
<!-- End Codat Library Description -->

<!-- Start SDK Installation -->
<!-- Start SDK Installation [installation] -->
## SDK Installation

```bash
pip install codat-platform
```
<!-- End SDK Installation -->
<!-- End SDK Installation [installation] -->

## Example Usage
<!-- Start SDK Example Usage -->
<!-- Start SDK Example Usage [usage] -->
## SDK Example Usage

### Example

```python
import codatplatform
from codatplatform.models import shared

s = codatplatform.CodatPlatform(
security=shared.Security(
auth_header="",
auth_header="<YOUR_API_KEY_HERE>",
),
)

req = shared.CompanyRequestBody(
description='Requested early access to the new financing scheme.',
name='Bank of Dave',
req = shared.CreateAPIKey(
name='azure-invoice-finance-processor',
)

res = s.companies.create(req)
res = s.settings.create_api_key(req)

if res.company is not None:
if res.api_key_details is not None:
# handle response
pass
```
<!-- End SDK Example Usage -->
<!-- End SDK Example Usage [usage] -->

<!-- Start SDK Available Operations -->
<!-- Start Available Resources and Operations [operations] -->
## Available Resources and Operations

### [settings](docs/sdks/settings/README.md)

* [create_api_key](docs/sdks/settings/README.md#create_api_key) - Create API key
* [delete_api_key](docs/sdks/settings/README.md#delete_api_key) - Delete API key
* [get_profile](docs/sdks/settings/README.md#get_profile) - Get profile
* [get_sync_settings](docs/sdks/settings/README.md#get_sync_settings) - Get sync settings
* [list_api_keys](docs/sdks/settings/README.md#list_api_keys) - List API keys
* [update_profile](docs/sdks/settings/README.md#update_profile) - Update profile
* [update_sync_settings](docs/sdks/settings/README.md#update_sync_settings) - Update all sync settings

### [companies](docs/sdks/companies/README.md)

Expand All @@ -58,11 +70,12 @@ if res.company is not None:
* [unlink](docs/sdks/connections/README.md#unlink) - Unlink connection
* [update_authorization](docs/sdks/connections/README.md#update_authorization) - Update authorization

### [integrations](docs/sdks/integrations/README.md)
### [custom_data_type](docs/sdks/customdatatype/README.md)

* [get](docs/sdks/integrations/README.md#get) - Get integration
* [get_branding](docs/sdks/integrations/README.md#get_branding) - Get branding
* [list](docs/sdks/integrations/README.md#list) - List integrations
* [configure](docs/sdks/customdatatype/README.md#configure) - Configure custom data type
* [get_configuration](docs/sdks/customdatatype/README.md#get_configuration) - Get custom data configuration
* [list](docs/sdks/customdatatype/README.md#list) - List custom data type records
* [refresh](docs/sdks/customdatatype/README.md#refresh) - Refresh custom data type

### [push_data](docs/sdks/pushdata/README.md)

Expand All @@ -78,15 +91,18 @@ if res.company is not None:
* [get_pull_operation](docs/sdks/refreshdata/README.md#get_pull_operation) - Get pull operation
* [list_pull_operations](docs/sdks/refreshdata/README.md#list_pull_operations) - List pull operations

### [settings](docs/sdks/settings/README.md)
### [groups](docs/sdks/groups/README.md)

* [create_api_key](docs/sdks/settings/README.md#create_api_key) - Create API key
* [delete_api_key](docs/sdks/settings/README.md#delete_api_key) - Delete API key
* [~~get_profile~~](docs/sdks/settings/README.md#get_profile) - Get profile :warning: **Deprecated**
* [get_sync_settings](docs/sdks/settings/README.md#get_sync_settings) - Get sync settings
* [list_api_keys](docs/sdks/settings/README.md#list_api_keys) - List API keys
* [update_profile](docs/sdks/settings/README.md#update_profile) - Update profile
* [update_sync_settings](docs/sdks/settings/README.md#update_sync_settings) - Update all sync settings
* [add_company](docs/sdks/groups/README.md#add_company) - Add company
* [create](docs/sdks/groups/README.md#create) - Create group
* [list](docs/sdks/groups/README.md#list) - List groups
* [remove_company](docs/sdks/groups/README.md#remove_company) - Remove company

### [integrations](docs/sdks/integrations/README.md)

* [get](docs/sdks/integrations/README.md#get) - Get integration
* [get_branding](docs/sdks/integrations/README.md#get_branding) - Get branding
* [list](docs/sdks/integrations/README.md#list) - List integrations

### [supplemental_data](docs/sdks/supplementaldata/README.md)

Expand All @@ -98,15 +114,217 @@ if res.company is not None:
* [create](docs/sdks/webhooks/README.md#create) - Create webhook
* [get](docs/sdks/webhooks/README.md#get) - Get webhook
* [list](docs/sdks/webhooks/README.md#list) - List webhooks
<!-- End SDK Available Operations -->
<!-- End Available Resources and Operations [operations] -->



<!-- Start Retries [retries] -->
## Retries

Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.

To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
```python
import codatplatform
from codatplatform.models import shared
from codatplatform.utils import BackoffStrategy, RetryConfig

s = codatplatform.CodatPlatform(
security=shared.Security(
auth_header="<YOUR_API_KEY_HERE>",
),
)

req = shared.CreateAPIKey(
name='azure-invoice-finance-processor',
)

res = s.settings.create_api_key(req,
RetryConfig('backoff', BackoffStrategy(1, 50, 1.1, 100), False))

if res.api_key_details is not None:
# handle response
pass
```

If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
```python
import codatplatform
from codatplatform.models import shared
from codatplatform.utils import BackoffStrategy, RetryConfig

s = codatplatform.CodatPlatform(
retry_config=RetryConfig('backoff', BackoffStrategy(1, 50, 1.1, 100), False)
security=shared.Security(
auth_header="<YOUR_API_KEY_HERE>",
),
)

req = shared.CreateAPIKey(
name='azure-invoice-finance-processor',
)

res = s.settings.create_api_key(req)

if res.api_key_details is not None:
# handle response
pass
```
<!-- End Retries [retries] -->

<!-- Start Error Handling [errors] -->
## Error Handling

Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type.

| Error Object | Status Code | Content Type |
| ------------------------------- | ------------------------------- | ------------------------------- |
| errors.ErrorMessage | 400,401,402,403,409,429,500,503 | application/json |
| errors.SDKError | 4x-5xx | */* |

### Example

```python
import codatplatform
from codatplatform.models import shared

s = codatplatform.CodatPlatform(
security=shared.Security(
auth_header="<YOUR_API_KEY_HERE>",
),
)

req = shared.CreateAPIKey(
name='azure-invoice-finance-processor',
)

res = None
try:
res = s.settings.create_api_key(req)
except errors.ErrorMessage as e:
print(e) # handle exception
raise(e)
except errors.SDKError as e:
print(e) # handle exception
raise(e)

if res.api_key_details is not None:
# handle response
pass
```
<!-- End Error Handling [errors] -->

<!-- Start Server Selection [server] -->
## Server Selection

### Select Server by Index

You can override the default server globally by passing a server index to the `server_idx: int` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:

| # | Server | Variables |
| - | ------ | --------- |
| 0 | `https://api.codat.io` | None |

#### Example

```python
import codatplatform
from codatplatform.models import shared

s = codatplatform.CodatPlatform(
server_idx=0,
security=shared.Security(
auth_header="<YOUR_API_KEY_HERE>",
),
)

req = shared.CreateAPIKey(
name='azure-invoice-finance-processor',
)

res = s.settings.create_api_key(req)

if res.api_key_details is not None:
# handle response
pass
```

<!-- Start Dev Containers -->

### Override Server URL Per-Client

The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:
```python
import codatplatform
from codatplatform.models import shared

<!-- End Dev Containers -->
s = codatplatform.CodatPlatform(
server_url="https://api.codat.io",
security=shared.Security(
auth_header="<YOUR_API_KEY_HERE>",
),
)

req = shared.CreateAPIKey(
name='azure-invoice-finance-processor',
)

res = s.settings.create_api_key(req)

if res.api_key_details is not None:
# handle response
pass
```
<!-- End Server Selection [server] -->

<!-- Start Custom HTTP Client [http-client] -->
## Custom HTTP Client

The Python SDK makes API calls using the (requests)[https://pypi.org/project/requests/] HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom `requests.Session` object.

For example, you could specify a header for every request that this sdk makes as follows:
```python
import codatplatform
import requests

http_client = requests.Session()
http_client.headers.update({'x-custom-header': 'someValue'})
s = codatplatform.CodatPlatform(client: http_client)
```
<!-- End Custom HTTP Client [http-client] -->

<!-- Start Authentication [security] -->
## Authentication

### Per-Client Security Schemes

This SDK supports the following security scheme globally:

| Name | Type | Scheme |
| ------------- | ------------- | ------------- |
| `auth_header` | apiKey | API key |

You can set the security parameters through the `security` optional parameter when initializing the SDK client instance. For example:
```python
import codatplatform
from codatplatform.models import shared

s = codatplatform.CodatPlatform(
security=shared.Security(
auth_header="<YOUR_API_KEY_HERE>",
),
)

req = shared.CreateAPIKey(
name='azure-invoice-finance-processor',
)

res = s.settings.create_api_key(req)

if res.api_key_details is not None:
# handle response
pass
```
<!-- End Authentication [security] -->

<!-- Placeholder for Future Speakeasy SDK Sections -->

Expand Down
12 changes: 11 additions & 1 deletion platform/RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,14 @@ Based on:
### Generated
- [python v2.0.0] platform
### Releases
- [PyPI v2.0.0] https://pypi.org/project/codat-platform/2.0.0 - platform
- [PyPI v2.0.0] https://pypi.org/project/codat-platform/2.0.0 - platform

## 2023-12-20 15:14:38
### Changes
Based on:
- OpenAPI Doc 3.0.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Platform.yaml
- Speakeasy CLI 1.128.0 (2.221.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v3.0.0] platform
### Releases
- [PyPI v3.0.0] https://pypi.org/project/codat-platform/3.0.0 - platform
17 changes: 7 additions & 10 deletions platform/USAGE.md
100755 β†’ 100644
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
<!-- Start SDK Example Usage -->


<!-- Start SDK Example Usage [usage] -->
```python
import codatplatform
from codatplatform.models import shared

s = codatplatform.CodatPlatform(
security=shared.Security(
auth_header="",
auth_header="<YOUR_API_KEY_HERE>",
),
)

req = shared.CompanyRequestBody(
description='Requested early access to the new financing scheme.',
name='Bank of Dave',
req = shared.CreateAPIKey(
name='azure-invoice-finance-processor',
)

res = s.companies.create(req)
res = s.settings.create_api_key(req)

if res.company is not None:
if res.api_key_details is not None:
# handle response
pass
```
<!-- End SDK Example Usage -->
<!-- End SDK Example Usage [usage] -->
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ErrorMessage

Bad Request


## Fields

Expand Down
Loading

0 comments on commit 0f71e6f

Please sign in to comment.