# 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 EventSubscriber(object):
    _types = {
        "namespace": str,
        "auth_type": str,
        "token": str,
        "token_client_id": str,
        "token_url": str,
        "token_client_secret": str,
        "webhook_url": str,
        "id": str,
    }

    def __init__(self, d=None):
        self.namespace: Optional[str] = None
        self.auth_type: Optional[str] = None
        self.token: Optional[str] = None
        self.token_client_id: Optional[str] = None
        self.token_url: Optional[str] = None
        self.token_client_secret: Optional[str] = None
        self.webhook_url: Optional[str] = None
        self.id: Optional[str] = None
        init(self, d, self._types)

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


class EventSubscriberBuilder(object):
    def __init__(self) -> None:
        self._event_subscriber = EventSubscriber()

    def namespace(self, namespace: str) -> "EventSubscriberBuilder":
        self._event_subscriber.namespace = namespace
        return self

    def auth_type(self, auth_type: str) -> "EventSubscriberBuilder":
        self._event_subscriber.auth_type = auth_type
        return self

    def token(self, token: str) -> "EventSubscriberBuilder":
        self._event_subscriber.token = token
        return self

    def token_client_id(self, token_client_id: str) -> "EventSubscriberBuilder":
        self._event_subscriber.token_client_id = token_client_id
        return self

    def token_url(self, token_url: str) -> "EventSubscriberBuilder":
        self._event_subscriber.token_url = token_url
        return self

    def token_client_secret(self, token_client_secret: str) -> "EventSubscriberBuilder":
        self._event_subscriber.token_client_secret = token_client_secret
        return self

    def webhook_url(self, webhook_url: str) -> "EventSubscriberBuilder":
        self._event_subscriber.webhook_url = webhook_url
        return self

    def id(self, id: str) -> "EventSubscriberBuilder":
        self._event_subscriber.id = id
        return self

    def build(self) -> "EventSubscriber":
        return self._event_subscriber
