# 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 .dmp_field import DmpField


class DmpTimelineField(object):
    _types = {
        "from_date": str,
        "to_date": str,
        "fields": List[DmpField],
    }

    def __init__(self, d=None):
        self.from_date: Optional[str] = None
        self.to_date: Optional[str] = None
        self.fields: Optional[List[DmpField]] = None
        init(self, d, self._types)

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


class DmpTimelineFieldBuilder(object):
    def __init__(self) -> None:
        self._dmp_timeline_field = DmpTimelineField()

    def from_date(self, from_date: str) -> "DmpTimelineFieldBuilder":
        self._dmp_timeline_field.from_date = from_date
        return self

    def to_date(self, to_date: str) -> "DmpTimelineFieldBuilder":
        self._dmp_timeline_field.to_date = to_date
        return self

    def fields(self, fields: List[DmpField]) -> "DmpTimelineFieldBuilder":
        self._dmp_timeline_field.fields = fields
        return self

    def build(self) -> "DmpTimelineField":
        return self._dmp_timeline_field
