Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: regenerate alarms sdk 🔁 #2

Merged
merged 1 commit into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 88 additions & 7 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
# NOTE: This file is auto generated by OpenAPI Generator.
# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Waylay Alarms Python package
name: Waylay Alarms CI

on:
push:
branches: [ "main" ]
branches: [ "main", "staging", "release/**" ]
tags:
- '**'
pull_request:
branches: [ "main" ]
branches: [ "main", "staging", "release/**" ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -54,3 +51,87 @@ jobs:
run: make ci-install-api
- name: unit tests
run: make test

publish-api:
needs:
- test
- test-minimal
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')

defaults:
run:
working-directory: ./waylay-sdk-alarms

name: Publish api package to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/waylay-sdk-alarms

permissions:
actions: read
contents: read
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install pypa/build
run: pip install build
- name: check version
id: check-tag
uses: samuelcolvin/[email protected]
with:
version_file_path: waylay-sdk-alarms/src/waylay/services/alarms/service/__init__.py
- name: Build
run: python3 -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: waylay-sdk-alarms/dist

publish-types:
needs:
- test
- test-minimal
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')

defaults:
run:
working-directory: ./waylay-sdk-alarms-types

name: Publish types package to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/waylay-sdk-alarms-types


permissions:
actions: read
contents: read
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install pypa/build
run: pip install build
- name: check version
id: check-tag
uses: samuelcolvin/[email protected]
with:
version_file_path: waylay-sdk-alarms-types/src/waylay/services/alarms/models/__init__.py
- name: Build
run: python3 -m build
- 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 }}
25 changes: 25 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.github/workflows/python.yml
.openapi-generator-ignore
LICENSE.txt
Makefile
README.md
docs/ABatchAlarmsSpecification.md
Expand All @@ -8,7 +9,11 @@ docs/AlarmEntity.md
docs/AlarmEvent.md
docs/AlarmEventAlarm.md
docs/AlarmEventChangesInner.md
docs/AlarmEventChangesInnerType.md
docs/AlarmEventType.md
docs/AlarmEventTypeOneOf.md
docs/AlarmEventTypeOneOf1.md
docs/AlarmEventTypeOneOf2.md
docs/AlarmEventsApi.md
docs/AlarmSeverity.md
docs/AlarmSeverityFilter.md
Expand All @@ -25,29 +30,37 @@ docs/AlarmsTimelineItem.md
docs/BatchAlarm.md
docs/BatchAlarmEntity.md
docs/BatchDeleteAlarm.md
docs/BatchDeleteAlarmAllOfAction.md
docs/BatchDeleteAlarmAllOfQuery.md
docs/BatchOperation.md
docs/BatchOperationEnqueued.md
docs/BatchOperationEnqueuedEntity.md
docs/BatchOperationOperation.md
docs/BatchOperationOperationAction.md
docs/BatchOperationResult.md
docs/BatchOperationResults.md
docs/BatchUpdateAlarm.md
docs/BatchUpdateAlarmAllOfAction.md
docs/BulkQueryFilter.md
docs/BulkQueryIds.md
docs/CloudAlarmEvent.md
docs/CloudAlarmEventData.md
docs/CloudAlarmEventDataType.md
docs/CreateAlarm.md
docs/ErrorResponse.md
docs/ErrorResponseWithDetails.md
docs/FailureOperationResultValue.md
docs/GetEventstreamEventFormatParameter.md
docs/IdObject.md
docs/ListAdditionalQueryParamsParameterValue.md
docs/ListOrderParameter.md
docs/ListSortParameter.md
docs/NdJsonResponseStream.md
docs/Operation.md
docs/OperationResultObject.md
docs/OperationResultObjectResults.md
docs/QueuedOperationSummary.md
docs/QueuedOperationSummaryAction.md
docs/SO8601TimestampOrMillis.md
docs/SSEventStream.md
docs/SuccessOperationResultValue.md
Expand All @@ -69,7 +82,11 @@ test/types/alarm_audit_record_stub.py
test/types/alarm_entity_stub.py
test/types/alarm_event_alarm_stub.py
test/types/alarm_event_changes_inner_stub.py
test/types/alarm_event_changes_inner_type_stub.py
test/types/alarm_event_stub.py
test/types/alarm_event_type_one_of1_stub.py
test/types/alarm_event_type_one_of2_stub.py
test/types/alarm_event_type_one_of_stub.py
test/types/alarm_event_type_stub.py
test/types/alarm_severity_filter_stub.py
test/types/alarm_severity_stub.py
Expand All @@ -83,28 +100,36 @@ test/types/alarms_query_result_stub.py
test/types/alarms_timeline_item_stub.py
test/types/batch_alarm_entity_stub.py
test/types/batch_alarm_stub.py
test/types/batch_delete_alarm_all_of_action_stub.py
test/types/batch_delete_alarm_all_of_query_stub.py
test/types/batch_delete_alarm_stub.py
test/types/batch_operation_enqueued_entity_stub.py
test/types/batch_operation_enqueued_stub.py
test/types/batch_operation_operation_action_stub.py
test/types/batch_operation_operation_stub.py
test/types/batch_operation_result_stub.py
test/types/batch_operation_results_stub.py
test/types/batch_operation_stub.py
test/types/batch_update_alarm_all_of_action_stub.py
test/types/batch_update_alarm_stub.py
test/types/bulk_query_filter_stub.py
test/types/bulk_query_ids_stub.py
test/types/cloud_alarm_event_data_stub.py
test/types/cloud_alarm_event_data_type_stub.py
test/types/cloud_alarm_event_stub.py
test/types/create_alarm_stub.py
test/types/error_response_stub.py
test/types/error_response_with_details_stub.py
test/types/failure_operation_result_value_stub.py
test/types/get_eventstream_event_format_parameter_stub.py
test/types/id_object_stub.py
test/types/list_additional_query_params_parameter_value_stub.py
test/types/list_order_parameter_stub.py
test/types/list_sort_parameter_stub.py
test/types/nd_json_response_stream_stub.py
test/types/operation_result_object_results_stub.py
test/types/operation_result_object_stub.py
test/types/queued_operation_summary_action_stub.py
test/types/queued_operation_summary_stub.py
test/types/so8601_timestamp_or_millis_stub.py
test/types/ss_event_stream_stub.py
Expand Down
13 changes: 13 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ISC License (ISC)
Copyright 2024, Waylay

Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT,
OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ TYPES_SRC=${TYPES_FOLDER}/src
TEST_FOLDER=test
TEST_RUN_FOLDER=${TEST_FOLDER}/_run

