# 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 .runtime_log import RuntimeLog


class WorkflowInstanceLog(object):
    _types = {
        "total": str,
        "logs": List[RuntimeLog],
        "next_keyword_offset": str,
        "total_keyword": str,
        "has_read_auth": bool,
    }

    def __init__(self, d=None):
        self.total: Optional[str] = None
        self.logs: Optional[List[RuntimeLog]] = None
        self.next_keyword_offset: Optional[str] = None
        self.total_keyword: Optional[str] = None
        self.has_read_auth: Optional[bool] = None
        init(self, d, self._types)

    @staticmethod
    def builder() -> "WorkflowInstanceLogBuilder":
        return WorkflowInstanceLogBuilder()


class WorkflowInstanceLogBuilder(object):
    def __init__(self) -> None:
        self._workflow_instance_log = WorkflowInstanceLog()

    def total(self, total: str) -> "WorkflowInstanceLogBuilder":
        self._workflow_instance_log.total = total
        return self

    def logs(self, logs: List[RuntimeLog]) -> "WorkflowInstanceLogBuilder":
        self._workflow_instance_log.logs = logs
        return self

    def next_keyword_offset(self, next_keyword_offset: str) -> "WorkflowInstanceLogBuilder":
        self._workflow_instance_log.next_keyword_offset = next_keyword_offset
        return self

    def total_keyword(self, total_keyword: str) -> "WorkflowInstanceLogBuilder":
        self._workflow_instance_log.total_keyword = total_keyword
        return self

    def has_read_auth(self, has_read_auth: bool) -> "WorkflowInstanceLogBuilder":
        self._workflow_instance_log.has_read_auth = has_read_auth
        return self

    def build(self) -> "WorkflowInstanceLog":
        return self._workflow_instance_log
