# 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 .i18n_content import I18nContent


class SegmentValue(object):
    _types = {
        "start_time": int,
        "end_time": int,
        "reference_values": List[I18nContent],
        "original_value": str,
    }

    def __init__(self, d=None):
        self.start_time: Optional[int] = None
        self.end_time: Optional[int] = None
        self.reference_values: Optional[List[I18nContent]] = None
        self.original_value: Optional[str] = None
        init(self, d, self._types)

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


class SegmentValueBuilder(object):
    def __init__(self) -> None:
        self._segment_value = SegmentValue()

    def start_time(self, start_time: int) -> "SegmentValueBuilder":
        self._segment_value.start_time = start_time
        return self

    def end_time(self, end_time: int) -> "SegmentValueBuilder":
        self._segment_value.end_time = end_time
        return self

    def reference_values(self, reference_values: List[I18nContent]) -> "SegmentValueBuilder":
        self._segment_value.reference_values = reference_values
        return self

    def original_value(self, original_value: str) -> "SegmentValueBuilder":
        self._segment_value.original_value = original_value
        return self

    def build(self) -> "SegmentValue":
        return self._segment_value
