Skip to content

Commit

Permalink
chore: regenerate service (sdk)
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-schoonjans committed Apr 12, 2024
1 parent 7f2e801 commit ff3be95
Show file tree
Hide file tree
Showing 55 changed files with 515 additions and 16,373 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: code qa
run: make ci-code-qa
- name: unit tests
run: make test
run: make ci-test

test-minimal:
runs-on: ubuntu-latest
Expand All @@ -50,7 +50,7 @@ jobs:
- name: install dependencies
run: make ci-install-api
- name: unit tests
run: make test
run: make ci-test

publish-api:
needs:
Expand Down Expand Up @@ -133,5 +133,4 @@ jobs:
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: waylay-sdk-rules-types/dist
password: ${{ secrets.PYPI_TYPES_PKG_API_TOKEN }}
packages-dir: waylay-sdk-rules-types/dist
8 changes: 6 additions & 2 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ LICENSE.txt
Makefile
README.md
docs/ATasksBatchOperationSpecification.md
docs/AboutApi.md
docs/ActuatorExecutionResult.md
docs/ActuatorNode.md
docs/BatchIdQuery.md
Expand Down Expand Up @@ -61,6 +62,7 @@ docs/ReactiveTaskSettingType.md
docs/RelationNode.md
docs/ReplaceTemplate200Response.md
docs/ResourceDataInjection.md
docs/RetryConfig.md
docs/RunTemplateLogLevelParameter.md
docs/ScheduledTaskSetting.md
docs/ScheduledTaskSettingAllOfType.md
Expand Down Expand Up @@ -110,21 +112,20 @@ docs/VariableDeclaration.md
docs/VariableDeclarationDefaultValue.md
docs/VariableFormat.md
docs/VariableType.md
docs/VersionApi.md
docs/VersionResponse.md
docs/VersionResponseStatus.md
pyproject.toml
requirements.txt
test/__init__.py
test/api/__init__.py
test/api/about_api_test.py
test/api/plugs_execution_api_test.py
test/api/push_data_api_test.py
test/api/task_nodes_api_test.py
test/api/tasks_api_test.py
test/api/tasks_batch_operations_api_test.py
test/api/template_runs_api_test.py
test/api/templates_api_test.py
test/api/version_api_test.py
test/conftest.py
test/openapi.py
test/types/__init__.py
Expand Down Expand Up @@ -183,6 +184,7 @@ test/types/reactive_task_setting_type_stub.py
test/types/relation_node_stub.py
test/types/replace_template200_response_stub.py
test/types/resource_data_injection_stub.py
test/types/retry_config_stub.py
test/types/run_template_log_level_parameter_stub.py
test/types/scheduled_task_setting_all_of_type_stub.py
test/types/scheduled_task_setting_stub.py
Expand Down Expand Up @@ -229,3 +231,5 @@ test/types/variable_format_stub.py
test/types/variable_type_stub.py
test/types/version_response_status_stub.py
test/types/version_response_stub.py
waylay-sdk-rules-types/README.md
waylay-sdk-rules/README.md
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ typecheck: install ### Run type checks
code-qa: install ### perform code quality checks
@${VENV_TYPES_ACTIVATE} && make exec-code-qa

test: test-types test-notypes ### Run unit tests with and without types installed
test: test-notypes test-types ### Run unit tests with and without types installed

test-types: install-types ### Run unit tests with types installed
@${VENV_TYPES_ACTIVATE} && make exec-test
Expand Down Expand Up @@ -134,6 +134,8 @@ ci-install-types: ci-install-api ### Install the environment including types wit
ci-install-api: _install_requirements ### Install the minimal environment with frozen requirements
pip install './${API_FOLDER}[dev]'

ci-test: exec-test ### perform ci unit tests

_install_requirements:
pip install --upgrade pip
pip install -r requirements.txt
Expand Down
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,59 +3,59 @@ The REST api to manage rule tasks and rule templates in the Waylay platform.

