# 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 .auth_info import AuthInfo
from .client_info import ClientInfo


class Head(object):
    _types = {
        "id": str,
        "tenant_id": str,
        "app_id": str,
        "open_id": str,
        "tenant_key": str,
        "auth": AuthInfo,
        "fields": Dict[str, str],
        "env": str,
        "resource": str,
        "locale": str,
        "client": ClientInfo,
    }

    def __init__(self, d=None):
        self.id: Optional[str] = None
        self.tenant_id: Optional[str] = None
        self.app_id: Optional[str] = None
        self.open_id: Optional[str] = None
        self.tenant_key: Optional[str] = None
        self.auth: Optional[AuthInfo] = None
        self.fields: Optional[Dict[str, str]] = None
        self.env: Optional[str] = None
        self.resource: Optional[str] = None
        self.locale: Optional[str] = None
        self.client: Optional[ClientInfo] = None
        init(self, d, self._types)

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


class HeadBuilder(object):
    def __init__(self) -> None:
        self._head = Head()

    def id(self, id: str) -> "HeadBuilder":
        self._head.id = id
        return self

    def tenant_id(self, tenant_id: str) -> "HeadBuilder":
        self._head.tenant_id = tenant_id
        return self

    def app_id(self, app_id: str) -> "HeadBuilder":
        self._head.app_id = app_id
        return self

    def open_id(self, open_id: str) -> "HeadBuilder":
        self._head.open_id = open_id
        return self

    def tenant_key(self, tenant_key: str) -> "HeadBuilder":
        self._head.tenant_key = tenant_key
        return self

    def auth(self, auth: AuthInfo) -> "HeadBuilder":
        self._head.auth = auth
        return self

    def fields(self, fields: Dict[str, str]) -> "HeadBuilder":
        self._head.fields = fields
        return self

    def env(self, env: str) -> "HeadBuilder":
        self._head.env = env
        return self

    def resource(self, resource: str) -> "HeadBuilder":
        self._head.resource = resource
        return self

    def locale(self, locale: str) -> "HeadBuilder":
        self._head.locale = locale
        return self

    def client(self, client: ClientInfo) -> "HeadBuilder":
        self._head.client = client
        return self

    def build(self) -> "Head":
        return self._head
