# Code generated by Lark OpenAPI.

from typing import Optional, List

from lark_oapi.core.construct import init
from .content_block_element import ContentBlockElement


class ContentBlock(object):
    _types = {
        "blocks": List[ContentBlockElement],
    }

    def __init__(self, d=None):
        self.blocks: Optional[List[ContentBlockElement]] = None
        init(self, d, self._types)

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


class ContentBlockBuilder(object):
    def __init__(self) -> None:
        self._content_block = ContentBlock()

    def blocks(self, blocks: List[ContentBlockElement]) -> "ContentBlockBuilder":
        self._content_block.blocks = blocks
        return self

    def build(self) -> "ContentBlock":
        return self._content_block
