diff --git a/.openapi-client-steering.yml b/.openapi-client-steering.yml new file mode 100644 index 0000000000000000000000000000000000000000..2122f947ec5e50a432ecd6060c183f234602ca6f --- /dev/null +++ b/.openapi-client-steering.yml @@ -0,0 +1,2 @@ +project_name_override: .build +package_name_override: aura_steering_api \ No newline at end of file diff --git a/Makefile b/Makefile index 857dace859d1d270b279c512b47fd6060bd1ced6..1f6bef0a8368b8fe9a2c82c1f1c5326798a937b0 100644 --- a/Makefile +++ b/Makefile @@ -66,7 +66,11 @@ build.models:: cp -r .build/aura_tank_api/models src/aura_tank_api cp .build/aura_tank_api/py.typed src/aura_tank_api cp .build/aura_tank_api/types.py src/aura_tank_api - + rm -rf .build + poetry run openapi-python-client generate --path schemas/openapi-steering.json --config .openapi-client-steering.yml + cp -r .build/aura_steering_api/models src/aura_steering_api + cp .build/aura_steering_api/py.typed src/aura_steering_api + cp .build/aura_steering_api/types.py src/aura_steering_api lint:: poetry run python3 -m flake8 . diff --git a/schemas/openapi-steering.json b/schemas/openapi-steering.json new file mode 100644 index 0000000000000000000000000000000000000000..345e57754eafecb37382c45b3132c98decd62c71 --- /dev/null +++ b/schemas/openapi-steering.json @@ -0,0 +1,92 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "AURA Steering API", + "version": "1.0.0", + "description": "Programme/schedule management for Aura" + }, + "paths": {}, + "components": { + "schemas": { + "Timeslot": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "start": { + "type": "string", + "format": "date-time" + }, + "end": { + "type": "string", + "format": "date-time" + }, + "title": { + "type": "integer" + }, + "schedule_id": { + "type": "integer" + }, + "is_repetition": { + "type": "boolean", + "nullable": true + }, + "playlist_id": { + "type": "integer", + "nullable": true + }, + "schedule_default_playlist_id": { + "type": "integer", + "nullable": true + }, + "show_default_playlist_id": { + "type": "integer", + "nullable": true + }, + "show_id": { + "type": "integer" + }, + "show_name": { + "type": "string" + }, + "show_hosts": { + "type": "string" + }, + "show_type": { + "type": "string", + "nullable": true + }, + "show_categories": { + "type": "string", + "nullable": true + }, + "show_topics": { + "type": "string", + "nullable": true + }, + "show_musicfocus": { + "type": "string", + "nullable": true + }, + "show_languages": { + "type": "string", + "nullable": true + }, + "show_fundingcategory": { + "type": "string", + "nullable": true + }, + "memo": { + "type": "string", + "nullable": true + }, + "className": { + "type": "string", + "nullable": true + } + } + } + } + } +} \ No newline at end of file