# Code generated by Lark OpenAPI.

from typing import Optional

from lark_oapi.core.construct import init


class Span(object):
    _types = {
        "start": int,
        "end": int,
    }

    def __init__(self, d=None):
        self.start: Optional[int] = None
        self.end: Optional[int] = None
        init(self, d, self._types)

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


class SpanBuilder(object):
    def __init__(self) -> None:
        self._span = Span()

    def start(self, start: int) -> "SpanBuilder":
        self._span.start = start
        return self

    def end(self, end: int) -> "SpanBuilder":
        self._span.end = end
        return self

    def build(self) -> "Span":
        return self._span
