File size: 617 Bytes
55d6386
 
 
 
a7c7f70
55d6386
a7c7f70
 
 
 
55d6386
 
 
a7c7f70
 
 
55d6386
 
a7c7f70
 
 
 
 
 
55d6386
 
a7c7f70
 
55d6386
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import os
from pydantic import BaseModel
from typing import Literal


class Config(BaseModel):
    target_namespace: str
    input_dataset: str
    input_model: str
    autotrain_project_prefix: str


class WebhookPayloadEvent(BaseModel):
    action: Literal["create", "update", "delete"]
    scope: str


class WebhookPayloadRepo(BaseModel):
    type: Literal["dataset", "model", "space"]
    name: str
    id: str
    private: bool
    headSha: str


class WebhookPayload(BaseModel):
    event: WebhookPayloadEvent
    repo: WebhookPayloadRepo


config = Config.parse_file(os.path.join(os.getcwd(), "config.json"))