# Code generated by Lark OpenAPI.

from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init


class TemplateAttachment(object):
    _types = {
        "filename": str,
        "id": str,
        "attachment_type": int,
        "is_inline": bool,
        "cid": str,
    }

    def __init__(self, d=None):
        self.filename: Optional[str] = None
        self.id: Optional[str] = None
        self.attachment_type: Optional[int] = None
        self.is_inline: Optional[bool] = None
        self.cid: Optional[str] = None
        init(self, d, self._types)

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


class TemplateAttachmentBuilder(object):
    def __init__(self) -> None:
        self._template_attachment = TemplateAttachment()

    def filename(self, filename: str) -> "TemplateAttachmentBuilder":
        self._template_attachment.filename = filename
        return self

    def id(self, id: str) -> "TemplateAttachmentBuilder":
        self._template_attachment.id = id
        return self

    def attachment_type(self, attachment_type: int) -> "TemplateAttachmentBuilder":
        self._template_attachment.attachment_type = attachment_type
        return self

    def is_inline(self, is_inline: bool) -> "TemplateAttachmentBuilder":
        self._template_attachment.is_inline = is_inline
        return self

    def cid(self, cid: str) -> "TemplateAttachmentBuilder":
        self._template_attachment.cid = cid
        return self

    def build(self) -> "TemplateAttachment":
        return self._template_attachment
