Skip to content

Commit 9a5585a

Browse files
committed
add some request models
1 parent 597fed0 commit 9a5585a

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/sentry/main.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
1+
from typing import Any, Literal, Mapping
2+
from uuid import UUID
3+
14
from fastapi import FastAPI
25
from pydantic.main import BaseModel
36

47
app = FastAPI()
58

69

10+
class Installation(BaseModel):
11+
uuid: UUID
12+
13+
714
class Request(BaseModel):
8-
name: str
9-
description: str | None = None
10-
price: float
11-
tax: float | None = None
15+
action: str
16+
data: Mapping[str, Any]
17+
actor: Mapping[str, Any]
18+
installation: Installation
19+
20+
21+
SentryHookResource = Literal['installation', 'event_alert', 'issue', 'metric_alert', 'error', 'comment']
1222

1323

1424
@app.post("/api/sentry/webhook")

0 commit comments

Comments
 (0)