# 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 .i18n import I18n
from .collection_item import CollectionItem


class CollectionTemplateSnapshot(object):
    _types = {
        "template_id": str,
        "template_name": I18n,
        "template_version_id": str,
        "items": List[CollectionItem],
        "activity_id": str,
    }

    def __init__(self, d=None):
        self.template_id: Optional[str] = None
        self.template_name: Optional[I18n] = None
        self.template_version_id: Optional[str] = None
        self.items: Optional[List[CollectionItem]] = None
        self.activity_id: Optional[str] = None
        init(self, d, self._types)

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


class CollectionTemplateSnapshotBuilder(object):
    def __init__(self) -> None:
        self._collection_template_snapshot = CollectionTemplateSnapshot()

    def template_id(self, template_id: str) -> "CollectionTemplateSnapshotBuilder":
        self._collection_template_snapshot.template_id = template_id
        return self

    def template_name(self, template_name: I18n) -> "CollectionTemplateSnapshotBuilder":
        self._collection_template_snapshot.template_name = template_name
        return self

    def template_version_id(self, template_version_id: str) -> "CollectionTemplateSnapshotBuilder":
        self._collection_template_snapshot.template_version_id = template_version_id
        return self

    def items(self, items: List[CollectionItem]) -> "CollectionTemplateSnapshotBuilder":
        self._collection_template_snapshot.items = items
        return self

    def activity_id(self, activity_id: str) -> "CollectionTemplateSnapshotBuilder":
        self._collection_template_snapshot.activity_id = activity_id
        return self

    def build(self) -> "CollectionTemplateSnapshot":
        return self._collection_template_snapshot
