-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtrigger.py
More file actions
64 lines (48 loc) · 1.85 KB
/
trigger.py
File metadata and controls
64 lines (48 loc) · 1.85 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
"""Module defining resume trigger types and data models."""
from enum import Enum
from typing import Any
from pydantic import BaseModel, ConfigDict, Field
class UiPathResumeTriggerType(str, Enum):
"""Constants representing different types of resume job triggers in the system."""
NONE = "None"
QUEUE_ITEM = "QueueItem"
JOB = "Job"
TASK = "Task"
TIMER = "Timer"
INBOX = "Inbox"
API = "Api"
DEEP_RAG = "DeepRag"
BATCH_RAG = "BatchRag"
IXP_EXTRACTION = "IxpExtraction"
class UiPathResumeTriggerName(str, Enum):
"""Constants representing specific names for resume job triggers in the system."""
UNKNOWN = "Unknown"
QUEUE_ITEM = "QueueItem"
JOB = "Job"
TASK = "Task"
ESCALATION = "Escalation"
TIMER = "Timer"
INBOX = "Inbox"
API = "Api"
DEEP_RAG = "DeepRag"
BATCH_RAG = "BatchRag"
EXTRACTION = "Extraction"
class UiPathApiTrigger(BaseModel):
"""API resume trigger request."""
inbox_id: str | None = Field(default=None, alias="inboxId")
request: Any = None
model_config = ConfigDict(validate_by_name=True)
class UiPathResumeTrigger(BaseModel):
"""Information needed to resume execution."""
trigger_type: UiPathResumeTriggerType = Field(
default=UiPathResumeTriggerType.API, alias="triggerType"
)
trigger_name: UiPathResumeTriggerName = Field(
default=UiPathResumeTriggerName.UNKNOWN, alias="triggerName", exclude=True
)
item_key: str | None = Field(default=None, alias="itemKey")
api_resume: UiPathApiTrigger | None = Field(default=None, alias="apiResume")
folder_path: str | None = Field(default=None, alias="folderPath")
folder_key: str | None = Field(default=None, alias="folderKey")
payload: Any | None = Field(default=None, alias="interruptObject", exclude=True)
model_config = ConfigDict(validate_by_name=True)