75 lines
2.4 KiB
Python
75 lines
2.4 KiB
Python
![]() |
# Code generated by Lark OpenAPI.
|
||
|
|
||
|
from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
|
||
|
from lark_oapi.core.construct import init
|
||
|
from .approval_task import ApprovalTask
|
||
|
from .approval_comment import ApprovalComment
|
||
|
|
||
|
|
||
|
class ApprovalInstance(object):
|
||
|
_types = {
|
||
|
"id": str,
|
||
|
"label": Dict[str, str],
|
||
|
"initiator": str,
|
||
|
"instance_start_time": str,
|
||
|
"status": str,
|
||
|
"tasks": List[ApprovalTask],
|
||
|
"comments": List[ApprovalComment],
|
||
|
"api_id": str,
|
||
|
}
|
||
|
|
||
|
def __init__(self, d=None):
|
||
|
self.id: Optional[str] = None
|
||
|
self.label: Optional[Dict[str, str]] = None
|
||
|
self.initiator: Optional[str] = None
|
||
|
self.instance_start_time: Optional[str] = None
|
||
|
self.status: Optional[str] = None
|
||
|
self.tasks: Optional[List[ApprovalTask]] = None
|
||
|
self.comments: Optional[List[ApprovalComment]] = None
|
||
|
self.api_id: Optional[str] = None
|
||
|
init(self, d, self._types)
|
||
|
|
||
|
@staticmethod
|
||
|
def builder() -> "ApprovalInstanceBuilder":
|
||
|
return ApprovalInstanceBuilder()
|
||
|
|
||
|
|
||
|
class ApprovalInstanceBuilder(object):
|
||
|
def __init__(self) -> None:
|
||
|
self._approval_instance = ApprovalInstance()
|
||
|
|
||
|
def id(self, id: str) -> "ApprovalInstanceBuilder":
|
||
|
self._approval_instance.id = id
|
||
|
return self
|
||
|
|
||
|
def label(self, label: Dict[str, str]) -> "ApprovalInstanceBuilder":
|
||
|
self._approval_instance.label = label
|
||
|
return self
|
||
|
|
||
|
def initiator(self, initiator: str) -> "ApprovalInstanceBuilder":
|
||
|
self._approval_instance.initiator = initiator
|
||
|
return self
|
||
|
|
||
|
def instance_start_time(self, instance_start_time: str) -> "ApprovalInstanceBuilder":
|
||
|
self._approval_instance.instance_start_time = instance_start_time
|
||
|
return self
|
||
|
|
||
|
def status(self, status: str) -> "ApprovalInstanceBuilder":
|
||
|
self._approval_instance.status = status
|
||
|
return self
|
||
|
|
||
|
def tasks(self, tasks: List[ApprovalTask]) -> "ApprovalInstanceBuilder":
|
||
|
self._approval_instance.tasks = tasks
|
||
|
return self
|
||
|
|
||
|
def comments(self, comments: List[ApprovalComment]) -> "ApprovalInstanceBuilder":
|
||
|
self._approval_instance.comments = comments
|
||
|
return self
|
||
|
|
||
|
def api_id(self, api_id: str) -> "ApprovalInstanceBuilder":
|
||
|
self._approval_instance.api_id = api_id
|
||
|
return self
|
||
|
|
||
|
def build(self) -> "ApprovalInstance":
|
||
|
return self._approval_instance
|