# 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 .event import Event


class Log(object):
    _types = {
        "content": str,
        "level": str,
        "timestamp": int,
        "event": Event,
        "trace_id": str,
        "attributes": str,
    }

    def __init__(self, d=None):
        self.content: Optional[str] = None
        self.level: Optional[str] = None
        self.timestamp: Optional[int] = None
        self.event: Optional[Event] = None
        self.trace_id: Optional[str] = None
        self.attributes: Optional[str] = None
        init(self, d, self._types)

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


class LogBuilder(object):
    def __init__(self) -> None:
        self._log = Log()

    def content(self, content: str) -> "LogBuilder":
        self._log.content = content
        return self

    def level(self, level: str) -> "LogBuilder":
        self._log.level = level
        return self

    def timestamp(self, timestamp: int) -> "LogBuilder":
        self._log.timestamp = timestamp
        return self

    def event(self, event: Event) -> "LogBuilder":
        self._log.event = event
        return self

    def trace_id(self, trace_id: str) -> "LogBuilder":
        self._log.trace_id = trace_id
        return self

    def attributes(self, attributes: str) -> "LogBuilder":
        self._log.attributes = attributes
        return self

    def build(self) -> "Log":
        return self._log
