# 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 .element import Element
from .header import Header
from .card_link import CardLink


class Data(object):
    _types = {
        "schema": str,
        "body": Element,
        "header": Header,
        "card_link": CardLink,
    }

    def __init__(self, d=None):
        self.schema: Optional[str] = None
        self.body: Optional[Element] = None
        self.header: Optional[Header] = None
        self.card_link: Optional[CardLink] = None
        init(self, d, self._types)

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


class DataBuilder(object):
    def __init__(self) -> None:
        self._data = Data()

    def schema(self, schema: str) -> "DataBuilder":
        self._data.schema = schema
        return self

    def body(self, body: Element) -> "DataBuilder":
        self._data.body = body
        return self

    def header(self, header: Header) -> "DataBuilder":
        self._data.header = header
        return self

    def card_link(self, card_link: CardLink) -> "DataBuilder":
        self._data.card_link = card_link
        return self

    def build(self) -> "Data":
        return self._data