CMD_FORMAT=ruff format --no-respect-gitignore
CMD_FIX=ruff check --fix --unsafe-fixes --no-respect-gitignore
CMD_CHECK=ruff check
CMD_FORMAT=ruff format --no-respect-gitignore --preview
CMD_FIX=ruff check --fix --unsafe-fixes --no-respect-gitignore --preview
CMD_CHECK=ruff check --no-respect-gitignore --preview

# disables test QA unless set to empty string
TEST_QA_PREFIX?=echo DISABLED
Expand Down Expand Up @@ -53,6 +53,7 @@ clean:
rm -fr */.*_cache
rm -fr */src/*.egg-info
rm -fr **/__pycache__
rm -rf ${TEST_RUN_FOLDER}

lint: install ### Run linting checks
@${VENV_TYPES_ACTIVATE} && make exec-lint
Expand Down
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ 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)

It consists of two sub-packages that are both plugins for the package.
It consists of two sub-packages that are both plugins for the waylay-sdk 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.11+.
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.
Expand All @@ -18,7 +18,7 @@ When the service api methods are required, waylay-sdk-alarms is included in:
- ```pip install waylay-sdk[services]``` to install `waylay-sdk` 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[alarms]``` to install `waylay-sdk` along with all services along with the typed models.
- ```pip install waylay-sdk[services,services-types]``` to install `waylay-sdk` along with all services along with the typed models.

## Usage

Expand All @@ -33,6 +33,8 @@ 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
try:
# Alarm Events
Expand Down Expand Up @@ -75,7 +77,11 @@ Class | Method | HTTP request | Description
- [AlarmEvent](docs/AlarmEvent.md)
- [AlarmEventAlarm](docs/AlarmEventAlarm.md)
- [AlarmEventChangesInner](docs/AlarmEventChangesInner.md)
- [AlarmEventChangesInnerType](docs/AlarmEventChangesInnerType.md)
- [AlarmEventType](docs/AlarmEventType.md)
- [AlarmEventTypeOneOf](docs/AlarmEventTypeOneOf.md)
- [AlarmEventTypeOneOf1](docs/AlarmEventTypeOneOf1.md)
- [AlarmEventTypeOneOf2](docs/AlarmEventTypeOneOf2.md)
- [AlarmSeverity](docs/AlarmSeverity.md)
- [AlarmSeverityFilter](docs/AlarmSeverityFilter.md)
- [AlarmSourceFilter](docs/AlarmSourceFilter.md)
Expand All @@ -89,28 +95,36 @@ Class | Method | HTTP request | Description
- [BatchAlarm](docs/BatchAlarm.md)
- [BatchAlarmEntity](docs/BatchAlarmEntity.md)
- [BatchDeleteAlarm](docs/BatchDeleteAlarm.md)
- [BatchDeleteAlarmAllOfAction](docs/BatchDeleteAlarmAllOfAction.md)
- [BatchDeleteAlarmAllOfQuery](docs/BatchDeleteAlarmAllOfQuery.md)
- [BatchOperation](docs/BatchOperation.md)
- [BatchOperationEnqueued](docs/BatchOperationEnqueued.md)
- [BatchOperationEnqueuedEntity](docs/BatchOperationEnqueuedEntity.md)
- [BatchOperationOperation](docs/BatchOperationOperation.md)
- [BatchOperationOperationAction](docs/BatchOperationOperationAction.md)
- [BatchOperationResult](docs/BatchOperationResult.md)
- [BatchOperationResults](docs/BatchOperationResults.md)
- [BatchUpdateAlarm](docs/BatchUpdateAlarm.md)
- [BatchUpdateAlarmAllOfAction](docs/BatchUpdateAlarmAllOfAction.md)
- [BulkQueryFilter](docs/BulkQueryFilter.md)
- [BulkQueryIds](docs/BulkQueryIds.md)
- [CloudAlarmEvent](docs/CloudAlarmEvent.md)
- [CloudAlarmEventData](docs/CloudAlarmEventData.md)
- [CloudAlarmEventDataType](docs/CloudAlarmEventDataType.md)
- [CreateAlarm](docs/CreateAlarm.md)
- [ErrorResponse](docs/ErrorResponse.md)
- [ErrorResponseWithDetails](docs/ErrorResponseWithDetails.md)
- [FailureOperationResultValue](docs/FailureOperationResultValue.md)
- [GetEventstreamEventFormatParameter](docs/GetEventstreamEventFormatParameter.md)
- [IdObject](docs/IdObject.md)
- [ListAdditionalQueryParamsParameterValue](docs/ListAdditionalQueryParamsParameterValue.md)
- [ListOrderParameter](docs/ListOrderParameter.md)
- [ListSortParameter](docs/ListSortParameter.md)
- [NdJsonResponseStream](docs/NdJsonResponseStream.md)
- [OperationResultObject](docs/OperationResultObject.md)
- [OperationResultObjectResults](docs/OperationResultObjectResults.md)
- [QueuedOperationSummary](docs/QueuedOperationSummary.md)
- [QueuedOperationSummaryAction](docs/QueuedOperationSummaryAction.md)
- [SO8601TimestampOrMillis](docs/SO8601TimestampOrMillis.md)
- [SSEventStream](docs/SSEventStream.md)
- [SuccessOperationResultValue](docs/SuccessOperationResultValue.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/ABatchAlarmsSpecification.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**entity** | [**BatchAlarmEntity**](BatchAlarmEntity.md) | |
**action** | **str** | |
**action** | [**BatchDeleteAlarmAllOfAction**](BatchDeleteAlarmAllOfAction.md) | |
**query** | [**BatchDeleteAlarmAllOfQuery**](BatchDeleteAlarmAllOfQuery.md) | |
**action_parameters** | [**AlarmUpdate**](AlarmUpdate.md) | |

Expand Down
2 changes: 1 addition & 1 deletion docs/AlarmEventChangesInner.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**attribute** | **str** | | [optional]
**type** | **str** | Indication of what has changed | [optional]
**type** | [**AlarmEventChangesInnerType**](AlarmEventChangesInnerType.md) | | [optional]
**old_value** | **str** | | [optional]
**new_value** | **str** | | [optional]

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

Indication of what has changed

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


12 changes: 12 additions & 0 deletions docs/AlarmEventTypeOneOf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# AlarmEventTypeOneOf

A new alarm was created.

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


12 changes: 12 additions & 0 deletions docs/AlarmEventTypeOneOf1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# AlarmEventTypeOneOf1

An alarm happened again.

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


Loading