# 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 Kctx(object):
    _types = {
        "tenant_id": str,
        "user_id": str,
        "tenant_domain_name": str,
        "user_setting": str,
        "lang_id": int,
        "request_id": str,
        "host": str,
        "tenant_resource_route_key": str,
        "namespace": str,
        "tenant_type": str,
        "transaction_id": str,
        "consistency_retry_type": str,
        "psm_link": str,
        "breakout_retry_psm": str,
        "credential_id": str,
        "authentication_type": str,
    }

    def __init__(self, d=None):
        self.tenant_id: Optional[str] = None
        self.user_id: Optional[str] = None
        self.tenant_domain_name: Optional[str] = None
        self.user_setting: Optional[str] = None
        self.lang_id: Optional[int] = None
        self.request_id: Optional[str] = None
        self.host: Optional[str] = None
        self.tenant_resource_route_key: Optional[str] = None
        self.namespace: Optional[str] = None
        self.tenant_type: Optional[str] = None
        self.transaction_id: Optional[str] = None
        self.consistency_retry_type: Optional[str] = None
        self.psm_link: Optional[str] = None
        self.breakout_retry_psm: Optional[str] = None
        self.credential_id: Optional[str] = None
        self.authentication_type: Optional[str] = None
        init(self, d, self._types)

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


class KctxBuilder(object):
    def __init__(self) -> None:
        self._kctx = Kctx()

    def tenant_id(self, tenant_id: str) -> "KctxBuilder":
        self._kctx.tenant_id = tenant_id
        return self

    def user_id(self, user_id: str) -> "KctxBuilder":
        self._kctx.user_id = user_id
        return self

    def tenant_domain_name(self, tenant_domain_name: str) -> "KctxBuilder":
        self._kctx.tenant_domain_name = tenant_domain_name
        return self

    def user_setting(self, user_setting: str) -> "KctxBuilder":
        self._kctx.user_setting = user_setting
        return self

    def lang_id(self, lang_id: int) -> "KctxBuilder":
        self._kctx.lang_id = lang_id
        return self

    def request_id(self, request_id: str) -> "KctxBuilder":
        self._kctx.request_id = request_id
        return self

    def host(self, host: str) -> "KctxBuilder":
        self._kctx.host = host
        return self

    def tenant_resource_route_key(self, tenant_resource_route_key: str) -> "KctxBuilder":
        self._kctx.tenant_resource_route_key = tenant_resource_route_key
        return self

    def namespace(self, namespace: str) -> "KctxBuilder":
        self._kctx.namespace = namespace
        return self

    def tenant_type(self, tenant_type: str) -> "KctxBuilder":
        self._kctx.tenant_type = tenant_type
        return self

    def transaction_id(self, transaction_id: str) -> "KctxBuilder":
        self._kctx.transaction_id = transaction_id
        return self

    def consistency_retry_type(self, consistency_retry_type: str) -> "KctxBuilder":
        self._kctx.consistency_retry_type = consistency_retry_type
        return self

    def psm_link(self, psm_link: str) -> "KctxBuilder":
        self._kctx.psm_link = psm_link
        return self

    def breakout_retry_psm(self, breakout_retry_psm: str) -> "KctxBuilder":
        self._kctx.breakout_retry_psm = breakout_retry_psm
        return self

    def credential_id(self, credential_id: str) -> "KctxBuilder":
        self._kctx.credential_id = credential_id
        return self

    def authentication_type(self, authentication_type: str) -> "KctxBuilder":
        self._kctx.authentication_type = authentication_type
        return self

    def build(self) -> "Kctx":
        return self._kctx
