# 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 .connector_instance_definition import ConnectorInstanceDefinition


class ConnectorInstance(object):
    _types = {
        "api_id": str,
        "api_name": str,
        "label": Dict[str, str],
        "desc": Dict[str, str],
        "out_biz_type": str,
        "out_biz_id": str,
        "definition": ConnectorInstanceDefinition,
    }

    def __init__(self, d=None):
        self.api_id: Optional[str] = None
        self.api_name: Optional[str] = None
        self.label: Optional[Dict[str, str]] = None
        self.desc: Optional[Dict[str, str]] = None
        self.out_biz_type: Optional[str] = None
        self.out_biz_id: Optional[str] = None
        self.definition: Optional[ConnectorInstanceDefinition] = None
        init(self, d, self._types)

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


class ConnectorInstanceBuilder(object):
    def __init__(self) -> None:
        self._connector_instance = ConnectorInstance()

    def api_id(self, api_id: str) -> "ConnectorInstanceBuilder":
        self._connector_instance.api_id = api_id
        return self

    def api_name(self, api_name: str) -> "ConnectorInstanceBuilder":
        self._connector_instance.api_name = api_name
        return self

    def label(self, label: Dict[str, str]) -> "ConnectorInstanceBuilder":
        self._connector_instance.label = label
        return self

    def desc(self, desc: Dict[str, str]) -> "ConnectorInstanceBuilder":
        self._connector_instance.desc = desc
        return self

    def out_biz_type(self, out_biz_type: str) -> "ConnectorInstanceBuilder":
        self._connector_instance.out_biz_type = out_biz_type
        return self

    def out_biz_id(self, out_biz_id: str) -> "ConnectorInstanceBuilder":
        self._connector_instance.out_biz_id = out_biz_id
        return self

    def definition(self, definition: ConnectorInstanceDefinition) -> "ConnectorInstanceBuilder":
        self._connector_instance.definition = definition
        return self

    def build(self) -> "ConnectorInstance":
        return self._connector_instance
