Add unit tests for authentication and webhook parsing
- Implement tests for basic and bearer authentication headers in `test_auth.py`. - Create tests for the `EasybillWebhookParser` in `test_webhooks.py`, covering JSON and form-encoded payloads, as well as a generic parse and acknowledgement method.
This commit is contained in:
commit
caacb339dd
550 changed files with 127217 additions and 0 deletions
277
generated/async/docs/DocumentVersionApi.md
Normal file
277
generated/async/docs/DocumentVersionApi.md
Normal file
|
|
@ -0,0 +1,277 @@
|
|||
# easybill_generated_async.DocumentVersionApi
|
||||
|
||||
All URIs are relative to *https://api.easybill.de/rest/v1*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**documents_id_versions_get**](DocumentVersionApi.md#documents_id_versions_get) | **GET** /documents/{id}/versions | List all versions of a given document
|
||||
[**documents_id_versions_version_id_get**](DocumentVersionApi.md#documents_id_versions_version_id_get) | **GET** /documents/{id}/versions/{versionId} | Show a single version of a given document
|
||||
[**documents_id_versions_version_id_items_version_item_id_download_get**](DocumentVersionApi.md#documents_id_versions_version_id_items_version_item_id_download_get) | **GET** /documents/{id}/versions/{versionId}/items/{versionItemId}/download | Download a specific file for a single version of a given document
|
||||
|
||||
|
||||
# **documents_id_versions_get**
|
||||
> DocumentVersions documents_id_versions_get(id, limit=limit, page=page)
|
||||
|
||||
List all versions of a given document
|
||||
|
||||
### Example
|
||||
|
||||
* Basic Authentication (basicAuth):
|
||||
* Api Key Authentication (Bearer):
|
||||
|
||||
```python
|
||||
import easybill_generated_async
|
||||
from easybill_generated_async.models.document_versions import DocumentVersions
|
||||
from easybill_generated_async.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Defining the host is optional and defaults to https://api.easybill.de/rest/v1
|
||||
# See configuration.py for a list of all supported configuration parameters.
|
||||
configuration = easybill_generated_async.Configuration(
|
||||
host = "https://api.easybill.de/rest/v1"
|
||||
)
|
||||
|
||||
# The client must configure the authentication and authorization parameters
|
||||
# in accordance with the API server security policy.
|
||||
# Examples for each auth method are provided below, use the example that
|
||||
# satisfies your auth use case.
|
||||
|
||||
# Configure HTTP basic authorization: basicAuth
|
||||
configuration = easybill_generated_async.Configuration(
|
||||
username = os.environ["USERNAME"],
|
||||
password = os.environ["PASSWORD"]
|
||||
)
|
||||
|
||||
# Configure API key authorization: Bearer
|
||||
configuration.api_key['Bearer'] = os.environ["API_KEY"]
|
||||
|
||||
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
# configuration.api_key_prefix['Bearer'] = 'Bearer'
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
async with easybill_generated_async.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = easybill_generated_async.DocumentVersionApi(api_client)
|
||||
id = 56 # int | ID of document
|
||||
limit = 56 # int | Limited the result. Default is 100. Maximum can be 1000. (optional)
|
||||
page = 56 # int | Set current Page. Default is 1. (optional)
|
||||
|
||||
try:
|
||||
# List all versions of a given document
|
||||
api_response = await api_instance.documents_id_versions_get(id, limit=limit, page=page)
|
||||
print("The response of DocumentVersionApi->documents_id_versions_get:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling DocumentVersionApi->documents_id_versions_get: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**id** | **int**| ID of document |
|
||||
**limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional]
|
||||
**page** | **int**| Set current Page. Default is 1. | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**DocumentVersions**](DocumentVersions.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
**200** | Successful operation | - |
|
||||
**429** | Too Many Requests | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **documents_id_versions_version_id_get**
|
||||
> DocumentVersion documents_id_versions_version_id_get(id, version_id)
|
||||
|
||||
Show a single version of a given document
|
||||
|
||||
### Example
|
||||
|
||||
* Basic Authentication (basicAuth):
|
||||
* Api Key Authentication (Bearer):
|
||||
|
||||
```python
|
||||
import easybill_generated_async
|
||||
from easybill_generated_async.models.document_version import DocumentVersion
|
||||
from easybill_generated_async.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Defining the host is optional and defaults to https://api.easybill.de/rest/v1
|
||||
# See configuration.py for a list of all supported configuration parameters.
|
||||
configuration = easybill_generated_async.Configuration(
|
||||
host = "https://api.easybill.de/rest/v1"
|
||||
)
|
||||
|
||||
# The client must configure the authentication and authorization parameters
|
||||
# in accordance with the API server security policy.
|
||||
# Examples for each auth method are provided below, use the example that
|
||||
# satisfies your auth use case.
|
||||
|
||||
# Configure HTTP basic authorization: basicAuth
|
||||
configuration = easybill_generated_async.Configuration(
|
||||
username = os.environ["USERNAME"],
|
||||
password = os.environ["PASSWORD"]
|
||||
)
|
||||
|
||||
# Configure API key authorization: Bearer
|
||||
configuration.api_key['Bearer'] = os.environ["API_KEY"]
|
||||
|
||||
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
# configuration.api_key_prefix['Bearer'] = 'Bearer'
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
async with easybill_generated_async.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = easybill_generated_async.DocumentVersionApi(api_client)
|
||||
id = 56 # int | ID of document
|
||||
version_id = 56 # int | ID of document version
|
||||
|
||||
try:
|
||||
# Show a single version of a given document
|
||||
api_response = await api_instance.documents_id_versions_version_id_get(id, version_id)
|
||||
print("The response of DocumentVersionApi->documents_id_versions_version_id_get:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling DocumentVersionApi->documents_id_versions_version_id_get: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**id** | **int**| ID of document |
|
||||
**version_id** | **int**| ID of document version |
|
||||
|
||||
### Return type
|
||||
|
||||
[**DocumentVersion**](DocumentVersion.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
**200** | Successful operation | - |
|
||||
**404** | Document Version does not exist | - |
|
||||
**429** | Too Many Requests | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **documents_id_versions_version_id_items_version_item_id_download_get**
|
||||
> bytes documents_id_versions_version_id_items_version_item_id_download_get(id, version_id, version_item_id)
|
||||
|
||||
Download a specific file for a single version of a given document
|
||||
|
||||
### Example
|
||||
|
||||
* Basic Authentication (basicAuth):
|
||||
* Api Key Authentication (Bearer):
|
||||
|
||||
```python
|
||||
import easybill_generated_async
|
||||
from easybill_generated_async.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Defining the host is optional and defaults to https://api.easybill.de/rest/v1
|
||||
# See configuration.py for a list of all supported configuration parameters.
|
||||
configuration = easybill_generated_async.Configuration(
|
||||
host = "https://api.easybill.de/rest/v1"
|
||||
)
|
||||
|
||||
# The client must configure the authentication and authorization parameters
|
||||
# in accordance with the API server security policy.
|
||||
# Examples for each auth method are provided below, use the example that
|
||||
# satisfies your auth use case.
|
||||
|
||||
# Configure HTTP basic authorization: basicAuth
|
||||
configuration = easybill_generated_async.Configuration(
|
||||
username = os.environ["USERNAME"],
|
||||
password = os.environ["PASSWORD"]
|
||||
)
|
||||
|
||||
# Configure API key authorization: Bearer
|
||||
configuration.api_key['Bearer'] = os.environ["API_KEY"]
|
||||
|
||||
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
||||
# configuration.api_key_prefix['Bearer'] = 'Bearer'
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
async with easybill_generated_async.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = easybill_generated_async.DocumentVersionApi(api_client)
|
||||
id = 56 # int | ID of document
|
||||
version_id = 56 # int | ID of document version
|
||||
version_item_id = 56 # int | ID of document version item
|
||||
|
||||
try:
|
||||
# Download a specific file for a single version of a given document
|
||||
api_response = await api_instance.documents_id_versions_version_id_items_version_item_id_download_get(id, version_id, version_item_id)
|
||||
print("The response of DocumentVersionApi->documents_id_versions_version_id_items_version_item_id_download_get:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling DocumentVersionApi->documents_id_versions_version_id_items_version_item_id_download_get: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**id** | **int**| ID of document |
|
||||
**version_id** | **int**| ID of document version |
|
||||
**version_item_id** | **int**| ID of document version item |
|
||||
|
||||
### Return type
|
||||
|
||||
**bytes**
|
||||
|
||||
### Authorization
|
||||
|
||||
[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/pdf, text/xml
|
||||
|
||||
### HTTP response details
|
||||
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
**200** | Successful operation | - |
|
||||
**404** | Document Version does not exist | - |
|
||||
**429** | Too Many Requests | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue