# 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 .aily_message_file_preview import AilyMessageFilePreview


class AilyMessageFile(object):
    _types = {
        "id": str,
        "mime_type": str,
        "file_name": str,
        "metadata": str,
        "created_at": int,
        "preview_url": AilyMessageFilePreview,
    }

    def __init__(self, d=None):
        self.id: Optional[str] = None
        self.mime_type: Optional[str] = None
        self.file_name: Optional[str] = None
        self.metadata: Optional[str] = None
        self.created_at: Optional[int] = None
        self.preview_url: Optional[AilyMessageFilePreview] = None
        init(self, d, self._types)

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


class AilyMessageFileBuilder(object):
    def __init__(self) -> None:
        self._aily_message_file = AilyMessageFile()

    def id(self, id: str) -> "AilyMessageFileBuilder":
        self._aily_message_file.id = id
        return self

    def mime_type(self, mime_type: str) -> "AilyMessageFileBuilder":
        self._aily_message_file.mime_type = mime_type
        return self

    def file_name(self, file_name: str) -> "AilyMessageFileBuilder":
        self._aily_message_file.file_name = file_name
        return self

    def metadata(self, metadata: str) -> "AilyMessageFileBuilder":
        self._aily_message_file.metadata = metadata
        return self

    def created_at(self, created_at: int) -> "AilyMessageFileBuilder":
        self._aily_message_file.created_at = created_at
        return self

    def preview_url(self, preview_url: AilyMessageFilePreview) -> "AilyMessageFileBuilder":
        self._aily_message_file.preview_url = preview_url
        return self

    def build(self) -> "AilyMessageFile":
        return self._aily_message_file
