# 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
from .country_region import CountryRegion


class CollectionTemplate(object):
    _types = {
        "template_id": str,
        "template_name": I18n,
        "version_id": str,
        "items": List[CollectionItem],
        "country_regions": List[CountryRegion],
        "is_active": bool,
        "effective_date": str,
        "created_time": str,
        "modified_time": str,
    }

    def __init__(self, d=None):
        self.template_id: Optional[str] = None
        self.template_name: Optional[I18n] = None
        self.version_id: Optional[str] = None
        self.items: Optional[List[CollectionItem]] = None
        self.country_regions: Optional[List[CountryRegion]] = None
        self.is_active: Optional[bool] = None
        self.effective_date: Optional[str] = None
        self.created_time: Optional[str] = None
        self.modified_time: Optional[str] = None
        init(self, d, self._types)

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


class CollectionTemplateBuilder(object):
    def __init__(self) -> None:
        self._collection_template = CollectionTemplate()

    def template_id(self, template_id: str) -> "CollectionTemplateBuilder":
        self._collection_template.template_id = template_id
        return self

    def template_name(self, template_name: I18n) -> "CollectionTemplateBuilder":
        self._collection_template.template_name = template_name
        return self

    def version_id(self, version_id: str) -> "CollectionTemplateBuilder":
        self._collection_template.version_id = version_id
        return self

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

    def country_regions(self, country_regions: List[CountryRegion]) -> "CollectionTemplateBuilder":
        self._collection_template.country_regions = country_regions
        return self

    def is_active(self, is_active: bool) -> "CollectionTemplateBuilder":
        self._collection_template.is_active = is_active
        return self

    def effective_date(self, effective_date: str) -> "CollectionTemplateBuilder":
        self._collection_template.effective_date = effective_date
        return self

    def created_time(self, created_time: str) -> "CollectionTemplateBuilder":
        self._collection_template.created_time = created_time
        return self

    def modified_time(self, modified_time: str) -> "CollectionTemplateBuilder":
        self._collection_template.modified_time = modified_time
        return self

    def build(self) -> "CollectionTemplate":
        return self._collection_template
