# eis_action
The EMIL ActionService API description

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

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

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

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

## 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.action
from pprint import pprint
from eis.action.api import actions_api
from eis.action.model.create_action_request_dto import CreateActionRequestDto
from eis.action.model.create_action_response_class import CreateActionResponseClass
from eis.action.model.get_action_response_class import GetActionResponseClass
from eis.action.model.get_action_version_response_class import GetActionVersionResponseClass
from eis.action.model.list_action_versions_response_class import ListActionVersionsResponseClass
from eis.action.model.list_actions_response_class import ListActionsResponseClass
from eis.action.model.update_action_request_dto import UpdateActionRequestDto
from eis.action.model.update_action_response_class import UpdateActionResponseClass
# 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.action.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.action.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.action.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = actions_api.ActionsApi(api_client)
    create_action_request_dto = CreateActionRequestDto(
        name="Send Welcome Email",
        slug="send-welcome-email",
        workflow_slug="welcome-email-workflow",
        workflow_code="wf_abc123xyz",
        is_active=True,
        is_available_in_ui=False,
        description="Sends a welcome email to newly registered users",
        entity_type="POLICY",
        product_version_id=1,
        product_slug="motor-product",
        input_validation_schema={},
    ) # CreateActionRequestDto | 
    authorization = "Authorization_example" # str | Bearer Token: provided by the login endpoint under the name accessToken. (optional)

    try:
        # Create the action
        api_response = api_instance.create_action(create_action_request_dto, authorization=authorization)
        pprint(api_response)
    except eis.action.ApiException as e:
        print("Exception when calling ActionsApi->create_action: %s\n" % e)
```

## Documentation for API Endpoints

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

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*ActionsApi* | [**create_action**](docs/ActionsApi.md#create_action) | **POST** /actionservice/v1/actions | Create the action
*ActionsApi* | [**delete_action**](docs/ActionsApi.md#delete_action) | **DELETE** /actionservice/v1/actions/{code} | Delete the action
*ActionsApi* | [**delete_action_version**](docs/ActionsApi.md#delete_action_version) | **DELETE** /actionservice/v1/actions/versions/{versionCode} | Delete the action version
*ActionsApi* | [**get_action**](docs/ActionsApi.md#get_action) | **GET** /actionservice/v1/actions/{code} | Retrieve the action
*ActionsApi* | [**get_action_version**](docs/ActionsApi.md#get_action_version) | **GET** /actionservice/v1/actions/versions/{versionCode} | Retrieve the action version
*ActionsApi* | [**list_action_versions**](docs/ActionsApi.md#list_action_versions) | **GET** /actionservice/v1/actions/{code}/versions | List action versions
*ActionsApi* | [**list_actions**](docs/ActionsApi.md#list_actions) | **GET** /actionservice/v1/actions | List actions
*ActionsApi* | [**list_all_action_versions**](docs/ActionsApi.md#list_all_action_versions) | **GET** /actionservice/v1/actions/versions | List action versions
*ActionsApi* | [**update_action**](docs/ActionsApi.md#update_action) | **PUT** /actionservice/v1/actions/{code} | Update the action
*ActionsApi* | [**update_action_0**](docs/ActionsApi.md#update_action_0) | **PUT** /actionservice/v1/actions/{code} | Update the action
*ExecutionsApi* | [**get_action_execution_status**](docs/ExecutionsApi.md#get_action_execution_status) | **GET** /actionservice/v1/actions/executions/status | Retrieve the actionExecution
*ExecutionsApi* | [**list_action_executions**](docs/ExecutionsApi.md#list_action_executions) | **GET** /actionservice/v1/actions/executions | List actionExecutions
*ExecutionsApi* | [**trigger_action**](docs/ExecutionsApi.md#trigger_action) | **POST** /actionservice/v1/actions/trigger | Create the actionExecution
*DefaultApi* | [**check**](docs/DefaultApi.md#check) | **GET** /actionservice/health | Health Check


## Documentation For Models

 - [ActionClass](docs/ActionClass.md)
 - [ActionExecutionClass](docs/ActionExecutionClass.md)
 - [ActionRefClass](docs/ActionRefClass.md)
 - [ActionVersionClass](docs/ActionVersionClass.md)
 - [CreateActionRequestDto](docs/CreateActionRequestDto.md)
 - [CreateActionResponseClass](docs/CreateActionResponseClass.md)
 - [GetActionExecutionStatusResponseClass](docs/GetActionExecutionStatusResponseClass.md)
 - [GetActionResponseClass](docs/GetActionResponseClass.md)
 - [GetActionVersionResponseClass](docs/GetActionVersionResponseClass.md)
 - [InlineResponse200](docs/InlineResponse200.md)
 - [InlineResponse503](docs/InlineResponse503.md)
 - [ListActionExecutionsResponseClass](docs/ListActionExecutionsResponseClass.md)
 - [ListActionVersionsResponseClass](docs/ListActionVersionsResponseClass.md)
 - [ListActionsResponseClass](docs/ListActionsResponseClass.md)
 - [TriggerActionRequestDto](docs/TriggerActionRequestDto.md)
 - [TriggerActionResponseClass](docs/TriggerActionResponseClass.md)
 - [UpdateActionRequestDto](docs/UpdateActionRequestDto.md)
 - [UpdateActionResponseClass](docs/UpdateActionResponseClass.md)
 - [WorkflowOutputReferenceClass](docs/WorkflowOutputReferenceClass.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.action.apis and eis.action.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.action.api.default_api import DefaultApi`
- `from eis.action.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.action
from eis.action.apis import *
from eis.action.models import *
```

