# eis_dunning
The EMIL DunningService API description

This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 1.0
- Package version: 1.7.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
For more information, please visit [https://www.emil.de](https://www.emil.de)

## Requirements.

Python >=3.6

## Installation & Usage
### pip install

If the python package is hosted on a repository, you can install directly using:

```sh
pip install eis.dunning
```
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)

Then import the package:
```python
import eis.dunning
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)

Then import the package:
```python
import eis.dunning
```

## Getting Started

The environment variables must be set in order to properly use this SDK.

```shell 
export EMIL_USERNAME=XXXXXXX
export EMIL_PASSWORD=XXXXXXX
```

Please follow the [installation procedure](#installation--usage) and then run the following:

```python
import time
import eis.dunning
from pprint import pprint
from eis.dunning.api import dunning_configuration_api
from eis.dunning.model.create_dunning_config_request_dto import CreateDunningConfigRequestDto
from eis.dunning.model.create_dunning_config_response_class import CreateDunningConfigResponseClass
from eis.dunning.model.get_dunning_config_response_class import GetDunningConfigResponseClass
from eis.dunning.model.list_dunning_config_response_class import ListDunningConfigResponseClass
from eis.dunning.model.update_dunning_config_request_dto import UpdateDunningConfigRequestDto
from eis.dunning.model.update_dunning_config_response_class import UpdateDunningConfigResponseClass
# Defining the host is optional and defaults to https://apiv2.emil.de
# See configuration.py for a list of all supported configuration parameters.
configuration = eis.dunning.Configuration(
    host = "https://apiv2.emil.de"
)

# 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.

# Bearer is automatically handled with exported environment variables. However, you
# can manuallay configure Bearer authorization (JWT): bearer
configuration = eis.dunning.Configuration(
    access_token = 'YOUR_BEARER_TOKEN'
)

# After manual token becomes invalid, the SDK will default to re-login automatically
# with environment variable credentials.


# Enter a context with an instance of the API client
with eis.dunning.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = dunning_configuration_api.DunningConfigurationApi(api_client)
    create_dunning_config_request_dto = CreateDunningConfigRequestDto(
        product_slug="product_slug_example",
        config=DunningConfigurationRequestDto(
            levels=[
                DunningLevelRequestDto(
                    level=1,
                    triggered_after_days=1,
                    standard_fee=0,
                    name="name_example",
                ),
            ],
            max_level=1,
            direct_debit_fee=0,
        ),
        is_active=True,
        metadata={},
        dunning_type="initial",
    ) # CreateDunningConfigRequestDto | 
    authorization = "Authorization_example" # str | Bearer Token: provided by the login endpoint under the name accessToken. (optional)

    try:
        # Create the dunning configuration
        api_response = api_instance.create_dunning_config(create_dunning_config_request_dto, authorization=authorization)
        pprint(api_response)
    except eis.dunning.ApiException as e:
        print("Exception when calling DunningConfigurationApi->create_dunning_config: %s\n" % e)
