Skip to content

Commit

Permalink
chore: regenerate service (sdk)
Browse files Browse the repository at this point in the history
  • Loading branch information
simosho committed Apr 12, 2024
1 parent 16c93c6 commit d8b4970
Show file tree
Hide file tree
Showing 35 changed files with 157 additions and 6,767 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-alarms-types/dist
password: ${{ secrets.PYPI_TYPES_PKG_API_TOKEN }}
packages-dir: waylay-sdk-alarms-types/dist
6 changes: 4 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/ABatchAlarmsSpecification.md
docs/AboutApi.md
docs/AlarmAuditRecord.md
docs/AlarmEntity.md
docs/AlarmEvent.md
Expand Down Expand Up @@ -64,16 +65,15 @@ docs/QueuedOperationSummaryAction.md
docs/SO8601TimestampOrMillis.md
docs/SSEventStream.md
docs/SuccessOperationResultValue.md
docs/VersionApi.md
docs/VersionResponse.md
pyproject.toml
requirements.txt
test/__init__.py
test/api/__init__.py
test/api/about_api_test.py
test/api/alarm_events_api_test.py
test/api/alarms_api_test.py
test/api/alarms_batch_operations_api_test.py
test/api/version_api_test.py
test/conftest.py
test/openapi.py
test/types/__init__.py
Expand Down Expand Up @@ -135,3 +135,5 @@ test/types/so8601_timestamp_or_millis_stub.py
test/types/ss_event_stream_stub.py
test/types/success_operation_result_value_stub.py
test/types/version_response_stub.py
waylay-sdk-alarms-types/README.md
waylay-sdk-alarms/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
37 changes: 17 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,61 +3,59 @@ No description provided (generated by Openapi Generator https://github.com/opena

This Python package is automatically generated based on the
Waylay Alarms OpenAPI specification (API version: 1.11.0)
For more information, please visit [the openapi specification](https://docs.waylay.io/openapi/public/redocly/alarms.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-alarms` sub-package contains the Alarms api methods.
- The `waylay-sdk-alarms-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-alarms`.

## 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-alarms is included in:
- ```pip install waylay-sdk[alarms]``` 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[alarms]``` 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-alarms and waylay-sdk-alarms-types are included in:
- ```pip install waylay-sdk[alarms,alarms-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[alarms,alarms-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-alarms-types` is installed
from waylay.services.alarms.models.get_eventstream_event_format_parameter import GetEventstreamEventFormatParameter
from waylay.services.alarms.models.nd_json_response_stream import NdJsonResponseStream
from waylay.services.alarms.models.version_response import VersionResponse
try:
# Alarm Events
# calls `GET /alarms/v1/events`
api_response = await waylay_client.alarms.alarm_events.get(
# query parameters:
query = {
'eventFormat': 'application/cloudevents+json'
},
# Get Service Information
# calls `GET /alarms/v1`
api_response = await waylay_client.alarms.about.get(
)
print("The response of alarms.alarm_events.get:\n")
print("The response of alarms.about.get:\n")
pprint(api_response)
except ApiError as e:
print("Exception when calling alarms.alarm_events.get: %s\n" % e)
print("Exception when calling alarms.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** /alarms/v1 | Get Service Information
*AlarmEventsApi* | [**get**](docs/AlarmEventsApi.md#get) | **GET** /alarms/v1/events | Alarm Events
*AlarmsApi* | [**create**](docs/AlarmsApi.md#create) | **POST** /alarms/v1/alarms | Create Alarm
*AlarmsApi* | [**delete**](docs/AlarmsApi.md#delete) | **DELETE** /alarms/v1/alarms/{alarmId} | Delete Alarm
Expand All @@ -66,7 +64,6 @@ Class | Method | HTTP request | Description
*AlarmsApi* | [**update**](docs/AlarmsApi.md#update) | **PUT** /alarms/v1/alarms/{alarmId} | Update Alarm
*AlarmsBatchOperationsApi* | [**get**](docs/AlarmsBatchOperationsApi.md#get) | **GET** /alarms/v1/batch/{batchId} | Get Alarms Batch Operation Status
*AlarmsBatchOperationsApi* | [**start**](docs/AlarmsBatchOperationsApi.md#start) | **POST** /alarms/v1/batch | Start Alarms Batch Operation
*VersionApi* | [**get**](docs/VersionApi.md#get) | **GET** /alarms/v1 | Version


## Documentation For Models
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.alarms.VersionApi
# waylay.services.alarms.AboutApi

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

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

# **get**
> get(
> headers
> ) -> VersionResponse
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-alarms-types` is installed
from waylay.services.alarms.models.version_response import VersionResponse
try:
# Version
# Get Service Information
# calls `GET /alarms/v1`
api_response = await waylay_client.alarms.version.get(
api_response = await waylay_client.alarms.about.get(
)
print("The response of alarms.version.get:\n")
print("The response of alarms.about.get:\n")
pprint(api_response)
except ApiError as e:
print("Exception when calling alarms.version.get: %s\n" % e)
print("Exception when calling alarms.about.get: %s\n" % e)
```

### Endpoint
Expand Down
6 changes: 3 additions & 3 deletions docs/AlarmEventsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Method | HTTP request | Description
> get(
> query: GetQuery,
> headers
> ) -> NdJsonResponseStream
> ) -> AsyncIterator[NdJsonResponseStream]
Alarm Events

Expand All @@ -21,7 +21,7 @@ Opens a data stream for all Alarm Events for this tenant.
```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 @@ -62,7 +62,7 @@ Name | Type | API binding | Description | Notes

Selected path param | Raw response param | Return Type | Description | Links
------------------- | ------------------ | ------------ | ----------- | -----
Literal[""] _(default)_ | False _(default)_ | **`NdJsonResponseStream`** | | [NdJsonResponseStream](NdJsonResponseStream.md)
Literal[""] _(default)_ | False _(default)_ | **`AsyncIterator[NdJsonResponseStream]`** | | [NdJsonResponseStream](NdJsonResponseStream.md)
str | False _(default)_ | **`Any`** | If any other string value for the selected path is provided, the exact type of the response will only be known at runtime. |
/ | True | `Response` | The raw http response object.

Expand Down
10 changes: 5 additions & 5 deletions docs/AlarmsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Create an alarm. If an `ACTIVE` or `ACKNOWLEDGED` alarm with the same `source.i
```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 @@ -92,7 +92,7 @@ Delete an Alarm.
```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 @@ -158,7 +158,7 @@ Get an alarm.
```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 @@ -227,7 +227,7 @@ Query multiple alarms using a query language. The response contains the total nu
```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 @@ -337,7 +337,7 @@ Update an alarm.
```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
4 changes: 2 additions & 2 deletions docs/AlarmsBatchOperationsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Get the results of the Alarms Batch Operation.
```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 @@ -90,7 +90,7 @@ Start Alarms Batch Operation.
```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
10 changes: 5 additions & 5 deletions openapi/alarms.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ tags:
- name: Alarms
- name: Alarm Events
- name: Alarms Batch Operations
- name: Version
- name: About
paths:
/alarms/v1/alarms:
post:
Expand Down Expand Up @@ -363,10 +363,10 @@ paths:
/alarms/v1:
get:
tags:
- Version
operationId: get_version
summary: Version
description: Get the status and version of the service.
- About
operationId: get_about
summary: Get Service Information
description: Get the name and version of the service.
responses:
'200':
$ref: '#/components/responses/VersionResponse'
Expand Down
12 changes: 7 additions & 5 deletions openapi/alarms.transformed.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ tags:
- name: Alarms
- name: Alarm Events
- name: Alarms Batch Operations
- name: Version
- name: About
paths:
/alarms/v1/alarms:
post:
Expand Down Expand Up @@ -432,6 +432,7 @@ paths:
x-consumes-urlencoded: false
x-consumes-json: false
x-consumes-other: false
x-produces-event-stream: true
/alarms/v1/batch:
post:
operationId: start
Expand Down Expand Up @@ -484,10 +485,10 @@ paths:
/alarms/v1:
get:
tags:
- Version
operationId: get_version
summary: Version
description: Get the status and version of the service.
- About
operationId: get_about
summary: Get Service Information
description: Get the name and version of the service.
responses:
'200':
$ref: '#/components/responses/VersionResponse'
Expand Down Expand Up @@ -1261,6 +1262,7 @@ components:
oneOf:
- $ref: '#/components/schemas/AlarmEvent'
- $ref: '#/components/schemas/CloudAlarmEvent'
x-is-event-stream: true
BatchStartResponse:
description: Batch Operation Started
content:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pydantic ~= 2.6
typing-extensions ~= 4.9
waylay-sdk ~= 0.0.4rc5
waylay-sdk-core@git+https://github.com/waylayio/waylay-sdk-py@cc464ef9ee120bc54ff6381add0c92a2d06e2944
1 change: 0 additions & 1 deletion test/_run/alarms.openapi.yaml

This file was deleted.

1 change: 0 additions & 1 deletion test/_run/alarms.transformed.openapi.yaml

This file was deleted.

1 change: 0 additions & 1 deletion test/_run/cloudevents.schema.yaml

This file was deleted.

Loading

0 comments on commit d8b4970

Please sign in to comment.