This Python package is automatically generated based on the
Waylay Rules OpenAPI specification (API version: 6.5.0)
For more information, please visit [the openapi specification](https://docs.waylay.io/openapi/public/redocly/rules.html).

It consists of two sub-packages that are both plugins for the waylay-sdk package.
It consists of two sub-packages that are both plugins for the waylay-sdk-core package.
- The `waylay-sdk-rules` sub-package contains the Rules api methods.
- The `waylay-sdk-rules-types` sub-package is an extension that contains the typed model classes for all path params, query params, body params and responses for each of the api methods in `waylay-sdk-rules`.

## Requirements.
This package requires Python 3.9+.

## Installation
Typically this package is installed when installing the [waylay-sdk](https://github.com/waylayio/waylay-sdk-py) package to enable the service's functionality.
Typically this package is installed when installing the [waylay-sdk-core](https://pypi.org/project/waylay-sdk/) package to enable the service's functionality.
When the service api methods are required, waylay-sdk-rules is included in:
- ```pip install waylay-sdk[rules]``` to install `waylay-sdk` along with only this service, or
- ```pip install waylay-sdk[services]``` to install `waylay-sdk` along with all services.
- ```pip install waylay-sdk-core[rules]``` to install `waylay-sdk-core` along with only this service, or
- ```pip install waylay-sdk-core[services]``` to install `waylay-sdk-core` along with all services.
When the typed models are required, both waylay-sdk-rules and waylay-sdk-rules-types are included in:
- ```pip install waylay-sdk[rules,rules-types]``` to install `waylay-sdk` along with only this service including the typed models, or
- ```pip install waylay-sdk[services,services-types]``` to install `waylay-sdk` along with all services along with the typed models.
- ```pip install waylay-sdk-core[rules,rules-types]``` to install `waylay-sdk-core` along with only this service including the typed models, or
- ```pip install waylay-sdk-core[services,services-types]``` to install `waylay-sdk-core` along with all services along with the typed models.

## Usage


```python
from pprint import pprint

# Import the waylay-client from the waylay-sdk package
# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()

# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-rules-types` is installed
from waylay.services.rules.models.execute_plugs_specification import ExecutePlugsSpecification
from waylay.services.rules.models.transformer_execution_result import TransformerExecutionResult
from waylay.services.rules.models.version_response import VersionResponse
try:
# Execute Specified Transformer Version
# calls `POST /rules/v1/transformers/{name}/versions/{version}`
api_response = await waylay_client.rules.plugs_execution.execute_transformer_version(
'name_example', # name | path param "name"
'version_example', # version | path param "version"
# Get Service Information
# calls `GET /rules/v1`
api_response = await waylay_client.rules.about.get(
)
print("The response of rules.plugs_execution.execute_transformer_version:\n")
print("The response of rules.about.get:\n")
pprint(api_response)
except ApiError as e:
print("Exception when calling rules.plugs_execution.execute_transformer_version: %s\n" % e)
print("Exception when calling rules.about.get: %s\n" % e)
```


For more information, please visit the [Waylay API documentation](https://docs.waylay.io/#/api/?id=software-development-kits).

## Documentation for API Endpoints

All URIs are relative to *https://api.waylay.io*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AboutApi* | [**get**](docs/AboutApi.md#get) | **GET** /rules/v1 | Get Service Information
*PlugsExecutionApi* | [**execute_actuator**](docs/PlugsExecutionApi.md#execute_actuator) | **POST** /rules/v1/actions/{name} | Execute Latest Actuator Version
*PlugsExecutionApi* | [**execute_actuator_version**](docs/PlugsExecutionApi.md#execute_actuator_version) | **POST** /rules/v1/actions/{name}/versions/{version} | Execute Specified Actuator Version
*PlugsExecutionApi* | [**execute_sensor**](docs/PlugsExecutionApi.md#execute_sensor) | **POST** /rules/v1/sensors/{name} | Execute Latest Sensor Version
Expand Down Expand Up @@ -87,7 +87,6 @@ Class | Method | HTTP request | Description
*TemplatesApi* | [**replace**](docs/TemplatesApi.md#replace) | **PUT** /rules/v1/templates/{name} | Update Template
*TemplatesApi* | [**set**](docs/TemplatesApi.md#set) | **PUT** /rules/v1/discoveryTemplate | Set Discovery Template
*TemplatesApi* | [**upgrade_plugins**](docs/TemplatesApi.md#upgrade_plugins) | **PATCH** /rules/v1/templates | Upgrade Plugins
*VersionApi* | [**get**](docs/VersionApi.md#get) | **GET** /rules/v1 | Get Version


## Documentation For Models
Expand Down Expand Up @@ -147,6 +146,7 @@ Class | Method | HTTP request | Description
- [RelationNode](docs/RelationNode.md)
- [ReplaceTemplate200Response](docs/ReplaceTemplate200Response.md)
- [ResourceDataInjection](docs/ResourceDataInjection.md)
- [RetryConfig](docs/RetryConfig.md)
- [RunTemplateLogLevelParameter](docs/RunTemplateLogLevelParameter.md)
- [ScheduledTaskSetting](docs/ScheduledTaskSetting.md)
- [ScheduledTaskSettingAllOfType](docs/ScheduledTaskSettingAllOfType.md)
Expand Down
18 changes: 9 additions & 9 deletions docs/VersionApi.md → docs/AboutApi.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# waylay.services.rules.VersionApi
# waylay.services.rules.AboutApi

All URIs are relative to *https://api.waylay.io*

Method | HTTP request | Description
------------- | ------------- | -------------
[**get**](VersionApi.md#get) | **GET** /rules/v1 | Get Version
[**get**](AboutApi.md#get) | **GET** /rules/v1 | Get Service Information

# **get**
> get(
> headers
> ) -> VersionResponse
Get Version
Get Service Information

Get the status and version of the service.
Get the name and version of the service.

### Example

```python
from pprint import pprint

# Import the waylay-client from the waylay-sdk package
# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

Expand All @@ -30,14 +30,14 @@ waylay_client = WaylayClient.from_profile()
# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-rules-types` is installed
from waylay.services.rules.models.version_response import VersionResponse
try:
# Get Version
# Get Service Information
# calls `GET /rules/v1`
api_response = await waylay_client.rules.version.get(
api_response = await waylay_client.rules.about.get(
)
print("The response of rules.version.get:\n")
print("The response of rules.about.get:\n")
pprint(api_response)
except ApiError as e:
print("Exception when calling rules.version.get: %s\n" % e)
print("Exception when calling rules.about.get: %s\n" % e)
```

### Endpoint
Expand Down
2 changes: 1 addition & 1 deletion docs/PeriodicTaskSetting.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | [**PeriodicTaskSettingType**](PeriodicTaskSettingType.md) | |
**frequency** | **int** | polling frequency in milliseconds | [optional]
**frequency** | **int** | polling frequency in milliseconds |

## Example

Expand Down
12 changes: 6 additions & 6 deletions docs/PlugsExecutionApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Execute latest version of an actuator.
```python
from pprint import pprint

# Import the waylay-client from the waylay-sdk package
# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

Expand Down Expand Up @@ -98,7 +98,7 @@ Execute specified version of an actuator.
```python
from pprint import pprint

# Import the waylay-client from the waylay-sdk package
# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

Expand Down Expand Up @@ -171,7 +171,7 @@ Execute latest version of a sensor.
```python
from pprint import pprint

# Import the waylay-client from the waylay-sdk package
# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

Expand Down Expand Up @@ -243,7 +243,7 @@ Execute the specified version of a sensor.
```python
from pprint import pprint

# Import the waylay-client from the waylay-sdk package
# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

Expand Down Expand Up @@ -316,7 +316,7 @@ Execute the latest transformer version.
```python
from pprint import pprint

# Import the waylay-client from the waylay-sdk package
# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

Expand Down Expand Up @@ -388,7 +388,7 @@ Execute specified version of a transformer.
```python
from pprint import pprint

# Import the waylay-client from the waylay-sdk package
# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

Expand Down
2 changes: 1 addition & 1 deletion docs/PushDataApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Push (real-time) streaming data.
```python
from pprint import pprint

# Import the waylay-client from the waylay-sdk package
# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

Expand Down
33 changes: 33 additions & 0 deletions docs/RetryConfig.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# RetryConfig

Configuration for retrying a template node. The node execution will be retried `maxRetries` times. The delay between retries will be exponentially increased starting from `minBackoff` to `maxBackoff`. If the node execution fails after `maxRetries` retries, the node state will be set to `errorState` if it that property is provided. Otherwise node execution will fail. Error state should be one of the possible states defined by the sensor node.

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**max_retries** | **int** | |
**min_backoff** | **str** | |
**max_backoff** | **str** | |
**error_state** | **str** | Optional sensor state which will be used to set the state of the node when the maxRetries is reached. | [optional]

## Example

```python
from waylay.services.rules.models.retry_config import RetryConfig

# TODO update the JSON string below
json = "{}"
# create an instance of RetryConfig from a JSON string
retry_config_instance = RetryConfig.from_json(json)
# print the JSON string representation of the object
print RetryConfig.to_json()

# convert the object into a dict
retry_config_dict = retry_config_instance.to_dict()
# create an instance of RetryConfig from a dict
retry_config_form_dict = retry_config.from_dict(retry_config_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


1 change: 1 addition & 0 deletions docs/SensorNode.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Name | Type | Description | Notes
**timeout** | **str** | | [optional] [default to 'PT50S']
**timeout_state** | **str** | | [optional]
**loop_def** | **str** | A loop definition is a string that defines items over which node will be iterated multiple times. The string is an JSON array of JSON objects.During template execution the sensor node with such a defined loop definition will be invoked for every JSON Object in the JSON array. Parameter is optional. Node will be executed only once if loop definition is not defined. | [optional]
**retry_config** | [**RetryConfig**](RetryConfig.md) | | [optional]

## Example

Expand Down
2 changes: 1 addition & 1 deletion docs/TaskFromTemplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Name | Type | Description | Notes
**variables** | **object** | set of variables which will be used when starting a task and will automatically be injected in the template before starting a task. | [optional]
**type** | [**ReactiveTaskSettingType**](ReactiveTaskSettingType.md) | |
**time_zone** | **str** | Optional identifier of the time zone in which the schedule expression is to be interpreted | [optional]
**frequency** | **int** | polling frequency in milliseconds | [optional]
**frequency** | **int** | polling frequency in milliseconds |
**start** | **bool** | | [optional] [default to True]
**template** | **str** | Unique template identifier |

Expand Down
8 changes: 4 additions & 4 deletions docs/TaskNodesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Get the supported states of a node. #### visibility This definition has visibil
```python
from pprint import pprint

# Import the waylay-client from the waylay-sdk package
# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

Expand Down Expand Up @@ -95,7 +95,7 @@ Get current states (posteriors) and raw data of the node. #### visibility This
```python
from pprint import pprint

# Import the waylay-client from the waylay-sdk package
# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

Expand Down Expand Up @@ -166,7 +166,7 @@ Set the current state and rawData for the node. This can only be done for a runn
```python
from pprint import pprint

# Import the waylay-client from the waylay-sdk package
# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

Expand Down Expand Up @@ -242,7 +242,7 @@ Set the current state of the node. This call is deprecated. Please use `PATCH /
```python
from pprint import pprint

# Import the waylay-client from the waylay-sdk package
# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError

Expand Down
Loading

0 comments on commit ff3be95

Please sign in to comment.