This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
devicehub-teal/ereuse_devicehub/resources/event/__init__.py

264 lines
4.8 KiB
Python
Raw Normal View History

from typing import Callable, Iterable, Tuple
2018-09-07 10:38:02 +00:00
from teal.resource import Converters, Resource
from ereuse_devicehub.resources.device.sync import Sync
from ereuse_devicehub.resources.event import schemas
from ereuse_devicehub.resources.event.views import EventView
2018-04-10 15:06:39 +00:00
class EventDef(Resource):
SCHEMA = schemas.Event
2018-04-10 15:06:39 +00:00
VIEW = EventView
2018-04-27 17:16:43 +00:00
AUTH = True
2018-06-15 13:31:03 +00:00
ID_CONVERTER = Converters.uuid
2018-04-27 17:16:43 +00:00
class AddDef(EventDef):
VIEW = None
SCHEMA = schemas.Add
class RemoveDef(EventDef):
VIEW = None
SCHEMA = schemas.Remove
2018-06-10 16:47:49 +00:00
class EraseBasicDef(EventDef):
VIEW = None
SCHEMA = schemas.EraseBasic
2018-06-10 16:47:49 +00:00
class EraseSectorsDef(EraseBasicDef):
VIEW = None
SCHEMA = schemas.EraseSectors
2018-06-10 16:47:49 +00:00
class ErasePhysicalDef(EraseBasicDef):
VIEW = None
SCHEMA = schemas.ErasePhysical
2018-06-10 16:47:49 +00:00
class StepDef(Resource):
VIEW = None
SCHEMA = schemas.Step
2018-06-10 16:47:49 +00:00
class StepZeroDef(StepDef):
VIEW = None
SCHEMA = schemas.StepZero
2018-06-10 16:47:49 +00:00
class StepRandomDef(StepDef):
VIEW = None
SCHEMA = schemas.StepRandom
2018-06-10 16:47:49 +00:00
2019-04-16 15:47:28 +00:00
class BenchmarkDef(EventDef):
VIEW = None
2019-04-16 15:47:28 +00:00
SCHEMA = schemas.Benchmark
class BenchmarkDataStorageDef(BenchmarkDef):
VIEW = None
SCHEMA = schemas.BenchmarkDataStorage
class BenchmarkWithRateDef(BenchmarkDef):
VIEW = None
SCHEMA = schemas.BenchmarkWithRate
class BenchmarkProcessorDef(BenchmarkWithRateDef):
VIEW = None
SCHEMA = schemas.BenchmarkProcessor
2018-06-10 16:47:49 +00:00
2019-04-16 15:47:28 +00:00
class BenchmarkProcessorSysbenchDef(BenchmarkProcessorDef):
VIEW = None
2019-04-16 15:47:28 +00:00
SCHEMA = schemas.BenchmarkProcessorSysbench
2018-06-10 16:47:49 +00:00
2019-04-16 15:47:28 +00:00
class BenchmarkRamSysbenchDef(BenchmarkWithRateDef):
VIEW = None
2019-04-16 15:47:28 +00:00
SCHEMA = schemas.BenchmarkRamSysbench
class TestDef(EventDef):
VIEW = None
SCHEMA = schemas.Test
class TestDataStorageDef(TestDef):
VIEW = None
SCHEMA = schemas.TestDataStorage
class StressTestDef(TestDef):
VIEW = None
SCHEMA = schemas.StressTest
class TestAudioDef(TestDef):
VIEW = None
SCHEMA = schemas.TestAudio
class TestConnectivityDef(TestDef):
VIEW = None
SCHEMA = schemas.TestConnectivity
class TestBatteryDef(TestDef):
VIEW = None
SCHEMA = schemas.TestBattery
class TestCameraDef(TestDef):
VIEW = None
SCHEMA = schemas.TestCamera
class TestKeyboardDef(TestDef):
VIEW = None
SCHEMA = schemas.TestKeyboard
class TestTrackpadDef(TestDef):
VIEW = None
SCHEMA = schemas.TestTrackpad
class TestBiosDef(TestDef):
VIEW = None
SCHEMA = schemas.TestBios
class TestVisualDef(TestDef):
VIEW = None
SCHEMA = schemas.TestVisual
2019-04-16 15:47:28 +00:00
class RateDef(EventDef):
VIEW = None
SCHEMA = schemas.Rate
2018-06-10 16:47:49 +00:00
2019-04-16 15:47:28 +00:00
class RateComputerDef(RateDef):
VIEW = None
2019-04-16 15:47:28 +00:00
SCHEMA = schemas.RateComputer
2018-06-20 21:18:15 +00:00
2018-07-14 14:41:22 +00:00
class PriceDef(EventDef):
VIEW = None
SCHEMA = schemas.Price
2018-07-14 14:41:22 +00:00
class EreusePriceDef(EventDef):
VIEW = None
SCHEMA = schemas.EreusePrice
2018-07-14 14:41:22 +00:00
2018-06-10 16:47:49 +00:00
class InstallDef(EventDef):
VIEW = None
SCHEMA = schemas.Install
2018-06-10 16:47:49 +00:00
2018-04-27 17:16:43 +00:00
class SnapshotDef(EventDef):
VIEW = None
SCHEMA = schemas.Snapshot
def __init__(self, app, import_name=__name__.split('.')[0], static_folder=None,
static_url_path=None,
template_folder=None, url_prefix=None, subdomain=None, url_defaults=None,
root_path=None, cli_commands: Iterable[Tuple[Callable, str or None]] = tuple()):
url_prefix = '/{}'.format(EventDef.resource)
super().__init__(app, import_name, static_folder, static_url_path, template_folder,
url_prefix, subdomain, url_defaults, root_path, cli_commands)
self.sync = Sync()
class ToRepairDef(EventDef):
VIEW = None
SCHEMA = schemas.ToRepair
class RepairDef(EventDef):
VIEW = None
SCHEMA = schemas.Repair
class ReadyToUse(EventDef):
VIEW = None
SCHEMA = schemas.ReadyToUse
class ToPrepareDef(EventDef):
VIEW = None
SCHEMA = schemas.ToPrepare
class PrepareDef(EventDef):
VIEW = None
SCHEMA = schemas.Prepare
class LiveDef(EventDef):
VIEW = None
SCHEMA = schemas.Live
class ReserveDef(EventDef):
VIEW = None
SCHEMA = schemas.Reserve
class CancelReservationDef(EventDef):
VIEW = None
SCHEMA = schemas.CancelReservation
class SellDef(EventDef):
VIEW = None
SCHEMA = schemas.Sell
class DonateDef(EventDef):
VIEW = None
SCHEMA = schemas.Donate
class RentDef(EventDef):
VIEW = None
SCHEMA = schemas.Rent
class CancelTradeDef(EventDef):
VIEW = None
SCHEMA = schemas.CancelTrade
class ToDisposeProductDef(EventDef):
VIEW = None
SCHEMA = schemas.ToDisposeProduct
class DisposeProductDef(EventDef):
VIEW = None
SCHEMA = schemas.DisposeProduct
class ReceiveDef(EventDef):
VIEW = None
SCHEMA = schemas.Receive
class MigrateToDef(EventDef):
VIEW = None
SCHEMA = schemas.MigrateTo
class MigrateFromDef(EventDef):
VIEW = None
SCHEMA = schemas.MigrateFrom