```

## Documentation for API Endpoints

All URIs are relative to *https://apiv2.emil.de*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*DunningConfigurationApi* | [**create_dunning_config**](docs/DunningConfigurationApi.md#create_dunning_config) | **POST** /dunningservice/v1/dunning-config | Create the dunning configuration
*DunningConfigurationApi* | [**delete_dunning_config**](docs/DunningConfigurationApi.md#delete_dunning_config) | **DELETE** /dunningservice/v1/dunning-config/{code} | Delete the dunning configuration
*DunningConfigurationApi* | [**get_dunning_config**](docs/DunningConfigurationApi.md#get_dunning_config) | **GET** /dunningservice/v1/dunning-config/{code} | Retrieve the dunning configuration
*DunningConfigurationApi* | [**list_dunning_configs**](docs/DunningConfigurationApi.md#list_dunning_configs) | **GET** /dunningservice/v1/dunning-config | List dunning configurations
*DunningConfigurationApi* | [**update_dunning_config**](docs/DunningConfigurationApi.md#update_dunning_config) | **PATCH** /dunningservice/v1/dunning-config/{code} | Update the dunning configuration
*DunningPositionApi* | [**calculate_dunning_position_for_invoice**](docs/DunningPositionApi.md#calculate_dunning_position_for_invoice) | **POST** /dunningservice/v1/dunning-position/calculate-for-invoice | Create the calculate dunning position
*DunningPositionApi* | [**create_dunning_position**](docs/DunningPositionApi.md#create_dunning_position) | **POST** /dunningservice/v1/dunning-position | Create the dunning position
*DunningPositionApi* | [**create_dunning_position_for_invoice**](docs/DunningPositionApi.md#create_dunning_position_for_invoice) | **POST** /dunningservice/v1/dunning-position/for-invoice | Create the dunning position
*DunningPositionApi* | [**delete_dunning_position**](docs/DunningPositionApi.md#delete_dunning_position) | **DELETE** /dunningservice/v1/dunning-position/{code} | Delete the dunning position
*DunningPositionApi* | [**get_dunning_position**](docs/DunningPositionApi.md#get_dunning_position) | **GET** /dunningservice/v1/dunning-position/{code} | Retrieve the dunning position
*DunningPositionApi* | [**list_dunning_positions**](docs/DunningPositionApi.md#list_dunning_positions) | **GET** /dunningservice/v1/dunning-position | List dunning positions
*DefaultApi* | [**check**](docs/DefaultApi.md#check) | **GET** /dunningservice/health | Health Check


## Documentation For Models

 - [CalculateDunningForInvoiceRequestDtoRest](docs/CalculateDunningForInvoiceRequestDtoRest.md)
 - [CalculateDunningForInvoiceResponseClass](docs/CalculateDunningForInvoiceResponseClass.md)
 - [CreateDunningConfigRequestDto](docs/CreateDunningConfigRequestDto.md)
 - [CreateDunningConfigResponseClass](docs/CreateDunningConfigResponseClass.md)
 - [CreateDunningForInvoiceRequestDtoRest](docs/CreateDunningForInvoiceRequestDtoRest.md)
 - [CreateDunningPositionForInvoiceResponseClass](docs/CreateDunningPositionForInvoiceResponseClass.md)
 - [CreateDunningPositionRequestDtoRest](docs/CreateDunningPositionRequestDtoRest.md)
 - [CreateDunningPositionResponseClass](docs/CreateDunningPositionResponseClass.md)
 - [DunningConfigClass](docs/DunningConfigClass.md)
 - [DunningConfigurationClass](docs/DunningConfigurationClass.md)
 - [DunningConfigurationRequestDto](docs/DunningConfigurationRequestDto.md)
 - [DunningLevelClass](docs/DunningLevelClass.md)
 - [DunningLevelRequestDto](docs/DunningLevelRequestDto.md)
 - [DunningPositionCalculatedClass](docs/DunningPositionCalculatedClass.md)
 - [DunningPositionClass](docs/DunningPositionClass.md)
 - [GetDunningConfigResponseClass](docs/GetDunningConfigResponseClass.md)
 - [GetDunningPositionResponseClass](docs/GetDunningPositionResponseClass.md)
 - [InlineResponse200](docs/InlineResponse200.md)
 - [InlineResponse503](docs/InlineResponse503.md)
 - [ListDunningConfigResponseClass](docs/ListDunningConfigResponseClass.md)
 - [ListDunningPositionResponseClass](docs/ListDunningPositionResponseClass.md)
 - [UpdateDunningConfigRequestDto](docs/UpdateDunningConfigRequestDto.md)
 - [UpdateDunningConfigResponseClass](docs/UpdateDunningConfigResponseClass.md)


## Documentation For Authorization


## bearer

- **Type**: Bearer authentication (JWT)


## Author

kontakt@emil.de


## Notes for Large OpenAPI documents
If the OpenAPI document is large, imports in eis.dunning.apis and eis.dunning.models may fail with a
RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:

Solution 1:
Use specific imports for apis and models like:
- `from eis.dunning.api.default_api import DefaultApi`
- `from eis.dunning.model.pet import Pet`

Solution 2:
Before importing the package, adjust the maximum recursion limit as shown below:
```
import sys
sys.setrecursionlimit(1500)
import eis.dunning
from eis.dunning.apis import *
from eis.dunning.models import *
```

