# eis_numbergenerator
The EMIL Number Generator Service API is a robust tool 
                designed to generate unique and structured entity numbers 
                like policies, accounts, invoices, and other entities. 
                This API streamlines the process of creating distinct identifiers 
                for various business objects.

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

- API version: 1.0
- Package version: 1.2.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.numbergenerator
```
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/emilDev/eis-numbergenerator-sdk.git`)

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

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

## 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.numbergenerator
from pprint import pprint
from eis.numbergenerator.api import numbers_api
from eis.numbergenerator.model.create_number_response_class import CreateNumberResponseClass
from eis.numbergenerator.model.get_number_response_class import GetNumberResponseClass
from eis.numbergenerator.model.list_numbers_response_class import ListNumbersResponseClass
from eis.numbergenerator.model.lookup_number_request_dto import LookupNumberRequestDto
from eis.numbergenerator.model.reset_number_request_dto import ResetNumberRequestDto
from eis.numbergenerator.model.update_number_response_class import UpdateNumberResponseClass
# 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.numbergenerator.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.numbergenerator.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.numbergenerator.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = numbers_api.NumbersApi(api_client)
    slug = "test-slug" # str | The slug of the number
    type = "sequence" # str | The type of number generator. This determines the structure of the config object.
    config = {} # {str: (bool, date, datetime, dict, float, int, list, str, none_type)} | Configuration object that varies based on the type field
    authorization = "Authorization_example" # str | Bearer Token: provided by the login endpoint under the name accessToken. (optional)

    try:
        # Create the number
        api_response = api_instance.create_number(slug, type, config, authorization=authorization)
        pprint(api_response)
    except eis.numbergenerator.ApiException as e:
        print("Exception when calling NumbersApi->create_number: %s\n" % e)
```

## Documentation for API Endpoints

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

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*NumbersApi* | [**create_number**](docs/NumbersApi.md#create_number) | **POST** /numbergenerator/v1/numbers | Create the number
*NumbersApi* | [**get_number**](docs/NumbersApi.md#get_number) | **GET** /numbergenerator/v1/numbers/{code} | Retrieve the number
*NumbersApi* | [**list_numbers**](docs/NumbersApi.md#list_numbers) | **GET** /numbergenerator/v1/numbers | List Numbers
*NumbersApi* | [**lookup_number**](docs/NumbersApi.md#lookup_number) | **POST** /numbergenerator/v1/numbers/lookup | Lookup entity number
*NumbersApi* | [**reset_number**](docs/NumbersApi.md#reset_number) | **POST** /numbergenerator/v1/numbers/reset | Reset entity number
*NumbersApi* | [**update_number**](docs/NumbersApi.md#update_number) | **PUT** /numbergenerator/v1/numbers/{code} | Update the number
*DefaultApi* | [**check**](docs/DefaultApi.md#check) | **GET** /numbergenerator/health | 


## Documentation For Models

 - [CreateNumberResponseClass](docs/CreateNumberResponseClass.md)
 - [EntityNumberClass](docs/EntityNumberClass.md)
 - [GetNumberResponseClass](docs/GetNumberResponseClass.md)
 - [InlineResponse200](docs/InlineResponse200.md)
 - [InlineResponse503](docs/InlineResponse503.md)
 - [ListNumbersResponseClass](docs/ListNumbersResponseClass.md)
 - [LookupNumberRequestDto](docs/LookupNumberRequestDto.md)
 - [ResetNumberRequestDto](docs/ResetNumberRequestDto.md)
 - [UpdateNumberResponseClass](docs/UpdateNumberResponseClass.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.numbergenerator.apis and eis.numbergenerator.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.numbergenerator.api.default_api import DefaultApi`
- `from eis.numbergenerator.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.numbergenerator
from eis.numbergenerator.apis import *
from eis.numbergenerator.models import *
```

