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
442
generated/sync/docs/TextTemplateApi.md
Normal file
442
generated/sync/docs/TextTemplateApi.md
Normal file
|
|
@ -0,0 +1,442 @@
|
|||
# easybill_generated_sync.TextTemplateApi
|
||||
|
||||
All URIs are relative to *https://api.easybill.de/rest/v1*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**text_templates_get**](TextTemplateApi.md#text_templates_get) | **GET** /text-templates | Fetch text templates list
|
||||
[**text_templates_id_delete**](TextTemplateApi.md#text_templates_id_delete) | **DELETE** /text-templates/{id} | Delete text template
|
||||
[**text_templates_id_get**](TextTemplateApi.md#text_templates_id_get) | **GET** /text-templates/{id} | Fetch text template
|
||||
[**text_templates_id_put**](TextTemplateApi.md#text_templates_id_put) | **PUT** /text-templates/{id} | Update text template
|
||||
[**text_templates_post**](TextTemplateApi.md#text_templates_post) | **POST** /text-templates | Create text template
|
||||
|
||||
|
||||
# **text_templates_get**
|
||||
> TextTemplates text_templates_get(limit=limit, page=page)
|
||||
|
||||
Fetch text templates list
|
||||
|
||||
### Example
|
||||
|
||||
* Basic Authentication (basicAuth):
|
||||
* Api Key Authentication (Bearer):
|
||||
|
||||
```python
|
||||
import easybill_generated_sync
|
||||
from easybill_generated_sync.models.text_templates import TextTemplates
|
||||
from easybill_generated_sync.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_sync.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_sync.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_sync.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = easybill_generated_sync.TextTemplateApi(api_client)
|
||||
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:
|
||||
# Fetch text templates list
|
||||
api_response = await api_instance.text_templates_get(limit=limit, page=page)
|
||||
print("The response of TextTemplateApi->text_templates_get:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling TextTemplateApi->text_templates_get: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**limit** | **int**| Limited the result. Default is 100. Maximum can be 1000. | [optional]
|
||||
**page** | **int**| Set current Page. Default is 1. | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**TextTemplates**](TextTemplates.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)
|
||||
|
||||
# **text_templates_id_delete**
|
||||
> text_templates_id_delete(id)
|
||||
|
||||
Delete text template
|
||||
|
||||
### Example
|
||||
|
||||
* Basic Authentication (basicAuth):
|
||||
* Api Key Authentication (Bearer):
|
||||
|
||||
```python
|
||||
import easybill_generated_sync
|
||||
from easybill_generated_sync.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_sync.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_sync.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_sync.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = easybill_generated_sync.TextTemplateApi(api_client)
|
||||
id = 56 # int | ID of text template
|
||||
|
||||
try:
|
||||
# Delete text template
|
||||
await api_instance.text_templates_id_delete(id)
|
||||
except Exception as e:
|
||||
print("Exception when calling TextTemplateApi->text_templates_id_delete: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**id** | **int**| ID of text template |
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
**204** | Successful operation | - |
|
||||
**404** | Not found | - |
|
||||
**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)
|
||||
|
||||
# **text_templates_id_get**
|
||||
> TextTemplate text_templates_id_get(id)
|
||||
|
||||
Fetch text template
|
||||
|
||||
### Example
|
||||
|
||||
* Basic Authentication (basicAuth):
|
||||
* Api Key Authentication (Bearer):
|
||||
|
||||
```python
|
||||
import easybill_generated_sync
|
||||
from easybill_generated_sync.models.text_template import TextTemplate
|
||||
from easybill_generated_sync.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_sync.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_sync.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_sync.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = easybill_generated_sync.TextTemplateApi(api_client)
|
||||
id = 56 # int | ID of text template
|
||||
|
||||
try:
|
||||
# Fetch text template
|
||||
api_response = await api_instance.text_templates_id_get(id)
|
||||
print("The response of TextTemplateApi->text_templates_id_get:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling TextTemplateApi->text_templates_id_get: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**id** | **int**| ID of text template |
|
||||
|
||||
### Return type
|
||||
|
||||
[**TextTemplate**](TextTemplate.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** | Not found | - |
|
||||
**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)
|
||||
|
||||
# **text_templates_id_put**
|
||||
> TextTemplate text_templates_id_put(id, body)
|
||||
|
||||
Update text template
|
||||
|
||||
### Example
|
||||
|
||||
* Basic Authentication (basicAuth):
|
||||
* Api Key Authentication (Bearer):
|
||||
|
||||
```python
|
||||
import easybill_generated_sync
|
||||
from easybill_generated_sync.models.text_template import TextTemplate
|
||||
from easybill_generated_sync.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_sync.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_sync.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_sync.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = easybill_generated_sync.TextTemplateApi(api_client)
|
||||
id = 56 # int | ID of text template
|
||||
body = easybill_generated_sync.TextTemplate() # TextTemplate |
|
||||
|
||||
try:
|
||||
# Update text template
|
||||
api_response = await api_instance.text_templates_id_put(id, body)
|
||||
print("The response of TextTemplateApi->text_templates_id_put:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling TextTemplateApi->text_templates_id_put: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**id** | **int**| ID of text template |
|
||||
**body** | [**TextTemplate**](TextTemplate.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
[**TextTemplate**](TextTemplate.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
**200** | Successful operation | - |
|
||||
**400** | Invalid text template | - |
|
||||
**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)
|
||||
|
||||
# **text_templates_post**
|
||||
> TextTemplate text_templates_post(body)
|
||||
|
||||
Create text template
|
||||
|
||||
### Example
|
||||
|
||||
* Basic Authentication (basicAuth):
|
||||
* Api Key Authentication (Bearer):
|
||||
|
||||
```python
|
||||
import easybill_generated_sync
|
||||
from easybill_generated_sync.models.text_template import TextTemplate
|
||||
from easybill_generated_sync.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_sync.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_sync.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_sync.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = easybill_generated_sync.TextTemplateApi(api_client)
|
||||
body = easybill_generated_sync.TextTemplate() # TextTemplate |
|
||||
|
||||
try:
|
||||
# Create text template
|
||||
api_response = await api_instance.text_templates_post(body)
|
||||
print("The response of TextTemplateApi->text_templates_post:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling TextTemplateApi->text_templates_post: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**TextTemplate**](TextTemplate.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
[**TextTemplate**](TextTemplate.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[basicAuth](../README.md#basicAuth), [Bearer](../README.md#Bearer)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
**201** | 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)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue