|
| 1 | +"""Module defining resume trigger types and data models.""" |
| 2 | + |
| 3 | +from enum import Enum |
| 4 | +from typing import Any |
| 5 | + |
| 6 | +from pydantic import BaseModel, ConfigDict, Field |
| 7 | + |
| 8 | + |
| 9 | +class UiPathResumeTriggerType(str, Enum): |
| 10 | + """Constants representing different types of resume job triggers in the system.""" |
| 11 | + |
| 12 | + NONE = "None" |
| 13 | + QUEUE_ITEM = "QueueItem" |
| 14 | + JOB = "Job" |
| 15 | + TASK = "Task" |
| 16 | + TIMER = "Timer" |
| 17 | + INBOX = "Inbox" |
| 18 | + API = "Api" |
| 19 | + DEEP_RAG = "DeepRag" |
| 20 | + BATCH_RAG = "BatchRag" |
| 21 | + INDEX_INGESTION = "IndexIngestion" |
| 22 | + IXP_EXTRACTION = "IxpExtraction" |
| 23 | + IXP_VS_ESCALATION = "IxpVsEscalation" |
| 24 | + |
| 25 | + |
| 26 | +class UiPathResumeTriggerName(str, Enum): |
| 27 | + """Constants representing specific names for resume job triggers in the system.""" |
| 28 | + |
| 29 | + UNKNOWN = "Unknown" |
| 30 | + QUEUE_ITEM = "QueueItem" |
| 31 | + JOB = "Job" |
| 32 | + TASK = "Task" |
| 33 | + ESCALATION = "Escalation" |
| 34 | + TIMER = "Timer" |
| 35 | + INBOX = "Inbox" |
| 36 | + API = "Api" |
| 37 | + DEEP_RAG = "DeepRag" |
| 38 | + BATCH_RAG = "BatchRag" |
| 39 | + INDEX_INGESTION = "IndexIngestion" |
| 40 | + EXTRACTION = "Extraction" |
| 41 | + IXP_VS_ESCALATION = "IxpVsEscalation" |
| 42 | + |
| 43 | + |
| 44 | +class UiPathApiTrigger(BaseModel): |
| 45 | + """API resume trigger request.""" |
| 46 | + |
| 47 | + inbox_id: str | None = Field(default=None, alias="inboxId") |
| 48 | + request: Any = None |
| 49 | + |
| 50 | + model_config = ConfigDict(validate_by_name=True) |
| 51 | + |
| 52 | + |
| 53 | +class UiPathResumeTrigger(BaseModel): |
| 54 | + """Information needed to resume execution.""" |
| 55 | + |
| 56 | + interrupt_id: str | None = Field(default=None, alias="interruptId") |
| 57 | + trigger_type: UiPathResumeTriggerType = Field( |
| 58 | + default=UiPathResumeTriggerType.API, alias="triggerType" |
| 59 | + ) |
| 60 | + trigger_name: UiPathResumeTriggerName = Field( |
| 61 | + default=UiPathResumeTriggerName.UNKNOWN, alias="triggerName", exclude=True |
| 62 | + ) |
| 63 | + item_key: str | None = Field(default=None, alias="itemKey") |
| 64 | + api_resume: UiPathApiTrigger | None = Field(default=None, alias="apiResume") |
| 65 | + folder_path: str | None = Field(default=None, alias="folderPath") |
| 66 | + folder_key: str | None = Field(default=None, alias="folderKey") |
| 67 | + payload: Any | None = Field(default=None, alias="interruptObject", exclude=True) |
| 68 | + |
| 69 | + model_config = ConfigDict(validate_by_name=True) |
0 commit comments