OS2mo HTTP Trigger Protocol
This package contains the interfaces used for the OS2mo http trigger protocol.
Usage
Install into your project using pip:
pip install os2mo-http-trigger-protocol
Then import it inside a Python file:
from typing import List
from os2mo_http_trigger_protocol import (
EventType,
MOTriggerPayload,
MOTriggerRegister,
RequestType,
)
from fastapi import FastAPI
app = FastAPI()
@app.get(
"/triggers",
summary="List triggers to be registered.",
response_model=List[MOTriggerRegister],
)
def triggers():
"""List triggers to be registered."""
return [
{
"event_type": EventType.ON_BEFORE,
"request_type": RequestType.EDIT,
"role_type": "org_unit",
"url": "/triggers/ou/edit",
}
]
@app.post(
"/triggers/ou/edit",
summary="Print that an organizational unit has been edited",
)
async def triggers_ou_create(payload: MOTriggerPayload):
"""Fired when an OU has been created."""
return {"Hello": "World"}
Metadata
Release files for os2mo-http-trigger-protocol 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| os2mo-http-trigger-protocol-0.0.4.tar.gz | 2.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| os2mo_http_trigger_protocol-0.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.3 kB
Release files / os2mo-http-trigger-protocol-0.0.4.tar.gz
| Download URL | os2mo-http-trigger-protocol-0.0.4.tar.gz |
|---|---|
| Size | 2.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2230de18ff4fc24c94b1392a98a23a44414c624250ec7c838680afb018bc93f6
|
|
BLAKE2b-256 checksum How to use checksums |
9ea437cab46fe70ac18c1e5b1f317cf5bf00b2f03eb62837b406cdbc48049709
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.10
|
Release files / os2mo_http_trigger_protocol-0.0.4-py3-none-any.whl
| Download URL | os2mo_http_trigger_protocol-0.0.4-py3-none-any.whl |
|---|---|
| Size | 8.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
148fa874bace04d731a8f3f2ab316568866e2769fdaeae8301d23bb68bb1c08d
|
|
BLAKE2b-256 checksum How to use checksums |
fc0cac5d020c257c50f87c1a911436c8bb62183faf0bf771c7856aa4a23e3ce9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.10
|